skills/ai/ap2/SKILL.md
Use when implementing the Agent Payments Protocol (AP2) for secure, compliant AI-driven commerce. Covers intent mandates, cart mandates, payment flows, and merchant integration. USE FOR: agent-driven purchases, secure commerce mandates, user-authorized shopping flows, payment credential verification DO NOT USE FOR: API micropayments (use x402), agent communication (use a2a), tool integration (use mcp)
npx skillsauth add Tyler-R-Kendrick/agent-skills ap2Install this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
AP2 is an open protocol from Google for secure, interoperable AI-driven commerce. It provides a common language for transactions between agents and merchants, preventing a fragmented payments ecosystem. AP2 is designed as an extension for A2A and MCP, adding a secure commerce layer on top of agent communication.
Captures the conditions under which an AI agent can make a purchase on behalf of the user:
Captures the user's final, explicit authorization for a specific cart:
User Agent Merchant Payment Provider
│ │ │ │
│── "Buy X" ───►│ │ │
│ │── browse ─────►│ │
│ │◄── product ────│ │
│ │ │ │
│◄── confirm? ──│ │ │
│── approve ───►│ (Cart Mandate signed) │
│ │── purchase ───►│ │
│ │ │── charge ───────►│
│ │ │◄── receipt ──────│
│ │◄── receipt ────│ │
│◄── done ──────│ │ │
| Principle | Description | |-----------|-------------| | User control | Users set spending limits and approve purchases via signed mandates | | Verifiable credentials | Cryptographic signatures provide non-repudiable proof of authorization | | Protocol-agnostic payments | Supports pull methods (credit/debit cards) initially, with push methods (bank transfers, wallets) planned | | Compliant by design | Built-in support for regulatory requirements (PCI, PSD2) |
| Version | Scope | |---------|-------| | v0.1 | Core architecture, pull payment methods (credit/debit cards) | | Future | Push payments, real-time bank transfers, e-wallets, multi-currency |
| Aspect | AP2 | x402 | |--------|-----|------| | Focus | Full commerce flow (browse → buy → receipt) | Per-request API micropayments | | Payment methods | Cards, bank transfers, wallets | Stablecoins (USDC on Base/Solana) | | Authorization | Intent + Cart Mandates with user signatures | Wallet-signed HTTP headers | | Use case | Agent-driven shopping and purchases | Monetizing APIs and content | | Relationship | Extension for A2A/MCP | Standalone HTTP protocol |
AP2 extends existing protocols:
tools
Use when building or maintaining a design system — the coordinated set of design tokens, component libraries, documentation, and tooling that ensures visual and behavioral consistency across products. USE FOR: design system architecture, choosing token formats vs component frameworks, connecting Figma to code, design-to-development workflows, multi-platform consistency DO NOT USE FOR: specific token authoring (use design-tokens), Figma workflows (use figma), component cataloging (use storybook), token transformation (use style-dictionary), cross-framework components (use mitosis)
tools
Use when implementing the x402 protocol for HTTP-native micropayments. Covers server middleware, client payment flows, facilitator integration, and stablecoin payments for APIs and AI agents. USE FOR: API micropayments, monetizing endpoints, stablecoin HTTP payments, automated agent payments for API access DO NOT USE FOR: full commerce flows with cart/checkout (use ap2), agent communication (use a2a), tool integration (use mcp)
tools
Use when implementing or integrating with the Model Context Protocol (MCP) for AI tool servers, resources, prompts, and context management. USE FOR: building MCP tool servers, exposing resources to agents, prompt templates, connecting agents to external APIs DO NOT USE FOR: agent-to-agent communication (use a2a), interactive UI rendering (use mcp-apps), agent payments (use x402 or ap2)
tools
Use when building MCP Apps that serve interactive UI from MCP servers. Covers the ui:// URI scheme, HTML rendering in sandboxed iframes, and bidirectional communication between UI and host. USE FOR: rich UI in agent conversations, interactive dashboards from MCP servers, sandboxed iframe rendering DO NOT USE FOR: basic tool responses without UI (use mcp), agent communication (use a2a), full web applications