AI Agents and Coding Assistants
Why Spending Limits and Stop Buttons Matter for Autonomous Software
How budgets, rate caps, time limits and kill switches contain a misbehaving AI agent, and how to tell whether yours really work.
Key takeaways
- Caps on money, actions and time bound the damage from errors you did not foresee.
- The most dependable limits are enforced outside the agent, by the bank, platform or surrounding software.
- Alerts tell you something happened, while hard limits actually prevent it, and the two should be used together.
- A stop button must also halt queued jobs, helper agents and scheduled tasks.
- Untested controls should not be trusted, so try them before you need them.
Spending limits and stop buttons matter because software that acts on its own can repeat a mistake very fast. A person who orders the wrong supplies notices after one box arrives. A program stuck in a loop can order again and again, send hundreds of messages or run up usage charges while everyone sleeps.
A limit decides in advance how bad things can get. A stop button lets a person end the activity when something looks wrong. Neither requires you to predict what the error will be.
How costs and actions run away
An agent works in a loop: look, decide, act, check. If the check fails to register success, the agent may try again. If two automated systems respond to each other, they can bounce back and forth. A vague goal such as "keep improving the report" has no natural end.
Costs accumulate in more than one way. There is the money the agent spends on purchases or advertising. There is the fee for running the model itself, often billed by usage, which grows with long conversations and repeated attempts. And there is indirect cost, such as a flood of emails that damages your reputation or triggers a spam block.
Outsiders can drive the loop too. Someone who discovers that your public assistant will perform expensive work on request may ask for it thousands of times.
Kinds of limits
Money is only one thing worth capping.
A rate limit restricts how often something can happen. A step limit ends a task after a set number of actions, even if the goal is unmet. A scope limit names where the agent may go. Each catches problems the others miss. A thousand tiny purchases could pass a per-item cap and be stopped by a daily total or a rate limit.
A worked budget example
Say, hypothetically, that you let an agent reorder office supplies. You expect about 400 dollars of orders in a normal month, usually in four orders of roughly 100 dollars.
You could set these bounds:
Per order: 150 dollars (room above a typical 100 order)
Per day: 200 dollars (blocks repeated orders)
Per month: 600 dollars (400 expected plus a 200 margin)
Order count: 6 per month (4 expected plus 2 spare) Now imagine a bug that resubmits a 100 dollar order every minute. The first two orders total 200 dollars and reach the daily cap, so the third is refused. Without the daily cap, six orders totaling 600 dollars would go through before the monthly limit and order count both stopped it. With no limits at all, an hour of the bug would place 60 orders worth 6,000 dollars.
The right numbers depend on your own pattern. Set them close enough to normal use that unusual activity hits them, and expect to adjust.
Limits on usage fees
Running an agent can cost money even when it buys nothing. Many AI services charge by the amount of text processed. An agent that rereads a long history at every step, retries failed actions or searches widely can use far more than a single chat would.
Useful controls include a maximum number of steps per task, a maximum run length and a monthly budget on the account. Give separate projects separate keys, where the service allows it, so one runaway job does not drain everything and you can tell which job is responsible.
Protect those keys carefully. A leaked key lets someone else spend on your account. Keep keys out of shared documents and published code, and replace any key that may have been exposed. Estimating usage costs in advance gives you a sense of what normal looks like, which is what a sensible cap is built on.
What happens when a limit is hit
A limit should end in a safe state. If a task stops halfway through moving records, some may be in the old place and some in the new. Design multistep work so that it can be resumed or reversed, and have the system report what was completed.
Decide who is told and what they should do. Raising a cap should require a person with authority, who looks at why it was reached before changing it. An automatic increase turns the limit into a speed bump.
Think about people downstream too. If a customer-facing agent pauses, there should be a plain message and another way to get help. A stop that leaves requests vanishing silently creates its own kind of harm.
Alerts are not limits
Many services offer spending notices. They help, but a notice only informs you. It may arrive late, land in a folder you rarely check or come at night.
Find out which of your settings are hard stops and which are warnings. Some usage dashboards update with a delay, so charges can pass a threshold before anything reacts. Check the provider's current description. Where no hard cap exists, an outside control can stand in: a prepaid balance with automatic top-up switched off, or a card with its own low limit.
Enforce limits outside the agent
Telling an agent "spend no more than 100 dollars" is worthwhile guidance. It is not a guarantee. The model may add wrongly, forget in a long session or be talked around by content it reads, as happens in prompt injection.
Put the real barrier somewhere the agent cannot edit: the card issuer, the payment platform, the account settings or code that checks every request before it goes out. The agent should have no permission to raise its own limits or create new payment methods. That is part of giving it the least access it needs.
What a real stop button does
A button labeled "stop" may only halt the current reply. A trustworthy stop covers the whole arrangement.
- The current task ends and no new step begins.
- Queued messages, orders and jobs are held or canceled.
- Helper agents started by the main one are stopped too, an issue that grows in systems with several AI workers.
- Scheduled runs are disabled.
- Access tokens can be revoked if the software does not respond.
It should be quick to reach, usable by more than one person and independent of the agent's cooperation. A process-level shutdown or a revoked credential works even if the model "disagrees." Stopping also does not undo what already happened, so be ready to audit and reverse completed actions.
Automatic stops
People cannot watch everything. A circuit breaker is a rule that pauses the system when a warning sign appears. Useful triggers include:
- The same action attempted several times in a row.
- Errors from a tool above a set share.
- Spending or message volume far above the usual level.
- An attempt to reach a blocked address or payee.
- A task running much longer than expected.
When a breaker trips, the system should stop safely, say why and wait for a person. It should not restart itself. Expect occasional false alarms, and tune the thresholds from what you learn instead of switching the breaker off.
Give people permission to press it
A stop control only helps if someone is willing to use it. In a workplace, anyone who sees the agent doing something clearly wrong should be allowed to pause it without first seeking approval, and should not be blamed if it turns out to be a false alarm.
Agree on who may restart it. Pausing can be open to many people, while resuming should follow a look at what happened. That difference keeps stopping cheap and restarting deliberate.
Test the controls
Once a quarter, or after major changes, prove that the protections work. Set a tiny cap in a test setup and try to exceed it. Start a long task and press stop in the middle, then check what continued. Revoke a token and confirm that requests now fail.
Make sure someone knows the procedure when the usual owner is away. Write down where the controls are, who can use them and whom to call. Approval steps handle individual risky actions; limits and stops cover everything that slips between them.
Common questions
Won't limits interrupt legitimate work?
Occasionally. A refused order or paused task is usually a small cost compared with an unbounded error. If interruptions are frequent, review whether the limits fit current needs and raise them deliberately.
Are these needed for a personal assistant?
Yes, in proportion. A card with a low limit, confirmation before purchases and knowledge of how to disconnect the app cover most household cases.
Can an agent be trusted to monitor itself?
Self-checks can catch some mistakes, but a system that has misunderstood its goal may also misjudge its own behavior. Keep at least one control that works regardless of what the agent concludes.