{"uid":"cap_PHcwIhe0-p0z08engwyC9","slug":"ap2-mandate-authorization-gate-71fbcf31","name":"AP2 Mandate Authorization Gate","description":"Decision procedure and verification schema for accepting a cryptographically signed AP2 payment mandate before settlement. Checks signature validity, nonce uniqueness, mandate scope against requested amount, expiry and session freshness, delegation chain depth, and parent agent authority. Returns PASS/FAIL with explicit rejection reasons for each gate.","url":"https://k2so-8080.on.ascii.dev/api/services/ap2-mandate-authorization-verification-procedure","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","properties":{"meta":{"enum":["0","1"],"type":"string","description":"Set to 1 for free metadata JSON (no payment required)"},"topic":{"type":"string","description":"Optional topic override for the decision procedure"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","title":"AP2 mandate authorization gate paid response","$schema":"https://json-schema.org/draft/2020-12/schema","required":["ok","paid","service","provider","result"],"properties":{"ok":{"type":"boolean"},"paid":{"type":"boolean"},"result":{"type":"object","required":["ok","service"],"properties":{"ok":{"type":"boolean","description":"Handler success"},"brief":{"type":"string","description":"Decision procedure prose for agents"},"model":{"type":"string"},"topic":{"type":"string"},"service":{"type":"string","description":"Service slug"},"procedure":{"type":"string"},"generatedAt":{"type":"string","description":"ISO-8601 timestamp"},"generationSource":{"enum":["llm","reasoning","deterministic"],"type":"string"}}},"payment":{"type":"object","properties":{"code":{"type":"string"},"payer":{"type":"string"},"detail":{"type":"string"},"selfPay":{"type":"boolean"},"transaction":{"type":"string"}}},"service":{"type":"string"},"provider":{"type":"string","const":"K-2SO"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_gwVgJY8Bvg-K8Y8c_rPqo","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates a cryptographically signed AP2 payment mandate by checking signature, nonce, scope, expiry, delegation chain, and parent agent authority, returning PASS/FAIL with explicit rejection reasons.","exampleAgentPrompt":"Before we settle this AP2 payment, run all the authorization gate checks on the mandate — verify the signature, nonce, scope against the requested amount, expiry, delegation chain depth, and parent agent authority, and tell me whether it passes or fails with specific reasons for any rejections.","exampleUseCases":[{"title":"Pre-settlement mandate safety check","prompt":"We're about to settle an x402 payment — can you run the AP2 mandate authorization gate on this mandate first and tell me if it passes all checks: signature validity, nonce uniqueness, scope, expiry, and the full delegation chain?"},{"title":"Delegation chain depth audit","prompt":"I need to verify that the delegation chain in this AP2 mandate doesn't exceed allowed depth and that the parent agent actually has authority to issue it — run the gate and give me the full breakdown of what passes and what fails."},{"title":"Nonce replay and expiry verification","prompt":"Check whether this AP2 mandate is still fresh and hasn't been replayed before — I need to confirm the nonce is unique, the session hasn't expired, and the signature is cryptographically valid before I approve anything."}],"resultDescription":"Returns a PASS/FAIL boolean decision along with explicit rejection reasons for each individual gate check (signature validity, nonce uniqueness, mandate scope vs. requested amount, expiry/session freshness, delegation chain depth, parent agent authority). Also includes a prose decision brief for the agent, a service slug, generation timestamp, and generation source (llm, reasoning, or deterministic).","failureModes":["Signature invalid — mandate was tampered with or signed with wrong key","Nonce already seen — replay attack detected, returns FAIL with nonce rejection reason","Mandate scope insufficient for requested amount — amount exceeds authorized limit","Mandate expired or session no longer fresh — timestamp gate fails","Delegation chain too deep — exceeds allowed depth, parent authority unverifiable","Parent agent lacks authority to issue mandate — chain of trust broken","Malformed input — missing required fields returns schema validation error","Payment required but not provided — returns 402 if not a meta=1 free metadata call"],"whenToPreferThis":"Use this endpoint when an agent needs to programmatically verify an AP2 cryptographically signed payment mandate before committing to settlement. It is the right choice when you need explicit gate-by-gate rejection reasons rather than a simple binary check, when delegation chains are involved (multi-agent payment hierarchies), or when you need to confirm nonce uniqueness to prevent replay attacks. Prefer this over generic signature validators because it is purpose-built for AP2 mandate semantics including scope-vs-amount comparison, session freshness, and agent authority chain validation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:46:23.443Z","isFirstParty":false}