OWASP LLM06:2026 Unbounded Consumption: caps and circuit breakers for agents
Denial of wallet, tool-call loops and fan-out. Where token limits, agent circuit breakers and spending caps that stop work belong, with code for each.
· 8 min read
LLM06:2026 Unbounded Consumption is the sixth entry in the OWASP Top 10 for LLM Applications 2026. OWASP defines it as an application that “allows excessive and uncontrolled inferences”, so that attackers can take the service down, run up “unsustainable financial costs” or copy the model. In 2025 it was LLM10; practitioners now rank cost and resource exhaustion four places higher.
In the 2025 list, LLM06 was Excessive Agency, which is now LLM03:2026. If that is what you need, read our Excessive Agency article.
Cheap to start, expensive to run
The entry’s central idea is cost asymmetry: an attacker “can trigger disproportionately expensive computation at negligible cost to themselves”. A short prompt can send a reasoning model into a long thinking loop. One image becomes thousands of tokens. And agents add a multiplier of their own, which is where most of the 2026 additions are:
- Tool-call loops
- A malicious or broken tool tells the agent to repeat a task, or to call itself, and each round costs another inference.
- Fan-out
- One request becomes hundreds of tool calls, and the model has to read every result.
- Growing context
- A long session re-reads everything on every turn. OWASP's example climbs from about $0.001 on the first turn to about $0.50 by turn 100, while each request stays under every rate limit.
- Denial of wallet
- Plain volume against a pay-per-use API, often with stolen keys.
OWASP’s conclusion is blunt: “Traditional request-rate limiting alone is no longer sufficient.” It asks for token-aware cost controls, hard spending caps, agent-level circuit breakers and monitoring of who spent what.
Three places to put the limits
The mitigations fall into three layers, and no single product covers all of them. It helps to know which layer each limit belongs in:
- The model gateway
- Tokens per minute and per day for each key and user, a pre-flight estimate that refuses oversized requests, and caps on output and thinking tokens. This is your provider's console or an LLM gateway.
- The agent loop
- Step, time and per-run cost limits, and loop detection. This is your own code, because only it sees every turn.
- The actions that cost money
- Cloud resources, paid APIs, purchases and ads. Caps per action and per day that stop work, and a person above them. This is where an approval service fits.
A circuit breaker in the agent loop
Mitigation 9 is specific: “Enforce step limits, recursion depth limits, time limits, and per-run cost ceilings on all agent executions. Use state hashing to detect recursive loops.” All of it fits in the loop that calls the model:
// Limits checked on every turn, in code the model cannot talk to.
const LIMITS = { turns: 40, sameCall: 3, seconds: 300, costEur: 2 };
async function runAgent(task: Task) {
const started = Date.now();
const seen = new Map<string, number>();
let cost = 0;
for (let turn = 1; ; turn++) {
if (turn > LIMITS.turns) throw new CircuitOpen("turn limit");
const left = LIMITS.seconds * 1000 - (Date.now() - started);
if (left <= 0) throw new CircuitOpen("time limit");
// The deadline also cuts off a model call or tool that hangs.
const signal = AbortSignal.timeout(left);
const reply = await model.next(task.messages, { maxOutputTokens: 4000, signal });
cost += priceOf(reply.usage); // input, output and thinking tokens at your prices
if (cost > LIMITS.costEur) throw new CircuitOpen(`run cost €${cost.toFixed(2)}`);
if (!reply.toolCall) return reply.text;
// State hashing: the same call with the same arguments again is a loop.
const key = hashOf(reply.toolCall.name, reply.toolCall.args);
const repeats = (seen.get(key) ?? 0) + 1;
seen.set(key, repeats);
if (repeats > LIMITS.sameCall) throw new CircuitOpen(`${reply.toolCall.name} repeated`);
task.messages.push(await runTool(reply.toolCall, { signal }));
}
}The limits throw rather than warn. A run that trips one stops, and a person looks at it before it is started again. Pick the numbers from what normal runs use, with room to spare, and log every trip: a breaker that fires every day is a limit set too low or a tool that misbehaves.
Spending caps that stop work, not alerts
Mitigation 2 asks for “non-overridable budget ceilings” that halt work when exceeded, “rather than alerting thresholds that fast-accumulating workloads can outpace.” An alert at 80% of a budget arrives after an agent loop has already spent the other 20%.
For actions that spend money outside the model, the agent asks before each one, with the amount your own code calculated:
// Your code prices the job before it starts. The model's estimate is not the amount.
const estimate = priceOfLookups(contacts.length); // 5,000 lookups at €0.004 = "20.00"
await approvals.guard(
{
action: "data.enrich",
summary: `Look up ${contacts.length} contacts in the enrichment API for €${estimate}`,
amount: estimate,
currency: "EUR",
details: { contacts: String(contacts.length), run: run.id },
},
// The provider-side cap is the approved amount, so a bug cannot spend more.
() => enrichment.start(contacts, { maxSpendEur: estimate })
);Two rules then answer for a person:
# Jobs up to €10 run on their own, up to €50 a day in total.
# Past the daily total, a person decides.
{ "action": "data.enrich", "effect": "allow",
"limit_amount": "10.00", "limit_currency": "EUR",
"budget_amount": "50.00", "budget_currency": "EUR", "budget_period": "day" }
# Above €10, or with no amount, a person decides.
{ "action": "data.enrich", "effect": "ask",
"limit_amount": "10.00", "limit_currency": "EUR" }- The budget is a hard stop. The allow rule only approves what is left of the day’s €50. A job that would go past it waits for a person, and no broader allow rule can approve it instead. Requests that arrive at the same moment are counted one after the other, so a burst cannot race past it.
- A missing amount never gets through. The allow rule only applies to an amount in euros it can compare. The ask rule catches everything above €10 and any request without an amount.
- Each agent key is rate limited. One key may make 600 calls a minute to the approvals API; a storm beyond that is refused.
Where the limit should sit depends on how often the agent is wrong and what a person’s time costs. The approval limit calculator prices every limit for a month and writes these rules for the one it suggests. Budgets per day, week and month are explained in spending limits for AI agents.
One switch for every agent
When the bill climbs and nobody knows why yet, the first move is to stop everything. A pause makes every answer read allowed: false, including approvals given earlier, until an owner resumes. Any member can pull it:
# The bill is climbing and you do not know why yet: stop every agent (any member).
curl -X PUT https://api.variantgate.com/v1/workspaces/WORKSPACE_ID/pause \
-H "authorization: Bearer $SIGNED_IN_TOKEN"A pause only reaches actions that ask before they run. Model calls between those actions go on until the agent next asks, so the breaker in the loop is still needed. The details are in emergency stop.
What an approval service does not cover
Most of LLM06 sits in front of the model, and an approval service never sees a token. Keep these where they belong:
- Token limits and input size. Tokens per minute and per day, pre-flight estimates and output caps live in your gateway or provider.
- Model extraction. Rate limits per user, no log-probabilities in public responses, and watching for systematic querying.
- The serving stack. Keep inference servers updated, authenticate every endpoint and turn off unsafe deserialization.
- Monitoring. Cost per agent, per user and per run, so a breaker’s numbers come from data.
The rest of the 2026 list, with where an approval helps and where it does not, is in our overview of the OWASP Top 10 for LLM Applications 2026. For the same problem across many agents at once, see ASI08 Cascading Failures.