Skip to main content
There are two distinct ways a policy can stop an operation:
  • Denial — the policy blocked it outright. The agent is not permitted to do this at all.
  • Pending approval — the operation is allowed in principle but exceeds a threshold that requires the owner to sign off first. See Policy Engine for how to configure approval thresholds.
This guide covers the denial case. When a transfer or contract call violates a policy, the Cobo Agentic Wallet service returns a structured 403 response. The SDK raises a PolicyDeniedError carrying machine-readable guidance that enables agents to self-correct and retry without human intervention.

Error hierarchy

The PolicyDenial structure

Example denial response:

Denial codes

Basic self-correction

Framework-specific handling

Each framework returns denials as tool output strings (not exceptions), so the LLM’s reasoning loop continues naturally:

Production patterns

Cap retry attempts to prevent infinite loops:
Cumulative limits (daily, monthly) can’t be fixed by adjusting parameters. Escalate to the owner instead:
If details fields are missing, parse the suggestion text: