Building Agentic Commerce #7: Card Network Adapters for Visa VIC & Mastercard Agent Pay
How Trusteed integrates Visa Intelligent Commerce (VIC) and Mastercard Agent Pay (MCAP) to give AI agents access to 2B+ tokenized cards: without ever seeing card data.
Executive summary
A technical walkthrough of how Trusteed connects AI agents to Visa and Mastercard's tokenized payment rails: covering VIC's 4-layer cryptography stack, MCAP's agent-identity and consent model (settlement not available), consent management, and the unified AgentPaymentIntent model that lets merchants accept both with a single integration.
Published
2026-05-15
13 min read
Author
Trusteed
Published by Trusteed
Written and maintained by the team that builds Trusteed. Technical claims in these articles are backed by the surfaces linked from each piece and by the signed capability registry at /.well-known/trusteed-capabilities.json, which is the arbiter when an article and a status surface disagree.
About TrusteedCategory
Developer Guides
AI agents can search products, compare prices, and build carts across protocols like MCP, ACP, and A2A. But when it's time to pay, the agent needs access to real payment rails: Visa, Mastercard, the networks that process 80% of global card transactions. This post covers how Trusteed integrates both card networks through purpose-built adapters, giving agents tokenized payment access without ever exposing card data.
The Problem: Agents Need Card Rails
Stablecoin payments (x402) and protocol-native checkout (ACP, UCP) work well for crypto-native and platform-native flows. But most consumers still pay with Visa and Mastercard. For agentic commerce to reach mainstream adoption, agents need to interact with card networks: securely, with consumer consent, and without handling raw card numbers. Visa's Intelligent Commerce (VIC) and Mastercard's Agent Pay (MCAP) are the two card network protocols designed specifically for this use case.
Visa Intelligent Commerce (VIC)
VIC is Visa's direct API integration for agentic payments. The agent creates a purchase instruction with amount, currency, and merchant details. Visa's backend tokenizes the card via VTS (Visa Tokenization Service), binds it to the consumer's FIDO-enrolled device, and returns payment credentials: never exposing card data to the agent or merchant backend.
VIC Architecture: 4-Layer Cryptography
VIC's security model uses four cryptographic layers: (1) JWE token authentication: RS256 signing + RSA-OAEP-256 encryption with stale-while-revalidate caching (3600s TTL, auto-refresh 60s before expiry). (2) X-Pay HMAC: request-level integrity verification. (3) Message-Level Encryption (MLE): RSA-OAEP-256 key wrapping + A128GCM content encryption for payload confidentiality. (4) HTTPS: transport-level encryption. This means every VIC API call is signed, encrypted at message level, and transmitted over TLS: defense in depth against man-in-the-middle, replay, and data exfiltration attacks.
VIC Settlement Flow
The settlement service exposes three operations: createInstruction(): creates a VIC purchase instruction with amount, currency, merchant category code (MCC), frequency (SINGLE or recurring WEEKLY/MONTHLY), and shipping address. retrieveAndConfirm(): obtains payment credentials from VIC without exposing card data, then confirms the transaction event. cancelInstruction(): cancels an active purchase instruction. All operations use exponential backoff retry (max 3 attempts: 2s, 4s, 8s delays) and circuit breaker protection for resilience.
VIC Mandate Types
- 1Single mandates (PRO tier): One-time purchase instruction with transaction limit enforcement
- 2Recurring mandates (ENTERPRISE tier): WEEKLY or MONTHLY frequency with state reconciliation and webhook-driven updates
- 3Multi-merchant mandates (ENTERPRISE tier): Agent can pay across multiple merchants under a single consumer enrollment
Mastercard Agent Pay (MCAP)
MCAP takes the opposite approach to VIC. Instead of a direct API integration with multi-layer cryptography, the design centres on agent identity verification and consumer consent management, with the Agentic Token (a 16-digit network token) as the payment credential. Correction 2026-10-11: an earlier version of this article described an automatic settlement path through Stripe for any merchant with Stripe enabled. That path does not exist: there is no Mastercard settlement integration, so Mastercard Agent Pay is not available and no payment is attempted through it. The inbound HTTP Message Signatures adapter only runs where an operator has set MCAP_ENABLED=true; settlement is not offered.
MCAP: HTTP Message Signatures (RFC 9421)
MCAP verifies agent identity using HTTP Message Signatures per RFC 9421 with Ed25519 keys. Every payment request includes Signature-Input and Signature headers with tag='agent-payer-auth'. The signature service parses the input header, extracts keyid/created/expires/nonce/alg, validates the Ed25519 signature against the agent's public key, enforces clock skew tolerance (plus or minus 30 seconds), and prevents replay attacks via a nonce cache with 5-minute TTL. Key rotation is supported with a 24-hour grace period for smooth transitions.
MCAP: Consent Scope Management
MCAP's consent service validates every transaction against the consumer's consent scope: maximum amount per period, allowed merchant category codes (MCCs), specific merchant IDs, and time windows. Accumulated usage tracking uses optimistic locking (WHERE updatedAt condition) for concurrent safety. Consent periods (DAILY, WEEKLY, MONTHLY) auto-reset when expired. Consumers can revoke consent at any time with immediate effect, ensuring the consumer always maintains control over their agent's spending authority.
VIC vs MCAP: Architecture Comparison
- 1Integration model: VIC uses 6 direct API endpoints; MCAP has no settlement integration (not available)
- 2Cryptography: VIC has 4 layers (JWE + X-Pay + MLE + HTTPS); MCAP has 1 layer (Ed25519 HTTP signatures)
- 3Merchant activation: VIC requires API key + MLE certificates; MCAP is not available: it is not switched on by enabling Stripe
- 4Enrollment: VIC uses FIDO multi-step device binding per card; MCAP uses pre-enrolled Mastercard Agent Sign-Up
- 5Settlement: VIC returns its own credential-based payment token; MCAP has no settlement path today (not available)
- 6Recurring: VIC has native WEEKLY/MONTHLY mandates with state sync; MCAP has no recurring support today (not available)
- 7Complexity: VIC is crypto-heavy (7/10); MCAP is signature-focused (4/10)
- 8Consumer auth: VIC binds to FIDO device; MCAP delegates to Mastercard app/biometrics
Unified Integration: The AgentPaymentIntent Model
Both VIC and MCAP feed into the same AgentPaymentIntent model, the platform's universal payment abstraction. The Protocol Router detects the incoming protocol via headers (X-Protocol: VIC or Signature-Input with agent-payer-auth tag), normalizes the request through the respective inbound adapter, and routes it to the settlement service. VIC is bidirectional (inbound + outbound adapters); MCAP is inbound-only since settlement happens via Stripe. Both adapters implement the IProtocolAdapter interface (detect, normalize, translate, healthCheck) and register in the PluginRegistry at server startup.
Protocol Detection Priority
VIC is never auto-selected as a fallback: it requires active consumer enrollment and an explicit X-Protocol: VIC header. If the header is detected but the consumer is not enrolled, the request fails with a clear error. MCAP has zero fallback friction: if a merchant has Stripe configured, MCAP payment requests are accepted automatically. Both protocols pass through the unified KYAI policy engine for spending limits, merchant verification, and agent trust scoring before settlement.
Tier Gating
- 1PRO tier: VIC single mandates + MCAP basic agent payments
- 2ENTERPRISE tier: VIC recurring mandates + multi-merchant + MCAP consent management
- 3Both use the requireTier() middleware pattern consistent with all other protocol adapters
Combined Coverage: 80% of Global Card Payments
Together, VIC and MCAP provide coverage for approximately 2 billion tokenized cards globally: Visa's 1B+ and Mastercard's 1B+ cardholders. Combined with x402 stablecoin payments, ACP protocol-native checkout, and UCP standardized flows, Trusteed handles all of them through one integration. Merchants configure their preferred protocols once. The Protocol Router handles detection and routing automatically.
Production Status and Testing
VIC (spec 014) is complete with 200+ tests across 14 test files covering adapter detection, API client, settlement flow, MLE/JWE crypto, token manager, circuit breaker, analytics, enrollment, recurring mandates, schemas, and config validation. Currently in sandbox awaiting Visa production credentials (external blocker). MCAP (spec 017) is complete with 78 tests across 6 files covering adapter detection, RFC 9421 signature verification, consent validation, nonce cache, schemas, and integration. MCAP is enabled in production (Railway MCAP_ENABLED=true). Both specs are fully implemented: the only remaining dependency is Visa's production credential issuance for VIC.
Card network adapters are one of seven payment protocols supported by Trusteed. For the full protocol stack: MCP native checkout, x402 stablecoin payments, ACP protocol-native flows, UCP standardized checkout, A2A agent-to-agent messaging, and card network adapters: see the Building Agentic Commerce series at /en/blog.
Frequently asked questions
Does the AI agent ever see the consumer's actual card number?
Never. Both VIC and MCAP use tokenized payment flows. VIC creates tokenized credentials via Visa Tokenization Service (VTS) with FIDO device binding. The agent only receives a purchase instruction ID. MCAP uses 16-digit Agentic Tokens that are standard network tokens processed through Stripe. No raw card data touches the agent or merchant backend. All card data stays within the card network's secure infrastructure.
Can a merchant accept both Visa VIC and Mastercard MCAP simultaneously?
Yes. Both protocols register as separate adapters in the PluginRegistry and implement the same IProtocolAdapter interface. The Protocol Router detects which protocol the incoming request uses (via headers) and routes to the correct adapter. A merchant on PRO or ENTERPRISE tier can accept VIC, MCAP, x402, ACP, UCP, and A2A payments: all through a single MCP endpoint.
What happens if a consumer revokes their MCAP consent mid-transaction?
Consent revocation takes immediate effect. If a consumer revokes consent via the Mastercard app while an agent is attempting a purchase, the McapConsentService.validateAndConsume() call will reject the transaction. The agent receives a clear error indicating consent was revoked, and can inform the user accordingly. No payment is attempted: Mastercard Agent Pay is not available for payment (there is no Mastercard settlement integration).
Why does VIC require 4 cryptographic layers while MCAP only needs 1?
Architecture difference. VIC is a direct API integration. The merchant backend communicates directly with Visa's servers, requiring end-to-end cryptographic verification at every layer (authentication, integrity, confidentiality, transport). MCAP is built around agent identity: the merchant verifies the agent via HTTP Message Signatures and the consumer's consent scope. Correction 2026-10-11: this answer used to say Stripe acts as an intermediary that handles the cryptography with Mastercard; there is no such integration, and Mastercard Agent Pay is not available for payment. The complexity is distributed differently.
Is Visa TAP the same as VIC?
No. Visa TAP (Token and Permissions) is a separate initiative that Visa is developing for broader agentic use cases. When TAP's public specification is released, Trusteed plans to extend the existing VIC adapter rather than creating a new protocol adapter. The architecture is designed for incremental extension. TAP is currently being monitored for spec publication.
Sources and references
- Visa Intelligent Commerce (VIC) Developer Documentation
Visa Developer Center
- Mastercard Agent Pay: Agentic Commerce Specification
Mastercard Developers
- RFC 9421: HTTP Message Signatures
IETF
Related articles
Developer Guides
Building Agentic Commerce #1: Multi-Protocol Checkout with MCP + x402 + ACP in One Flow
One agent, three protocols, one checkout. Here's how MCP, x402 stablecoin payments, and ACP work together to let AI agents buy products, with code examples you can run today.
Developer Guides
Building Agentic Commerce #4: x402 Stablecoin Payments, When Agents Pay in USDC
How AI agents make on-chain USDC payments using the x402 protocol: multi-chain settlement, EIP-712 signatures, and stablecoin checkout.
Developer Guides
Building Agentic Commerce #3: Reading Trust Score v4.1
Trust Score v4.1: three weighted dimensions, an optional bonus and confidence caps. Read each response's engine; legacy v2 fallback remains possible.