Budget caps and kill switches for coding agents
In Ramp's 2026 test, a coding agent never mentioned its token budget. A budget cap for coding agents works outside the agent, with ceilings and kill switches.
An agent picks up a flaky checkout test at 6 p.m. on Friday. It reruns the suite, edits a retry, reruns it, and edits the retry back. Nobody reads the session until Monday, when the usage page shows a weekend of tokens spent on one test. A budget cap for coding agents is a spend ceiling that a process outside the agent checks before each model call, and refuses the call once the ceiling is spent. A kill switch is a stop a person flips that refuses the agent's next call at the scope it names, from one tool to the whole organization.
Both controls sit outside the agent, because an agent told its budget did not change how it spent in Ramp's 2026 test.
#Why coding agents ignore their own budgets
Ramp Labs tested this directly in April 2026. A coding agent worked SWE-bench Verified tasks with a 50,000-token budget, and a live counter in its prompt showed how much it had used. "In over 14,000 agent messages spanning multiple model families, the budget was never referenced." Ramp then gave the agent a tool to ask for more budget. "It was invoked 0 times in over 5,000 agent turns."1
Forcing the agent to decide at the limit did not help. When approval was the default choice, the agent approved more spend 97% of the time. With both choices worded neutrally, it still approved 79% of the time.1 Ramp's reading: the agent grades its own work, and stopping means giving up on the task it was told to finish.
Ramp then moved the decision to a separate controller model that judged each case from the task and its workspace. Advice in its prompt still swung it. A short note from "a colleague" that pointed the wrong way left every model at 52% accuracy or lower. Wrong advice scored from 6% (GPT-5.4 Mini) to 52% (Claude Opus 4.6), and right advice from 64% (Claude Opus 4.6) up to a perfect score for Claude Haiku 4.5.1
Spend controller accuracy with wrong advice and with right advice
| Wrong advice | Right advice | |
|---|---|---|
| GPT-5.4 Mini | 6% | 98% |
| GPT-5.4 | 20% | 84% |
| Claude Haiku 4.5 | 20% | 100% |
| Claude Sonnet 4.6 | 18% | 98% |
| Claude Opus 4.6 | 52% | 64% |
| Claude Opus 4.7 | 34% | 90% |
Ramp's conclusion fits in one line: "Spend control belongs outside the process doing the spending."1 Earlier research also found that agents track budgets poorly. Liu and colleagues found that raising a tool-call budget alone stops improving an agent's score, because the agent lacks what they call budget awareness. Their Budget Tracker plug-in gives the agent continuous budget awareness.2 Ramp's live counter, in a coding test, left spend, turns, and success rates flat. The two studies used different tasks, so read them as separate data points. The researchers who built SWE-agent set a hard limit of $4 per task, and when a run passed it, the harness submitted the edits made so far.3
#Coding agent spending limits outside the agent
OWASP lists this failure as unbounded consumption in its top risks for model applications. Its prevention list includes rate limits and quotas, and limits on "the number of queued actions and total actions."4 The FinOps Foundation names the agent case: a loop "can consume millions of tokens in minutes," and a looping agent can "exceed a monthly budget in a day." It also notes that "native rate limits are expressed in tokens per minute, not dollars per month."5
Claude Code offers a cap of its own. Its --max-budget-usd flag stops a run once estimated spend reaches a dollar amount, in print mode only. Anthropic's reference says the cap checks Claude Code's client-side estimate, which "can differ from your bill," and warns that spend can pass the cap.6 A cap like this is a useful backstop for one run on one machine. It does not cover the next run, a second agent, or a teammate's laptop.
Oxagen keeps the ceiling outside the agent. The control plane is the part of Oxagen that holds each agent's rules and checks governed calls against them. A governed call is one routed through Oxagen: a model call through its gateway, or a tool call through its hooks. A refusal comes from a spend check on Oxagen's side or from the local proxy on the agent's machine, so nothing in the prompt can argue with it.
#Budget caps at three scopes
Oxagen sets spend ceilings at three scopes, and a call must clear every one that applies.
- The organization. One ceiling across every workspace.
- The workspace. One ceiling for the agents in one workspace.
- The agent. A per-run budget and a per-day budget, in cents. An agent with no budget has no limit there.
An organization or workspace ceiling runs over a calendar month or a trailing window of days, and it can be turned off without being deleted. Admins get an in-app notice as spend crosses 50%, 80%, and 95% of an enforced ceiling, once per threshold per period. On a $500 ceiling, the notices come at $250, $400, and $475. Once spend reaches the ceiling, Oxagen refuses the next metered call before any model provider is paid.7
How spend moves toward an enforced ceiling
- Under halfCalls pass and spend adds up
- 50 percentAdmins get the first notice
- 80 percentAdmins get a second notice
- 95 percentThe last notice before refusal
- RefusedThe next call is refused before the provider is paid
| Stage | $500 ceiling after the stage |
|---|---|
| Under half | under $250 |
| 50 percent | $250 spent |
| 80 percent | $400 spent |
| 95 percent | $475 spent |
| Refused | $500 spent |
On a machine enrolled with Oxagen, the local model proxy enforces the same stops. A spent ceiling reaches the machine at its next poll, which comes every 30 seconds while a session is live. The proxy sits between Claude Code, Codex, or Stella and the model vendor. It refuses the next call with a reason the agent and the record both see: the session's budget, the agent's day budget, or the workspace's or the organization's ceiling. For the session and day budgets, a call in flight holds an upper bound on its cost against the limit until it settles, so parallel calls cannot all pass on the same total.
The Budgets tab of Oxagen's Guardrails page on a phone, with illustrative data. Cards show the organization past 80 percent of its ceiling, the workspace under its ceiling, and four agents with budgets of their own, one of them at its budget.
#How a person raises a ceiling
Ramp's agents approved their own extra spend 79% to 97% of the time, depending on how the choice was worded. So in Oxagen, only a person signed in to Oxagen can set or raise a ceiling or an agent's budget. Every API key is refused with person_required, including the key the oxagen CLI saves on the laptop.7 An agent on that laptop can read that key, so a key that could raise a ceiling would let the agent raise its own.
Two more details keep the ceiling from failing open or going unseen. If Oxagen cannot read the current spend, it decides with the last figure it read for up to 5 minutes. After that, it refuses the call instead of admitting spend it cannot check. And each model call the proxy refuses is a frame in the run's record, with its reason.
#Kill switch for AI coding agents
A ceiling stops spend at a number. A kill switch stops an agent now, whatever it has spent. In Oxagen, a person signed in as an organization Owner flips a switch against one of these targets:
- One version of one tool.
- Every tool from one tool server.
- A connection, which also revokes that connection's live credentials.
- One agent.
- One operator, the person accountable for a set of runs.
- A workspace.
- The whole organization.
- A class of tools, such as every tool that moves money.
The switch takes effect at the next call boundary, so the agent's next governed call is refused. On an enrolled machine, a switch reaches the host at the same poll as a spent ceiling. A switch on the organization, the workspace, the operator, or the agent then also refuses that agent's model calls and new prompts. Each flip records its reason and the person who flipped it.
The off switches on Oxagen's Guardrails page, with illustrative data. One class switch covers every tool that moves money. One scoped switch is denying: a person turned off the Stripe provider after a suspected compromise of its key, and the card says it takes effect at the next call boundary.
A switch has limits worth stating. It does not reach a capability someone calls with an API key against Oxagen's API, which IAM policy governs and revoking the key stops. It does not reach Oxagen's in-app assistant, which has its own switch.
#Stop a runaway coding agent before the invoice
Some runs need stopping before any ceiling is near. Oxagen offers two more stops for that.
Pause every live run. When a release breaks at night, oxagen run pause-all --reason "<text>" pauses every live wrapped run in the workspace as one recorded decision. Each run stops at its next stopping point once its host collects the command. A host with a live session checks for commands every 30 seconds. The command lists any run it skipped, such as one on a host that is offline.
The no-progress limit. A loop that repeats one call, such as rerunning the same failing test with no edit between, is a run of identical calls: the same tool, the same input, the same output. The no-progress limit counts identical calls in a row. Every workspace starts at 20 calls in observe mode, which records each run that reaches the limit and lets it go on. Enforced mode pauses the run before its next step.
The no-progress limit on Oxagen's Guardrails page, with illustrative data. The limit is enforced at 3 identical calls in a row, and four runs that repeated the same call are listed as paused, each with its agent and how many identical calls it made.
Finding the loop after the fact is the subject of reading a long agent run, where the Problems panel lists the most costly problems first.
#Where these controls stop
- Cursor's model calls. Cursor sends them to its own servers, so they never reach Oxagen's gateway and do not count toward a ceiling as they run. Once a ceiling is spent or a switch is on, Oxagen's hooks still refuse a Cursor session's new prompts and tool calls.
- Calls outside Oxagen. A model key used outside an enrolled machine or a sandbox run spends without passing a ceiling. Every control here applies to governed calls only.
- Calls already in flight. Oxagen checks a budget when it admits a call, so a call in flight finishes and a session can end one call past its limit.
- What the ceiling counts. A subscription login has no per-call price. For those runs, Oxagen counts the list price of the tokens toward an agent's budget, the one basis that compares across login kinds.
A ceiling says how much may be spent. It does not say who spent it. The per-person, per-agent, and per-task split is in Claude Code cost per developer and per team. How Oxagen pays for calls from a prepaid balance, and what happens when that balance runs out, is in a prepaid wallet for agent spend. To set ceilings, agent budgets, and stops on a sample workspace, open spend limits and stops for coding agents, and read the spend budgets reference for every field.
#References
-
Hariri, S. (2026). Coding agents ignore their own budgets. Ramp Labs Research, 21 April 2026. https://labs.ramp.com/research/coding-agents-ignore-spend/ ↩ ↩2 ↩3 ↩4
-
Liu, T., Wang, Z., Miao, J., Hsu, I., Yan, J., Chen, J., Han, R., Xu, F., Chen, Y., Jiang, K., Daruki, S., Liang, Y., Wang, W. Y., Pfister, T., & Lee, C. (2025). Budget-Aware Tool Use Enables Effective Agent Scaling. arXiv. https://arxiv.org/abs/2511.17006 ↩
-
Yang, J., Jimenez, C. E., Wettig, A., Lieret, K., Yao, S., Narasimhan, K., & Press, O. (2024). SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering. NeurIPS 2024. https://arxiv.org/abs/2405.15793 ↩
-
OWASP GenAI Security Project (2025). LLM10:2025 Unbounded Consumption. OWASP Top 10 for LLM Applications. https://genai.owasp.org/llmrisk/llm102025-unbounded-consumption/ ↩
-
FinOps Foundation (2026). Managing AI Token Costs from Direct Model Provider APIs. FinOps Foundation working group paper, last updated 28 October 2026. https://www.finops.org/wg/token-economics/ ↩
-
Anthropic (2026). CLI reference. Claude Code documentation. https://code.claude.com/docs/en/cli-reference ↩
-
Oxagen (2026). Spend budgets. Oxagen docs. https://docs.oxagen.sh/docs/cli/budget ↩ ↩2

