Research agent demonstrating the Budget Authority Protocol — real x402 payments with cross-service budget enforcement.
Makes real USDC payments on Base mainnet to Exa (AI search), with budget tracking and hold/settle via agent-verifier.
- Creates a spending budget on agent-verifier (configurable via
BUDGET_CENTSenv var, default $1.00) - For each search query:
- Checks budget (hold placed before payment)
- Pays Exa via x402 ($0.007/search, USDC on Base)
- Settles hold after payment succeeds or releases on failure
- Stops gracefully when budget is exhausted
Agent wallet (USDC on Base)
│
├── Budget check ──→ agent-verifier (hold placed)
│
├── x402 payment ──→ Exa search API
│
└── Settle ────────→ agent-verifier (hold confirmed)
npm install
cp .env.example .env # fill in keys
npm run agentBUDGET_CENTS=100 npm run agent
─── Query 1: "x402 protocol agent payments 2026" ───
Budget check: approved (hold: ver_b4178512...)
Exa: 3 results, paid 7000 USDC units
Settled: hold confirmed
→ x402 - Payment Required | Internet-Native Payments Standard
Searches completed: 5
Budget denials: 0
Total x402 spent: 35000 USDC units ($0.0350)
BUDGET_CENTS=1 npm run agent
─── Query 1: "x402 protocol agent payments 2026" ───
Budget check: approved (hold: ver_f7e0896a...)
Exa: 3 results, paid 7000 USDC units
Settled: hold confirmed
─── Query 2: "cross-protocol budget enforcement AI agents" ───
DENIED: BUDGET_EXCEEDED
Budget exhausted — stopping gracefully.
Searches completed: 1
Budget denials: 1
Total x402 spent: 7000 USDC units ($0.0070)
Without agent-verifier, the agent would spend until the wallet is empty. With it, the agent stops at the budget limit.
Five protocols let AI agents spend money autonomously (AP2, ACP, x402, MPP, UCP). None of them track what the agent spent across services. An agent calling Exa + Firecrawl + Nansen via x402 can overspend because each service approves independently.
This agent demonstrates the fix: a budget enforcement layer (agent-verifier) that sits between the agent and the services, tracking total spend and enforcing limits.
- agent-verifier — budget enforcement library (npm)
- ap2-example — AP2 mandate verification
- acp-example — ACP checkout + Allowance
- x402-example — x402 pay-per-request
- mpp-example — MPP charge intent
- ucp-example — UCP checkout via MCP