Available Backends
Which class runs the prompt?
Agent(approval=True)in Python →praisonaiagents.approval.ConsoleBackend(Rich terminal prompt, no permission-mode features).praisonai --approval console(alsotrue,Console,plan,accept-edits,bypass) →praisonai_code.cli.approval_backend.InteractiveCLIApprovalBackend, which layersPermissionMode(plan / accept-edits / bypass) and declarative permission rules on top.
praisonai permissions rules) come from InteractiveCLIApprovalBackend.- On any of these backends, standing registry grants (
PRAISONAI_AUTO_APPROVE, YAMLapprove:, session grants recorded via[s]) are now checked before the backend is invoked — no more re-prompting for calls the user already blessed. Fixed in PR #4878. See Standing grants and attached backends.
How It Works
A risky tool call pauses until the chosen backend collects a human decision.Diff preview
Theconsole backend renders a coloured unified diff for file-mutating tools — edit_file, acp_edit_file, write_file, acp_create_file, and apply_patch — so the reviewer sees the concrete change, not truncated arguments.
The diff rides on ApprovalRequest.context["diff"], a stable public field. Wrapper backends (slack, telegram, discord, webhook, http) can read it and render or attach it in their channel — this is where custom-backend authors should look.
Backend Matrix
Wrapper backends (
slack, telegram, discord, webhook, http, secure, presentation) require pip install praisonai.CLI opt-outs register a registry backend
praisonai code --no-safe and --dangerously-skip-approval do two things, not one:
- Set env vars —
PRAISON_APPROVAL_MODE=auto,PRAISONAI_TOOL_SAFETY=off— consumed by the CLI’s own tool wiring. - Register
AutoApproveBackendon the approval registry — consumed by the core@require_approvaldecorator that gates critical tools likeacp_execute_command. Without this the flag was a no-op for any registry-decorated tool.
AutoApproveBackend a prior --no-safe installed in the same process, and removes only that backend — a caller-supplied backend or one installed by --plan is preserved. A per-agent backend still wins, since the core consults Agent(approval=…) before the global registry. See Approval → Bypassing safety for the full resolution order.
Quick Start
1
Choose your approval mode
- Terminal
- Coding fast path
- Chat channel (wrapper)
Ask the user on the terminal before each risky tool call:
--approval-timeout
--approval-timeout takes seconds. Pass none to wait indefinitely.
Reviewer-Agent Mode (--approval agent)
When you pass --approval agent, a built-in LLM reviewer gates every tool call. The default reviewer instruction is:
“You are a security reviewer. Only approve low-risk read operations. Deny anything destructive. Respond with exactly one word: APPROVE or DENY”
APPROVE or DENY for each pending tool call. You can override the default instruction by passing a custom reviewer prompt via the API:
Unknown-Backend Error
If you pass an unrecognised backend name, the CLI raises:Best Practices
Use console in interactive dev, agent for unattended runs
Use console in interactive dev, agent for unattended runs
Use
console in interactive dev, agent for unattended runs where a reviewer LLM can gate tools.Pair accept-edits and plan with praisonai-code code
Pair accept-edits and plan with praisonai-code code
accept-edits and plan are the coding-mode fast paths — pair them with praisonai-code code.Never use none outside throwaway sandboxes
Never use none outside throwaway sandboxes
none disables approval entirely; only use it in throwaway sandboxes.Related
Local Tools Loading
Approval decides who says yes to your local tools.
Approval
The full approval system — dangerous tool gating, TTY detection, and safe defaults.

