How do I cap how much my AI agent can spend?
Last reviewed: August 2026
Enforce the cap outside the model, where the agent cannot talk its way past it. Limit what the agent can reach (a funded balance or a prepaid card loaded with a fixed amount), then add a per-payment limit the agent can read but not change. With Laso that is the account spend limit, set by the human owner from $1 to $50,000, plus a maxAmountUsdc price cap on every payment.
Why a prompt is not a cap
Telling an agent “spend at most $50” in its instructions is a request, not a control. A confused or manipulated agent can ignore it. A real cap has three properties: it is checked before money moves, it lives outside the agent’s code and context, and the agent cannot raise it. The layers below each give you one or more of those.
Layer 1: limit what the agent can reach
The strongest cap is the money that is available at all. Fund a managed agent wallet with only what the agent needs for the job. A payment larger than the balance is caught before signing and comes back as an inner 402 with errorReason: "insufficient_funds", and nothing is charged.
For purchases at a merchant checkout, load a prepaid card with exactly the checkout total. Laso cards are non-reloadable and hold the amount ordered, from $5 to $1,000, so the merchant cannot charge beyond it. The card is the budget.
curl "https://laso.finance/get-card?amount=50" \
-H "Authorization: Bearer $LASO_ID_TOKEN"
# Returns a pending card_id. Poll /get-card-data?card_id=... until
# status is "ready"; available_balance is the most it can ever spend.
Layer 2: a per-payment limit the agent cannot raise
The human who owns the account sets a maximum for any single payment in the Laso dashboard under Spend limit. It defaults to $1,000 and ranges from $1 to $50,000. It applies to every payment agentX402Pay makes, whether to a Laso route or an external URL, and to an agentWalletTransfer send to Base. A payment above it is refused before anything is signed.
The agent can read the limit with getAgentSpendLimit but cannot change it. setAgentSpendLimit refuses agent sessions, so only the human can move it.
curl https://laso.finance/getAgentSpendLimit \
-H "Authorization: Bearer $LASO_ID_TOKEN" \
-H "Content-Type: application/json" \
-d '{"data":{"userId":"usr_..."}}'
# { "result": { "maxPerPaymentUsdc": 1000, "min": 1, "max": 50000, "default": 1000 } }
Compare the fee-inclusive total of a payment against maxPerPaymentUsdc, since fees are added on top of the amount requested. If a payment is refused for exceeding the limit, the agent should stop and tell its human, not split the payment into smaller ones.
Layer 3: a price cap on every call
When the agent pays an external x402 endpoint, that endpoint writes its own price and receiver. Pin what you agreed to pay with maxAmountUsdc, and add expectedAsset, expectedNetwork, and expectedPayTo to refuse any challenge that substitutes a different token, chain, or receiver.
curl https://laso.finance/agentX402Pay \
-H "Authorization: Bearer $LASO_ID_TOKEN" \
-H "Content-Type: application/json" \
-d '{"data":{
"userId":"usr_...",
"url":"https://api.example.com/v1/paid-endpoint",
"note":"Market data for the portfolio summary you asked for",
"maxAmountUsdc":0.01
}}'
# { "result": { "status": 200, "body": { ... }, "txHash": "..." } }
maxAmountUsdc can only tighten the account spend limit, never raise it. A challenge that quotes a higher price is refused and nothing is signed. For Laso routes, pin the fee-inclusive total, because a cap computed from the pre-fee amount lands a cent or two short and refuses your own payment.
Layer 4: visibility
Every external payment appears in the agent’s activity list on the dashboard with the one-sentence note the agent supplied, settled or failed. A refused payment is recorded as policy_filtered or insufficient_funds. This does not stop spending, but it lets the owner see what the agent tried.
What these caps do not do
- There is no per-day or per-user velocity limit yet. The spend limit and
maxAmountUsdcbound each payment, not a sequence, so keep the wallet balance small to bound the total. - A cap protects against overspending, not against a bad purchase. A prepaid card can still be spent on the wrong thing up to its balance.
- If you need spending policies on a wallet you control yourself, hosted agent wallet products from other providers offer their own limit and allowlist features. Check their current docs; the tradeoff is who holds the key and who can change the policy.
Full reference: spend limit and activity log, guardrails for external endpoints, and paying from the managed wallet.
Frequently asked questions
How do I set a spending limit on an AI agent?
The account owner sets a per-payment limit in the Laso dashboard under Spend limit, between $1 and $50,000. It applies to every payment the agent makes and the agent cannot change it.
Can my AI agent raise its own spend limit?
No. The agent can read the limit with getAgentSpendLimit, but setAgentSpendLimit refuses agent sessions, so only the human owner can change it.
How do I limit what an AI agent can pay for one API call?
Pass maxAmountUsdc to agentX402Pay. A challenge that quotes more than the cap is refused before anything is signed.
How do I give an agent a card that cannot overspend?
Order a prepaid card loaded with exactly the amount to spend. Laso cards are non-reloadable and hold the amount ordered, so charges cannot exceed it.
What happens when my agent tries to pay more than the limit?
The payment is refused before signing and no funds leave the wallet. The agent should stop and tell its human the amount attempted and the limit it hit.
More guides
- How to give your AI agent a credit card — An AI agent cannot pass credit underwriting, but it can issue itself a virtual prepaid card over an API in about a minute. The working pattern, with real requests: x402 payment in, card number out.
- x402 vs AP2 vs ACP vs MPP vs UCP: which should your agent use? — All five agent payment protocols compared honestly: x402 and MPP for machine-to-machine HTTP payments, ACP for ChatGPT checkout, UCP for Google surfaces, AP2 for authorization. Which layer each one is, when to use each, and a worked x402 example.
- x402 vs Stripe Issuing for AI agents — Two real ways to put a card in an AI agent’s hands: Stripe Issuing behind a business account, or x402 card issuance the agent drives itself. An honest comparison of onboarding, funding, controls, and when each wins.
- Issue a virtual card with one x402 call — A complete, runnable walkthrough: pay one x402 request in USDC and receive a virtual prepaid card with number, expiry, and CVV. Real endpoints, real response shapes, error handling included.
- How can an AI agent pay for an API call with USDC? — An AI agent pays for an API call with USDC by answering the API’s HTTP 402 challenge with a signed payment. Two ways to do it: your own wallet with an x402 client, or a managed wallet with a price cap and no private key.
- How do I give an AI agent a bank account? — Two real ways to give an AI agent bank details: a business checking account it can operate (Meow) or a U.S. bank account that converts incoming dollars to USDC in the agent’s wallet (Laso). What each one is, who approves what, and when to pick which.
- All agent guides, or how Laso compares to the alternatives
Try it: connect a wallet at laso.finance and you'll have a card, gift card, or payout in minutes.
Building an agent? Point it at laso.finance/SKILL.md — it can set itself up.