Alerts vs. hard stops: what actually stops runaway AI spend

“Alert me when spend crosses $X” and “stop the request before it happens” sound like two strengths of the same control. They aren't. One is monitoring. The other is enforcement. A dashboard that emails you an hour after a threshold trips is a smoke detector — useful, but it only tells you the house is on fire. It doesn't call the fire department. A gate that refuses the next request before it reaches a provider is the thing that actually does that, and it has to sit in a structurally different place: in front of the call, not reading a log after it.

Almost every provider spend dashboard is built on billing data, which is inherently after-the-fact. A real hard stop needs to sit at the request layer itself — a different piece of infrastructure than a spend dashboard, and the reason most tools only ship the alert half.

What's changed on the provider side — and what hasn't

Between April and July 2026, Google, OpenAI, and Anthropic each shipped some version of a hard cap of their own — real progress, and worth stating plainly rather than pretending it didn't happen. Google's Gemini API cap is mandatory and account-wide (roughly $250/mo, $2,000/mo, or $20K–100K+/mo depending on tier). OpenAI restored optional hard limits at the org/project level in July, after having removed the feature earlier the same year. Anthropic added a workspace-level hard cap.

All three are coarse in the same three ways. They're whole-account or whole-workspace, not scoped to a feature, team, or individual key — hit the ceiling and every legitimate workload sharing it stops with it, no graceful degrade. They're single-provider, so a Gemini cap does nothing for parallel OpenAI or Anthropic spend. And by the providers' own documentation, 10 to 20 percent of spend can still land in the window before enforcement actually catches up — billing is asynchronous, so the cap check itself runs a step behind the call it's supposed to stop.

Reserve before you spend, not after the call completes

The pattern most homegrown spend guards skip: checking the budget after a call completes just moves the visibility problem a few seconds earlier — it doesn't prevent anything, because the money is already spent by the time the check runs. A real hard stop reserves the estimated cost atomically before forwarding the call, and only lets it through if the reservation fits inside what's left. Fifty concurrent requests against a $0.10 budget should result in exactly the number that budget can afford succeeding — every time, not roughly.

The detail that's easy to skip alongside it: without a stable identity for the request, a retry storm doesn't just repeat the cost — it can double-count against the reservation itself, since each retry looks like a brand-new call to reserve against. An idempotency key ties the accounting to the logical request, not the attempt, so a client-side retry replays the original result instead of reserving and billing a second time. See idempotency keys for how this works in the proxy.

Dollars are the wrong unit for a loop that hasn't spent money yet

By the time a runaway agent shows up in spend data, it's been running for a while — the signals that actually fire in seconds are structural, not financial. An agent that calls the same tool with the same arguments repeatedly isn't making progress; it's stuck, and that's visible long before it's expensive. The hard part is telling that apart from legitimate repetition — a job-status poll, a flaky call retrying with backoff — which a naive call-count threshold can't do on its own. What actually distinguishes them is whether the response changed the state of the task, not whether the call happened again. See the Failure Loop Breaker for the two signals this checks and the retryable-vs-deterministic distinction it makes on errors.

A bounded execution budget closes the rest of the gap: a ceiling on retry/handoff depth that a chain of subagent calls can't recurse past even at $0 spent, and — separately — a dollar-denominated velocity check for the shape of runaway that token-per-minute limits structurally can't see: a flood of image or video generation calls, each cheap in tokens and expensive in price. See retry-tree depth and dollar-denominated velocity.

A cap that lives inside the compromised account isn't a second lock

If an attacker has the credentials that let them run up a bill, they can usually reach the same settings you'd use to stop them — a hard cap configured on the account itself is not a separate control, it's the same trust boundary the compromise already broke. What actually holds is a stop switch that lives behind different credentials: a second lock the attacker doesn't have the key to, even after they're in. That changes the failure mode from unlimited exposure until someone notices an invoice, to exposure capped the moment anyone with the other set of credentials notices something is wrong.

This is what Emergency Freeze is: a kill switch behind Cognocient's own login, not a setting on the proxy key or provider account that got stolen. And because it can also trigger automatically on a compromise-risk signal or a spend-velocity spike if you opt in, it doesn't require a human to be awake at 2am to actually fire.

A gate that denies quietly is a different kind of outage

Fail-closed — denying the call when the system can't confirm the reservation or counter, rather than letting it through unmetered — is the right default for a spend cap specifically, because the two kinds of mistake aren't symmetric. A false positive costs one rejected request. A false negative costs the runaway bill this entire design exists to prevent. Most systems default to failing open under uncertainty because it feels less risky to ship; for this one failure mode, that instinct is backwards.

But fail-closed only protects spend if someone can also see when it's firing too often. A gate that silently over-rejects — a misconfigured rule, a threshold set too tight — is an outage wearing a cost-control costume: nobody notices until throughput has already dropped and someone finally asks why. The fix is treating the rejection rate itself as a first-class metric with its own alert threshold, not just spend — a spike from a real attack and a spike from a misconfigured rule look identical from the outside, so the alert needs to fire either way, with the reason attached so you can tell them apart. Cognocient tracks this as its own anomaly type, separate from spend and call-frequency spikes, because an attack that gets mostly blocked looks like near-zero spend impact to the other two — see rejection-rate anomaly detection.

What this looks like end to end

Every call through Cognocient's proxy hits an atomic budget reservation before it reaches a provider — scoped to org, department, feature, run, or individual key, whichever ceiling is tightest — plus a token- and dollar-denominated velocity check, plus (for agent workflows) a retry-depth ceiling and Failure Loop Breaker pass. Any one of those failing returns a 429 or 403 before the provider is ever called, fails closed if its own backend can't be confirmed, and gets logged as a rejection event that its own anomaly detector watches for a spike. Emergency Freeze sits above all of it as the one control that needs no threshold to reach first — and lives outside the reach of a stolen proxy key.

None of this replaces the account-level caps providers now ship — it's the layer those caps were never designed to be: granular, cross-provider, and checked before the call, not after the bill.

Stop a runaway call before it happens

Atomic reservation, fail-closed gates, and a one-click kill switch — on every plan, including Free. No credit card, ever.

Start for free →

Not ready to touch production code? Import a CSV export or try the async wrapper to see this on your own data first.