Letting AI agents pay, safely
How to give an agent a way to pay without giving it your keys: limits, approvals, MCP setup, and the protocols behind agentic commerce.
Each guide answers one question and says plainly which parts are general practice and which are specific to Veyra. Facts about protocols and providers link to their official docs. For the vocabulary, see the glossary.
Letting an agent pay
- How to let an AI agent make paymentsGive an agent a payment tool, not a key: limits enforced outside the model, a human for larger amounts, and a record of every decision.
- How to set spending limits for an AI agentPer-payment cap, daily cap, an auto-approve band and an ask band, enforced outside the model. How to choose each number and what happens at each edge.
- Human-in-the-loop approval for AI agent purchasesHow to make an agent wait for a person before larger payments: where the request goes, what the approver checks, and what happens if nobody answers.
- How to test AI agent payments without real moneyRun an agent's payment flow end to end on a simulated rail: what to test, how to tell simulated from real, and what a testnet does and doesn't prove.
Connecting a payment tool
- How to give Claude or ChatGPT a payment tool via MCPAdd a remote MCP payment server to Claude Desktop, Claude on the web or ChatGPT: which auth each host supports and what to check before it can spend.
- How to add a payment tool to Claude CodeAdd a remote MCP payment server to Claude Code with claude mcp add, choose a scope, and keep a coding agent from paying for things you didn't intend.
- How to add a payment tool to CursorAdd a remote MCP payment server to Cursor's mcp.json with a URL and Authorization header, keep the token out of the repo, and test it safely.
- How to give OpenAI Codex a payment tool via MCPConfigure a remote MCP payment server in Codex's config.toml with bearer_token_env_var, keep the token in your environment, and test the flow.
Staying in control
- How to restrict who an AI agent can payA recipient allowlist limits where an agent's money can go, which amount caps can't. How to build one, match addresses safely and handle new payees.
- How to stop an AI agent making duplicate paymentsAgents retry when unsure, and retries can pay twice. Idempotency keys, status checks and tool wording that keep one intended payment to one payment.
- Should you give an AI agent a crypto private key?Why a private key in an agent's prompt, config or environment is full control of the wallet, and what to do instead to let it pay without one.
- Can prompt injection make an AI agent spend money?Yes, if the agent has a payment tool and nothing outside the model checks it. How injected instructions reach a payment and which controls still hold.
- How to audit what an AI agent spentWhat an agent payment log should record, from requests and policy decisions to approvals, settlements and permission changes, and how to review it.
- How to revoke an AI agent's payment accessPause, rotate or revoke the agent's credential, and separately revoke any on-chain allowance. What each step stops and what it leaves in place.
- Is it safe to approve a token allowance for an AI agent?What an ERC-20 allowance does and doesn't limit when it powers an agent's unattended payments, and how to size and constrain one.
Concepts and protocols
- What is agentic commerce?Agentic commerce is AI agents finding, buying and paying on someone's behalf. The main approaches, the protocols behind them, and where control sits.
- What is the x402 protocol?x402 uses the HTTP 402 status code so a server can ask for payment and an agent can pay in the same request. How it works and what it needs.
- How can an AI agent pay for an API?Prepaid keys, pay-per-call protocols like x402 and MPP, or paying a provider directly from a controlled wallet. Trade-offs, and what to limit in each.
- Virtual cards for AI agents: how do they work?How issuing a virtual card to an agent works, which spending controls card issuers like Stripe Issuing offer, and where card limits fall short.
- ACP vs AP2 vs x402 vs MPP: agent payment protocols comparedWhat each agent payment protocol is for: checkout with merchants (ACP), verifiable user mandates (AP2), and pay-per-request machine payments (x402, MPP).
- Custodial vs non-custodial wallets for AI agentsWho holds the money and the keys when an AI agent pays: custodial balances, agent-held keys, and owner wallets with delegated limits compared.
Glossary
- MCP serverAn MCP server exposes tools, resources and prompts to AI applications over the Model Context Protocol. What that means for payment tools.
- Payment intentA payment intent is a record of a payment someone wants to make, tracked through states until it succeeds, fails or is cancelled.
- Idempotency keyAn idempotency key is a unique value sent with a request so that repeating it has the same effect as sending it once. Why agents need one.
- Token allowance (ERC-20 approve)An ERC-20 allowance lets a spender move up to a set amount of a token from your address. What it limits, what it doesn't, and how to revoke it.
- Auto-approve limitThe amount under which an agent's payment can go through without a person. How it sits with the ask limit, per-payment cap and daily cap.
- HTTP 402 Payment Required402 Payment Required is an HTTP status code reserved for future use since early HTTP, now given a concrete meaning by machine payment protocols.
- x402 facilitatorA facilitator verifies and settles x402 payments for a server, so the server doesn't need to run blockchain infrastructure itself.
- Stablecoin (USDC)A stablecoin is a token designed to keep a fixed value against a currency. Why agent payment tools use dollar stablecoins such as USDC.
- Shared Payment Token (SPT)A Shared Payment Token is Stripe's scoped grant that lets an agent use a customer's payment method, with usage and expiry limits, without raw card details.
Try it with Veyra
Veyra gives an AI agent one MCP endpoint with per-payment, daily, auto-approve and ask limits and an optional recipient allowlist, all enforced server-side. Start free on a simulated wallet that moves no money, then connect your own wallet for USDC on Base.
This page explains how agent payments and the related technology work. It is not financial, investment, legal or tax advice. Protocols and provider features change; check the linked official sources before relying on a detail.