Payment Protocols
Agent payment protocols let autonomous systems prove intent, permissions, and constraints before money moves. Without them, you have no way to verify that an agent was actually authorized to initiate a payment — or to what limits. Anima supports three major agent payment protocols through a single unified interface,ProtocolRouter, so your fraud engines and limit checks stay protocol-agnostic.
Protocol comparison
| Protocol | Primary primitive | Best fit | Delegation model |
|---|---|---|---|
| Visa TAP | HTTP signatures + nonces | Real-time API authorization | Key-based agent identity |
| Google AP2 | Mandates + capabilities | Checkout and shopping tasks | Multi-hop narrowing chain |
| Mastercard VI | SD-JWT credentials | Constrained delegated payments | L1 → L2 → L3 credential chain |
ProtocolRouter
ProtocolRouter gives you a single entry point to verify payment requests across all supported protocols. Pass the incoming request and it routes verification to the correct protocol handler, then returns a normalized result.
protocol-router.ts
Normalize all protocol outputs into one internal policy schema so your fraud and limit engines stay protocol-agnostic. This lets you apply consistent rules without branching logic per protocol.
Protocol details
Visa TAP
Visa TAP
Visa TAP secures agent-initiated payment requests with HTTP Message Signatures (RFC 9421) and registry-verifiable agent keys.Supported algorithms: Ed25519, rsa-pss-sha256Replay protection
Agent Registry API
| Field | Requirement | Purpose |
|---|---|---|
| Nonce | 64-byte base64 value | Prevent duplicate request replay |
| Freshness window | 8 minutes max skew | Reject stale captured requests |
| Nonce cache | TTL ≥ 8 minutes | Guarantee one-time use within validity window |
GET /api/agents/:id— Fetch agent identity and public keysPOST /api/agents/:id/keys— Register a new signing keyPOST /api/agents/:id/revoke— Revoke a compromised key
visa-tap-sign.ts
Persist nonce and signature input hashes for short-term forensic replay analysis.
Google AP2
Google AP2
AP2 defines structured mandates and delegation chains so agents can execute commerce actions with explicit, narrow authority.Mandate types: Cart, Intent, PaymentScopes:
Multi-hop delegationDelegation chains narrow authority at each hop — every child mandate is a strict subset of its parent. Child scopes must be a subset of parent scopes, and child capabilities must be a subset of parent capabilities.Mandate parsing example
checkout, payment, browse, compare, negotiateCapabilities| Capability | Description |
|---|---|
select_item | Choose candidate products or services |
add_to_cart | Modify cart composition and quantities |
checkout | Submit checkout details up to the payment step |
pay | Execute an authorized payment transaction |
confirm_order | Confirm and persist the final order receipt |
manage_subscription | Create, update, or cancel recurring service plans |
ap2-parse-mandate.ts
Route all AP2 verification outcomes through
ProtocolRouter.verify() for consistent fallback and metrics tagging.Mastercard VI
Mastercard VI
Mastercard VI uses SD-JWT credential chains (signed with ES256 over P-256/SHA-256) to delegate payment authority from issuers to agents with explicit time and policy constraints.Credential chain levels: L1, L2 Immediate, L2 Autonomous, L3a/L3bConstraint types
Credential chain validation example
| Constraint | Intent |
|---|---|
allowed_merchant | Permit transactions only for specific merchant identities |
line_items | Constrain purchasable SKUs and quantities |
allowed_payee | Restrict the destination payee account |
amount | Set maximum and minimum transaction amount boundaries |
budget | Enforce a cumulative spending ceiling over a period |
recurrence | Define schedule rules for recurring charges |
agent_recurrence | Limit autonomous repeated actions by agent identity |
reference | Require transaction metadata matching a policy reference |
mastercard-vi-validate.ts
Feed normalized constraint results into your shared decision engine to keep Mastercard VI aligned with Visa TAP and AP2 policy outputs.
