FitWhen to use it — and when not
Use it when
- Agents that loop, browse or call paid tools for an unknown number of steps
- Scheduled and background runs that nobody is watching
- Team workspaces where one person’s agent spends a shared budget
Skip it when
- Fixed-cost tasks with a known single model call
- Products that already bill per task at a quoted price: show the price instead
- Where a hard cutoff would leave data half-written and there is no safe stopping point
AnatomyThe parts of the pattern
- Limit setSpend, steps and time as separate caps, each with a sensible default and a visible value.
- Live metersUsed against each cap during the run, in the units people set them in.
- Soft warningA notice at about 80%, before anything stops.
- Hard stopThe agent pauses before the step that would exceed the cap. It never overshoots.
- Limit cardWhat is done, what is left, and the choices: raise the cap, finish with what exists, or stop.
- Scope levelsPer run, per day and per workspace, with the lowest one winning.
GuidelinesDo & don’t
Do
- Pause at the limit instead of killing the run, and keep the partial result.
- Show what the next increment buys: "Raising the cap by $2 covers about 8 more steps."
- Default new agents to a low cap and let people raise it.
- Count tool and sub-agent costs, not only model tokens.
Don’t
- Fail silently and leave a half-finished result with no explanation.
- Reset the run on a raised limit; resume from where it stopped.
- Use only a monthly workspace cap: one run can burn it overnight.
- Phrase the stop as an error. Hitting a limit you set is the feature working.
In the wildReal-world examples
Products named for reference only — no affiliation, and the demo above is an original illustration, not a copy of their UI.
For engineersImplementation notes
- Check the cap before each step with a projected cost for that step, not after it, so the stop is clean.
- Keep a per-run ledger of cost, steps and elapsed time as the source for the meters and the limit card.
- Make a stopped run resumable: persist state and the remaining plan, so raising a cap continues instead of restarting.
- Enforce caps on the server. A client-side limit is a suggestion.
Q&ACommon questions
What should an AI agent do when it hits a budget limit?
Pause before the step that would exceed the cap, keep the partial result, and ask. Offer to raise the limit and resume, wrap up with what it has, or stop. Failing silently or restarting loses work and trust.
Which limits should an agent have?
Spend, number of steps and elapsed time, each separate, because different failures hit different ones. A loop trips steps, a slow tool trips time and an expensive model trips spend. Add per-run, per-day and per-workspace levels, with the lowest winning.
Should budget limits be enforced in the UI or on the server?
On the server. The client shows the meters and the limit card, but a cap that only the browser checks can be bypassed by a scheduled run or an API call.