Skip to main content

Error Budget (Agentic)

SRE error budget concept adapted to autonomous agent loops. The budget defines how much failure — in retries, cost, runtime, or error rate — is tolerable before the system must stop, narrow its capabilities, or roll back. Without a budget, self-healing loops run indefinitely.

SRE Origin

Error budget (GitLab/Google SRE definition): the acceptable amount of unreliability over a time window, derived from the Service Level Objective (SLO).
When budget is exhausted: freeze feature releases until reliability recovers. The budget is a shared contract between engineering and the business on how much downtime is acceptable.

Agentic Adaptation

In agent loops, “unreliability” maps to multiple resource axes simultaneously: An agent loop without budget definitions can spend unbounded resources on a task it cannot solve, accumulating debt (bad code, flaky fixes, wasted compute) while reporting “still working.”

Budget Policy Rules

Rule 1: Define budget before starting, not during failure Budget values must be set in config, not chosen adaptively by the agent. An agent under pressure will rationalize higher budgets. Rule 2: Budget exhaustion stops, not pauses When any budget is exhausted: stop, rollback if applicable, write incident note. Do not “just try one more time.” Rule 3: No progress = budget consumption If the agent makes N attempts with identical failure signatures and zero test improvement, that is budget exhausted regardless of remaining retry count. Signature-based detection catches this without counting. Rule 4: Token/time exhaustion escalates, not loops If the agent consumes its token or runtime budget without completing: checkpoint state, stop cleanly, flag for human. Looping on a budget-exhausted task is the failure mode, not the fix.

Reference Budget Defaults (Starting Point)

Calibrate these per project; these are conservative starting values:

Budget as Rollback Trigger

Error budget integrates with Self-Healing Loop rollback conditions:
The budget threshold replaces “wait and see” with a machine-enforceable condition. The health monitor runs independently of the agent — agent cannot suppress or override it.

Detecting No-Progress Without Budget

When an agent loops on the same failure with different patches but no improvement, retry count alone doesn’t catch it:
This is the “spending without improving” detector: progress score of 0 across two retries = budget exhausted regardless of counter.

Budget vs Retry Count

These are related but distinct: All three are needed. Retry count alone doesn’t stop an agent that tries 100 different fixes on 100 different things, each failing once. Budget covers the aggregate; progress score covers the per-attempt signal.