Skip to content

The runaway invoice

Without a per-run ceiling, a single agent run can quietly rack up a large token and dollar bill, because nothing stops a loop that keeps calling expensive models and tools until it happens to finish.

incident

One misbehaving run spins on a large-context model overnight and lands a four-figure bill by morning.

where_are_you

The maturity ladder, worst to best

These are the rungs the Agent Reliability Scorecard scores for this dimension, straight from the tool. Find where your agent sits, then aim for the top rung.

  1. Nothing: a runaway run could quietly rack up a large bill

  2. Only the iteration cap limits it, indirectly

  3. A per-run token/cost ceiling that stops the run

  4. Per-run ceilings plus alerting and per-tenant rate limitstarget

the_fixCap the blast radius of a runSet per-run token and cost ceilings that stop the loop, add alerting, and rate-limit per tenant. A runaway agent should hit a wall long before it produces a surprise invoice.

why_it_matters

Every turn of an agent loop costs tokens, and every tool call may cost money of its own. Multiply that by a loop that doesn't know when to stop, or a task that fans out into many sub-calls, and a single run's cost can grow far past what the result is worth. The failure is silent: no error, no alert, just an invoice that arrives later. Iteration caps help indirectly, but a cheap-looking loop over a large-context model can still be expensive per turn.

Bound the cost directly. Set a per-run token and dollar ceiling that stops the run when it's crossed, not just an iteration count. Add alerting so a run trending toward the ceiling is visible before it's done, and rate-limit per tenant so one caller can't consume the budget for everyone. A runaway agent should hit a spending wall long before it produces a surprise on the bill.

no ceiling → overnight spinsilent until the invoice arrivesper-run token/cost cap, alerting, per-tenant limits

faq

Questions & answers

How do you control the cost of an AI agent?
Cap it directly. Set a per-run token and dollar ceiling that halts the loop when crossed, rather than relying on an iteration count alone. Add alerting for runs trending toward the ceiling and per-tenant rate limits so one caller can't drain the budget. The goal is that a runaway run hits a spending wall before it hits your invoice.
Why did my agent produce a huge token bill?
Usually a run that looped or fanned out with no cost ceiling. Iteration caps limit turns but not per-turn cost, so a loop over a large-context model can still be expensive. Add an explicit per-run cost ceiling and alerting, and the run stops on its own before the bill grows.

Fixing one failure mode is a day. Hardening the whole loop is the work.

I review where your agent loop terminates, how it escalates, how it fences tool output, idempotency on the side effects, and the evals that catch a regression before users do. Book a call, or leave your email.

Book a call

No spam. You'll get a reply from me.

Prefer proof first? See how this plays out in real case studies →