This page is optimized for AI agent consumption. For human-friendly guides, see the Documentation.
Quick Reference
Mandatory Security Rules
These rules are non-negotiable. Violating any of them is a security breach, not a simplification.- Call
/validatebefore EVERY transaction. No exceptions. - If
allowed: false, do NOT execute. Display theblockReasonto the user. - If the API is unreachable, do NOT execute. Do NOT fall back to the wallet directly.
- Display validation results to the user BEFORE any wallet call.
- Even with custodial wallets, validate with Mandate BEFORE calling the wallet API.
- Skipping validation bypasses spend limits, allowlists, and approval workflows the owner configured.
Fail-Safe Behavior
When the Mandate API is unreachable:- Do NOT execute the transaction.
- Do NOT fall back to calling the wallet API directly.
- Display:
Mandate: policy server unreachable, transaction halted for safety - Retry up to 3 times at 30-second intervals.
- If all retries fail:
Cannot execute until policy server recovers. No funds were spent.
Primary Endpoint: POST /validate
Policy check before every transaction. Works with any wallet type (custodial or self-custodial).Parameters
Response
Registration: POST /agents/register
No auth required. Creates an agent identity and returns credentials.Response
claimUrl to the human owner so they can link the agent to their dashboard. Store runtimeKey in ~/.mandate/credentials.json with chmod 600.
Agents use POST /agents/register, not dashboard login. Dashboard login is for humans only.
For details, see Register an Agent.
Activation: POST /activate
Set the EVM address for a registered agent. Call once after registration. Requires auth.Status Polling: GET /intents/{id}/status
Poll the state of a validated intent.approved, then proceed. See Handle Approvals.
Validation Flow
Error Handling
HTTP Status Codes
All errors return JSON:
{ "error": "message" } or { "allowed": false, "blockReason": "..." }
For error handling guidance, see Handle Errors and Common Errors.
SDK Error Types
Block Reason Values
For the full reference, see Block Reasons.
Intent States
For the full lifecycle, see Intent Lifecycle and Intent States.
Chain Reference
Test keys (mndt_test_*): Sepolia (11155111), Base Sepolia (84532).
Live keys (mndt_live_*): Ethereum (1), Base (8453).
For the full reference, see Chain Reference.
Default Policy
After registration, every agent gets:
Adjust policies via the dashboard or Policy Builder.
Tool-to-Endpoint Map
For CLI installation and usage, see CLI Overview.
The reason Field
Every validation call requires areason string (max 1000 chars). This is what session keys cannot capture: the intent behind a transaction.
Mandate uses the reason to:
- Scan for prompt injection (18 hardcoded patterns + optional LLM judge)
- Return a
declineMessageon block to counter manipulation - Show it to the owner on approval requests (Slack, Telegram, dashboard)
- Log it in the audit trail permanently
Integration Plugins
For platforms with hook support, use the plugin instead of raw API calls. Plugins enforce validation automatically.
For all integrations, see Integrations Overview.