AP2 Mandates
Cryptographic spending constraints for agents.
Concept
Instead of giving an agent your private key, you sign a Mandate. This mandate is a policy document enforced by the P402 Router.
Intent Mandate
"Allow agent X to spend up to $10 on Compute."
Payment Mandate
"Settle this specific invoice for $0.05."
Creating a Mandate
POST /api/a2a/mandates
{
"mandate": {
"type": "intent",
"user_did": "did:key:zUser...",
"agent_did": "did:key:zAgent...",
"constraints": {
"max_amount_usd": 50.00,
"allowed_categories": ["inference", "search"],
"valid_until": "2026-12-31T23:59:59Z"
},
"signature": "0x..." // EIP-712 Signature
}
}