How approval works
- Guard evaluates an action → decision is
require_approval - Apie emits
agent.approval.requested - SDK polls the dashboard via
approvals.wait() - Human approves or rejects in the Apie dashboard
- Apie emits
agent.approval.resolved - If approved, the callback proceeds; if rejected or timed out, an error is thrown
Configure timeout
Default approval wait is 5 minutes. Adjust withapprovalTimeoutMs:
Automatic approval in withTool
When Enforce mode is active and a policy decision isrequire_approval, withTool handles the full flow automatically — you don’t call approvals.wait() manually.
What you’ll see
A pending approval in the Apie dashboard with the action details, matched guardrail, and approve/reject buttons. After resolution, the run timeline shows the approval requested and resolved events.Manual approval polling
For custom flows, poll approval status directly:MCP proxy approvals
In MCP proxy Enforce mode, approval-required tool calls are blocked at the proxy layer. The MCP host receives JSON-RPC error-32002 if approval is denied or times out.
Configure approval timeout in apie.mcp.json:
Approval statuses
| Status | Meaning |
|---|---|
approved | Human approved — execution proceeds |
rejected | Human rejected — execution throws |
expired | Approval window expired in dashboard |
cancelled | Approval was cancelled |
timeout | SDK wait timed out before resolution |
Next steps
MCP enforcement
Enforce mode + approval through MCP proxy.
Enforce guardrails
Configure Enforce mode and failure handling.
