Skip to main content

Overview

The Problem: When an AI agent clicks “buy,” how do we know the user actually authorized it? How do merchants trust the agent isn’t hallucinating? Who’s accountable if something goes wrong? The Solution: AP2 (Agent Payments Protocol) - An open protocol by Google Cloud that creates verifiable proof of user intent for agent commerce.

Why AP2 Matters

Traditional payments assume a human is clicking “buy.” When agents do it autonomously, three critical questions arise:
  • Authorization - Did the user actually give the agent permission?
  • Authenticity - Is this the user’s real intent, or an AI hallucination?
  • Accountability - If fraud occurs, who’s responsible?
Without a standard protocol, we get fragmented proprietary solutions—confusing for users, expensive for merchants, impossible for banks to manage.

How AP2 Works

Verifiable Digital Credentials (VDCs) - Cryptographically signed proof of intent:

1. Intent Mandate

“Human-Not-Present” Scenarios User gives agent authority with constraints:
"Buy a laptop under $1500 from Best Buy or Amazon"
Agent can shop autonomously within these bounds.

2. Cart Mandate

“Human-Present” Scenarios User explicitly approves the final cart:
MacBook Pro M3 - $1,299.99
AppleCare+ - $99.99
Total: $1,399.98 ✓ User signature
Non-repudiable proof of user intent.

3. Payment Mandate

Shared with payment network to signal AI agent involvement and assess transaction context.

The Stack

Build agents with: ADK, LangChain, CrewAI, Agno (any framework)
Equip with tools: MCP (Model Context Protocol)
Collaborate via: A2A (Agent-to-Agent Protocol)
Secure payments with: AP2 ← We’re here

Current Status in Bindu

Completed:
  • All 15 AP2 data types implemented
  • Intent, Cart, and Payment Mandate framework
  • Cryptographic signing and verification
  • A2A protocol integration
🚀 In Progress:
  • X402 integration (crypto payments on Base Sepolia)
  • Human-present and human-not-present flows
📋 Planned:
  • Stripe integration (traditional payments)
  • PayPal and other processors

Integration Plan

Phase 1: Core AP2 Implementation ✅

  • Implement all AP2 data types
  • Mandate creation and verification
  • Cryptographic signatures with DIDs

Phase 2: X402 Integration (Current)

from bindu.ap2 import AP2Agent

# AP2 with X402 crypto payments
agent = AP2Agent(
    did="did:agent:shopping-bot",
    payment_method="x402",
    network="base-sepolia",
    token="USDC"
)

# Create intent mandate
intent = await agent.create_intent_mandate(
    description="Buy API access for $10",
    max_amount={"currency": "USDC", "value": 10}
)

# Agent pays with X402
result = await agent.process_payment(intent)

Phase 3: Stripe Integration (Next)

  • Traditional card payments
  • Stripe payment processor integration
  • Fiat currency support (USD, EUR, etc.)

Phase 4: Human-Present & Not-Present Flows

  • User approval UI for human-present scenarios
  • Autonomous shopping for human-not-present
  • Dispute resolution and refunds

Phase 5: Production Features

  • PayPal and other processors
  • Multi-currency support
  • Real-time bank transfers (UPI, PIX)

Status

🚀 In Progress - Payment processor integrations and production flows

What’s Next