Sync and Async Parity: Approval checks now work uniformly in both sync and async tool execution paths. Previously, async calls bypassed approval prompts.
Quick Start
How users approve
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Turn approval on/off — safe by default |
backend | str | "console" | One of: console, slack, telegram, discord, webhook, http, agent, auto, none |
approve_all_tools | bool | false | If true, every tool needs approval (not just risky ones) |
timeout | float | null | Seconds to wait for a decision; null = no timeout |
approve_level | ApprovalLevel | null | null | Auto-approve up to this risk level: low, medium, high, critical |
guardrails | str | null | Free-text guardrail description |
default_policy | "deny" | "prompt" | "allow" | "prompt" | Policy when no per-tool entry matches |
approve_tools | Dict[str, ApprovalLevel] | null | null | Per-tool granularity, e.g. {"shell": "critical"} |
permissions | Dict[str, Any] | null | Declarative allow/deny/ask rules. See Declarative Permissions. |
Approval backends decide how to ask a human (Slack, console, …). Declarative
permissions decide whether to ask at all in non-interactive runs.YAML
Hook installation
Register abefore_tool hook that enforces the policy:
approval: true (console), approval: slack (named backend), approval: false / null (off).
Unknown keys raiseValueError— typos likeapprove_levels:will fail loudly.
CLI
| CLI flag | YAML / Python field |
|---|---|
--trust | backend: auto |
--approval <name> | backend: <name> |
--approve-all-tools | approve_all_tools: true |
--approval-timeout <s> | timeout: <s> |
--approve-level <l> | approve_level: <l> |
--allow <pattern> | permissions: { "<pattern>": allow } |
--deny <pattern> | permissions: { "<pattern>": deny } |
--permissions <file> | Load rules from YAML/JSON file |
--permission-default <action> | permissions: { "*": <action> } |
--guardrail "<txt>" | guardrails: "<txt>" |
Using approval with async agents
When using async agents (.achat(), .astart(), or async tools), the default console backend will fail with PermissionError. Configure a non-console backend:
webhook, http, slack, telegram, discord, agent.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
PermissionError: Approval request failed for <tool> | Async agent with console backend | Configure a non-console backend |
RuntimeError: Tool '<tool>' requires approval but cannot use console I/O from async context. | Same root cause, surfaced earlier | Same fix |
Best practices
Console approval
Console approval
No env vars needed; you see the prompt directly in the terminal.
Slack approval
Slack approval
Routes approval requests to a channel humans already watch.
Set timeouts
Set timeouts
Without a timeout, the agent blocks indefinitely waiting for a decision.
Use approve_level
Use approve_level
approve_level: high lets safe tools run without prompts and only gates the dangerous ones.Related
All backend protocols (Slack, Telegram, Discord, Webhook, HTTP, Agent)
Full CLI flag reference

