Spending limits for AI agents only work when the agent cannot change them. Set a hard monthly cap on each API key at your provider. Give each agent its own virtual card with a low limit. Require human approval above a dollar amount you pick. A limit written in the prompt is only a request.
An agent that can spend money will spend it. Sometimes on purpose, sometimes in a loop at 3 a.m. while you sleep.
I'm Scott Wilder, a former law enforcement officer. I learned to trust controls that do not depend on anyone behaving. A rule people can talk their way around is not a control. The same goes for AI agents. For a one-page checklist, see The Agent Leash.
What are spending limits for AI agents?
They are caps on how much an agent can spend before something stops it. There are two kinds of spending to cap.
Moss's guide to AI agent spending controls splits it the same way. Agents run up operating costs, which means tokens, API calls and compute. And if you hand them a payment method, they can buy things.
Both need a cap. Most people only think about the first one, and only after the bill arrives.
Why is a limit in the prompt not enough?
You can tell an agent "never spend more than $20." That is a request. The agent can misread it, forget it in a long task, or get talked out of it by text it reads on a web page.
A limit enforced by the billing system is different. The agent can ask for more. The system says no. Nothing in the prompt can change that answer.
A polite request is not a limit. A leash is. Leash the agent, not yourself.
How do I cap an agent's spending at the AI provider?
Start at the source of the cost, the API key.
OpenAI. OpenAI's spend limits can be set for the whole organization or for a single project. Turn on the hard limit and API responses fail with a 429 error once the monthly limit is reached. Alerts alone do not stop anything. They only send a notice. OpenAI also warns that enforcement is not instant, so recorded spend can run slightly over the limit.
Anthropic. The Claude API rate limits page lists monthly spend caps by tier. They are $500 on Start, $1,000 on Build and $200,000 on Scale. You can set your own lower limit on the Billing page in the Claude Console. You can also set limits per workspace, though not on the default workspace.
Through a gateway. If you use LiteLLM, the virtual keys docs show a max_budget setting per key. The LiteLLM budget docs add a budget_duration, so the budget resets daily or monthly. When a key crosses its budget, requests are rejected.
The plain-words version is one key per agent and one dollar cap per key. If an agent loops, it hits its own ceiling and stops. The other agents keep working.
How do I limit what an agent can buy?
Never give an agent your personal card.
Use virtual cards. Each agent gets its own card with a low limit. Privacy.com, Ramp and Brex style tools all work this way, though the features differ. I checked Privacy.com's guide, which says a card can carry a per-transaction, monthly, annual or lifetime limit. It describes single-use cards that close after the first purchase, and merchant-locked cards for subscriptions an agent uses regularly. Its advice is to expect a $5 charge, then set a limit close to $5. See Privacy.com on agents and virtual cards.
Pick the card by the job.
- One-off purchase: single-use card.
- Monthly tool the agent pays for: merchant-locked card with a monthly limit.
- Anything else: no card. Do the purchase yourself.
If a card is compromised or an agent misbehaves, you close one card. Your real account never knew.
What else should I lock down besides money?
Spending is not only cards and tokens. An agent with too much access can cost you in ways no budget catches. Three more cheap moves.
One login per agent. Do not share your own login. Separate accounts mean separate permissions, and you can switch one off without breaking the rest. It also tells you which agent did what.
Read-only database users. If an agent only needs to look at data, give it a user that can only read. It cannot delete or change a thing, whatever it is told.
Narrow permissions. Give each agent only the tools and files its job needs. Add more later if you must.
When should a human approve the spend?
Set a dollar line. Below it, the agent acts alone. Above it, the agent asks, and a person says yes or no.
Pick the number by asking how much you could lose without losing sleep. For some people that is $5. For others it is $50. Start low. Raise it only after the agent has earned it.
Moss lists approval workflows and a named human owner for each agent among its core controls. I agree with both. An agent with no owner is a bill with no one to read it. Put a name on every agent, and the name is yours until you hire someone.
I also treat anything an agent cannot undo as a human decision. Money out the door is the clearest example.
If you are building an exit from the 9 to 5 with agents doing the dull work, start with how to quit your 9 to 5.
How do I know when an agent is overspending?
Add a daily spend alert. Provider dashboards and gateways can email you when spend crosses a threshold. OpenAI's alerts do exactly this, without blocking requests.
Use the alert and the cap together. The cap stops the damage. The alert tells you something odd is going on before the cap does. Check it once a day, over coffee. Two minutes.
What is the minimum setup?
If you do nothing else, do these five things this week.
- Create one API key per agent.
- Set a hard monthly cap on each key or project.
- Give any agent that buys things a virtual card with a low limit.
- Set an approval line in dollars.
- Turn on a daily spend alert and write down who owns each agent.
An hour of setup. It turns "I hope it behaves" into "it cannot cost me more than this."
Want one hard truth like this every week? Sunday Night Truths is free. Sign up at scottwilderhq.com.
Written by Scott Wilder, who writes hard truths about work, money and AI agents.
