Prerequisites
- An Agent Vault account at app.agentvault.io, and a card saved in the dashboard for any agent that will pay. Plans set a monthly payment quota and an agent-card allowance; see Billing and plans.
- For the hosted MCP server: an MCP client that supports streamable HTTP and OAuth sign-in.
- For the self-run MCP server, the SDK and the HTTP API: an API key from the dashboard. The SDK runs server side on Bun or Node 20 or later.
How it works
- The account holder adds cards, logins and addresses to the vault in the dashboard.
- Your agent receives mock tokens such as
av_card_1_number_u7x2k. A token typed anywhere outside Agent Vault’s browser is a plain string and does nothing. - The agent drives a browser that runs inside Agent Vault’s proxy and fills fields with tokens.
- At each fill, the proxy checks the account holder’s rules, swaps the token for the real value and types it into the merchant page. A login fills only on the site it was saved for.
Pay x402 services from the agent wallet
Agent Vault creates an onchain wallet for the account holder and pays x402 services sold on Buy from it for the agent. Only services sold on Buy are supported. Agent Vault holds the wallet’s key for the account holder, and only the account holder can withdraw. The agent can spend from the wallet but never gets the key or signs a payment.- Network and tokens: payments run on Celo mainnet in USDC, USD₮ or USA₮, with real funds. The Wallet page lists the tokens the wallet accepts.
- Fees: the wallet needs no CELO. A payment costs the wallet no network fee: it signs the payment and the facilitator submits it. A withdrawal’s network fee is paid in the token withdrawn.
- How the agent pays: the agent calls the MCP tool
pay_requestwith the wallet’s handle (av_wallet_<userId>, listed underwalletsin the token catalog) as itscard. The SDK’spayRequestandPOST /v1/wallet/payon the proxy make the same call. Agent Vault makes the paid request, so the agent never holds the key or a signed payment. Every agent card linked to the wallet applies its limits, merchant list and approvals. See Wallet payments. - What it pays for: only API calls sold on Buy, a pay-per-call API marketplace. It does not pay other x402 endpoints. To pay any x402 API from your own code, see buy.
- Limits: the account holder’s agent card sets the spending limits, and a payment can wait for approval first, depending on the seller and the card’s approval amount. A wallet that no agent card governs has no spending cap: once the account holder approves a seller, it pays that seller any amount. If the account already has an agent card, the wallet starts that way, so give an agent card access to it before funding it.
- Final payments: a payment on Buy cannot be reversed from the Wallet page.
Choose an integration
If you are unsure, start with the hosted MCP server. Agent Vault documents setup for Meta Muse, Grok Bot, OpenClaw, Claude Code, Hermes, Claude Desktop, Antigravity and Codex in Connect your agent.
Connect through MCP
The hosted MCP server is athttps://mcp.agentvault.io/mcp. You sign in with your Agent Vault account; there is no API key to copy.
- Claude Code
- Codex
- Other clients
/mcp in Claude Code, choose agent-vault and sign in.Install the SDK
@agentvault/playwright replaces Playwright’s chromium: every browser action runs in the proxy, and token fills resolve there. The package is not on npm. Install it from the URL Agent Vault hosts, then set all three variables.
MCP tools and HTTP endpoints
The MCP server’s tools, plusget_pending_result on the hosted server, are grouped in the order a run uses them:
The HTTP API covers everything except driving the browser, which uses the proxy’s WebSocket protocol through the SDK or the MCP server:
Rules your agent must follow
Agent Vault publishes nine rules as a page and as an installable skill, so you can load them on their own or paste them into a system prompt:- Never ask for or type a real card number, CVV or password.
- Never generate a password or an email address. Call
create_loginand the vault mints the password. - Never read back a filled value.
page.evaluateis disabled for agent sessions. - Match the token to the page. Credentials are locked to the site they belong to.
- Hand challenges such as 3-D Secure, one-time codes and CAPTCHAs to the account owner.
- Fill the card in the right order.
- Submit once.
- Read the run report before telling anyone money moved.
- Contribute what you learned to the recipe registry.
Limits and timeouts
Set spending limits for an agent
The account holder gives each agent an agent card: a set of rules on one of their saved cards. The rules are checked on every fill.Receive events with webhooks
Webhooks are set per agent card and are available on Plus and Enterprise. Each delivery is a signed JSONPOST to your HTTPS endpoint. Verify the X-AgentPay-Signature header with the card’s signing secret, which starts with whsec_. Failed deliveries are retried up to five times in total, and queuing an event is best effort, so treat webhooks as alerts, not a ledger. The events are card_fill, denied_fill, limit_threshold, auto_pause and approval_required.
Troubleshooting
Branch on the errorcode, not the message. The SDK throws SelfAgentPayError with a stable code, and the MCP server returns a tool error with the same message. The error codes page says which codes are safe to retry.
What Agent Vault does not do
- It does not hide the card from the merchant, and card payments are ordinary card payments.
- It does not solve CAPTCHAs, 3-D Secure checks or one-time codes. It hands the live page to the account holder to complete.
- It does not give the agent an onchain identity. For agent identity on Celo, see ERC-8004 and Self Agent ID.
- Agent Vault holds the wallet key for the account holder, and only the account holder can withdraw. You trust Agent Vault to apply the limits. For wallets where the owner keeps the key, see Altana.
- Limits bound what an agent can spend, not what it can buy. A compromised agent can still make purchases that the limits and merchant rules allow. For what is and is not protected, read Agent Vault’s security model.
Resources
Related
- Build with AI on Celo — where card and login flows sit next to onchain agent payments
- Altana — an agent wallet where the owner keeps the key and session limits are enforced onchain
- x402: Agent Payments — pay per HTTP request with stablecoins on Celo
- MPP: Machine Payments Protocol — charge USDC per API request
- Model Context Protocol (MCP) — how MCP servers connect to your agent
- Self Agent ID — proof-of-human identity for an agent on Celo