Agent budget gates must reserve units before the paid tool call runs
Agent runtimes should refuse unit 501 of a 500-unit budget before the call runs, a dev.to post argues. The new AWS and Google Cloud spend caps then become the backstop behind a tighter limit in the agent's own call path.
The Engineer · Build desk

What happened
- Simon Willison wrote on October 3 that usage-priced services need hard caps that cut off and return errors by default, with removing the cap an explicit opt-in.
- AWS announced on 16 September that when a project's usage reaches its monthly spend limit, the project is paused for that month.
- Google Cloud's Spend Caps preview can pause eligible service usage once a configured cap is enforced, while the project's resources stay intact.
- The dev.to post's sample checks each reservation against a budget object and raises an error before the tool runs if the limit would be exceeded.
Why it matters
- What it costs cost An AWS project that hits its limit stays paused for the rest of the month, so one looping agent halts every other workload that shares the project.
- Who's exposed exposure Existing AWS accounts outside the limited rollout have no AWS hard cap yet, so for them the application's own counter is the only hard stop.
- What it sets up precedent If coding agents start steering builders toward providers with hard caps, as Willison hopes, cap support becomes a selection criterion for agent-built deployments.
Next story · Invest · yesterday
Anthropic spends about $10,000 a head on forward-deployed engineers while AWS and OpenAI spend billionsConfirmed2 publishers
The failure the post describes looks like ordinary work. Each action an agent takes can be permitted while the run as a whole becomes economically unsafe [1]. In the post's example, one bad decision becomes twenty valid paid actions, and a second recovery rule turns those twenty into a hundred [2]. That is 100 paid actions from one choice, and the second rule alone multiplies the count by five [17].
An alert watches that loop and lets it keep going. The post writes the difference as two pipelines. A soft budget runs observe, alert, keep running. A hard budget runs observe, compare, deny the next action [3]. Willison put the buyer's side plainly. "I expect that most businesses and individuals would prefer errors to a surprise $10,000+ bill," he wrote [8].
Provider caps are the coarse layer. Google's Spend Caps launched in July and set a monthly cap on specific services within a project [11]. According to the post, Google warns that enforcement is not instantaneous because it works from estimated costs [6]. The post does not say how long that delay runs. Whatever an agent spends between the estimate and the pause is already on the bill. For that reason the post wants a tighter limit held by the application itself [6].
In the sample code, the gate is one comparison inside `reserve()`: `if self.used + units > self.limit: raise RuntimeError("hard budget exceeded")` [13]. Only after that line passes does `call_metered_tool` invoke the tool [13]. According to the post, a check placed after the call is only telemetry, a retry path that skips the wrapper is not a hard cap, and a child agent given a fresh counter can escape the limit by spawning [14].
The post calls the sample intentionally small [13], and two gaps follow from that. It reserves `estimated_units` and never settles the reservation against what the call actually cost. A call that runs over its estimate therefore pushes real usage past the limit [18]. The application inherits Google's estimation problem. The check-then-increment also runs without a lock, so two concurrent child agents sharing one `Budget` could both pass the comparison before either one increments [21]. In my view both gaps are cheap to close: an atomic counter, and a settle step after each call that charges the actual cost.
Money is one dimension of several. The post's example run budget allows 80 tool calls, 12 browser writes, 500 external API units, 1,200 seconds of wall clock and three child agents [15]. The wall-clock ceiling is 20 minutes [20]. A provider cap counts dollars per service [11]. A browser write or a spawned child exists only inside the runtime. I think the post has the layering right for any agent that can create its own work. It places the budget object at the same architectural level as authentication, authorization and cancellation [12].
What to watch
- Whether AWS moves its project spend limit from a limited rollout to general availability for existing accounts.
- Whether Google publishes how far Spend Caps enforcement can trail actual spend as the feature leaves preview.
- Whether agent frameworks ship a parent-scoped budget object on the tool-call path as a default.
Clarity's read
What the record supports and how the coverage leans. The claims behind it follow.
Reality
- Evidence55
- Adoption20
- Hype gap+15
- Incentives
- Not scored
- Confidence60
Claim ledger
Ranked by verification strength, evidence, and original report placement.
- [1]
An AI agent can fail without crashing by continuing to do valid work for too long; every individual action may be permitted while the overall run becomes economically unsafe.
- [2]
One bad decision can become twenty valid paid actions; a second recovery rule can turn those twenty into a hundred.
- [3]
Soft budget: observe -> alert -> keep running. Hard budget: observe -> compare -> deny next action. The hard model belongs on the execution path.
- [4]
If a run is allowed to consume at most 500 units of a metered resource, unit 501 should fail closed.
- [5]
Google Cloud's Spend Caps preview documentation says eligible service usage can be paused when the configured cap is enforced, while resources remain intact.
- [6]
Google warns that Spend Caps enforcement is not instantaneous because estimated costs are involved; the post says an application should still maintain its own tighter limits.
- [7]
Simon Willison wrote on 3 October 2026 that pay-by-usage services need default hard budget caps that cut the service off and return errors, that soft caps sending a warning email will not cut it, and that removing the cap should be opt-in.
- [8]
"I expect that most businesses and individuals would prefer errors to a surprise $10,000+ bill."
- [9]
AWS announced on 16 September that if a project's usage reaches its monthly spend limit, the project is paused for that month.
- [10]
AWS's spend limit settings page warns: "We're currently releasing our new experience to a limited number of customers."
- [11]
Google Cloud launched Spend Caps in July, which lets users set a monthly financial cap on specific services within a project.
- [12]
The budget object belongs at the same architectural level as authentication, authorization, and cancellation.
- [13]
The post's intentionally small sample defines a Budget dataclass with limit and used; reserve(units) raises ValueError if units <= 0 and RuntimeError("hard budget exceeded") if self.used + units > self.limit, then increments used; call_metered_tool calls budget.reserve(estimated_units) before calling the tool.
- [14]
If the budget check happens after the tool call it is only telemetry; if a retry path can bypass the wrapper it is not a hard cap; if a child agent receives a fresh counter instead of sharing the parent budget, spawning becomes a way to escape the limit.
- [15]
Example run budget: max_tool_calls 80, max_browser_writes 12, max_external_api_units 500, max_wall_clock_seconds 1200, max_child_agents 3.
- [16]
Willison wrote that it would be great if agents started biasing towards recommending providers with hard budget caps and warning inexperienced builders against uncapped services.
- [17]
One decision fans out to 100 paid actions, and the second recovery rule multiplies the count by five.
- [18]
The sample reserves estimated_units and has no step that settles the reservation against actual cost, so a call that costs more than its estimate pushes real usage past the limit.
- [19]
An AWS project that reaches its spend limit stays paused for the rest of that month, so every workload in the project stops, including ones unrelated to a runaway agent.
- [20]
The example wall-clock ceiling of 1,200 seconds is 20 minutes.
- [21]
reserve() compares and then increments used with no lock, so two concurrent callers sharing one Budget could both pass the check before either increments.
Sources
2 independent publishers whose own reporting we read for this story.
- dev.toHard Budget Caps Are a Runtime Safety Primitive for AI Agents
2 articles · October 4, 2026
- simonwillison.netWe're going to need default hard budget caps on pretty much everything
1 article · October 3, 2026
Topics and entities
Topics
- AI agent cost controls
- Cloud spend caps
Entities
- Amazon Web Services
- Google Cloud Spend Caps
- Google Cloud
- Simon Willison