Check out our latest blog: "SRE Error Budgets: How to Calculate Them and Use Them as Guardrails for AI Agents"

Learn More
logo
left-arrowBlog

SRE Error Budgets: How to Calculate Them and Use Them as Guardrails for AI Agents

SRE Error Budgets: How to Calculate Them and Use Them as Guardrails for AI Agents
Shrinithi Vijayaraghavan
Shrinithi Vijayaraghavan

Product Marketer

December 02, 2026

An SRE error budget is the amount of unreliability your service level objective (SLO) allows over a window. You calculate it as 1 minus the SLO, multiplied by the requests or minutes in that window. Teams use it to decide when to keep shipping and when to slow down and fix things.

The same number works for a newer source of change: AI agents. An agent that restarts pods, scales deployments, rolls back releases or edits feature flags is changing production, and it can do that faster than any engineer. Tying what the agent may do on its own to how much error budget is left gives you a guardrail the system enforces, rather than one written into a prompt.

This guide covers the calculation in detail (request-based and time-based budgets, rolling and calendar windows), how to write the policy, and then how to turn that policy into permission levels for AI agents. We'll use one example throughout: payouts-api, a service that sends money to merchants and handles about 2.4 million valid requests every 28 days.

The Google SRE error budget in one paragraph

Google's Site Reliability Engineering book introduced the error budget to end the argument between teams that want to ship and teams that want stability. Both sides agree on an SLO, and the gap between the SLO and 100% becomes a budget that releases are allowed to spend. The SRE workbook adds the part most teams skip: a written policy that says what happens when the budget runs out. If SLOs and SLIs are new to you, our guide to SRE principles covers them.

How to calculate an SRE error budget

Every error budget starts with an SLI written as good events divided by valid events. For payouts-api, a good event is a payout request that returns a 2xx within 1 second. A 400 for a malformed request is the client's fault and doesn't count against you. A 500, a timeout or a dropped connection does.

The SLO is 99.95% over a rolling 28 days, so the budget is 0.05%. There are two ways to count it.

Request-based budgets

Multiply the budget by the number of valid requests:

2,400,000 requests × (1 − 0.9995) = 1,200 failed requests per 28 days

If 780 have failed so far this window, you've spent 65% and have 35% left.

If your metrics are in Prometheus, remaining budget is one expression. The metric and label names here are illustrative, so adjust them to your own:

1 - (
  sum(increase(http_requests_total{service="payouts-api", code=~"5.."}[28d]))
  /
  (sum(increase(http_requests_total{service="payouts-api", code!~"4.."}[28d])) * 0.0005)
)

A result of 0.35 means 35% of the budget remains. Below zero means the SLO is already missed.

Time-based budgets

Instead of counting requests, mark each minute as good or bad. For payouts-api, a minute is bad if fewer than 99% of its requests succeed or its p99 latency goes above 1 second. Then:

28 days × 1,440 minutes = 40,320 minutes
40,320 × 0.0005 = 20.16 bad minutes per 28 days
Which method to use
MethodCountsWorks well forWatch out for
Request-basedFailed requestsBusy services with steady trafficA failure at 3 a.m. costs less than the same failure at noon, which matches user impact but can hide off-peak problems
Time-basedBad minutesLow-traffic services, where a handful of failures swings the ratioChoosing the per-minute threshold is a judgment call, and a 10-second outage can cost a full minute

Most teams use request-based budgets for user-facing APIs and time-based budgets for batch jobs and internal tools.

Rolling or calendar windows

A calendar window resets on the 1st of each month. It's easy to report on, but it creates an odd incentive: a team with budget left on the 25th has a reason to ship risky work before the reset. A rolling window always looks at the last 28 days, so a bad day drops out of the budget gradually, four weeks later. The SRE workbook's example policy uses a four-week window. We'd use rolling windows for day-to-day decisions and calendar months for reporting to the business.

Write the error budget policy before you need it

A budget only changes behavior if everyone agreed in advance what happens when it's spent. The workbook's example policy is a good template. If the service exceeds its budget over the preceding four weeks, all changes stop except P0 issues and security fixes until it's back within SLO. Any single incident that uses more than 20% of the four-week budget gets a postmortem with at least one P0 action item. Disagreements about the calculation go to the CTO.

We'd add one thing for the AI section that follows: tiers between "healthy" and "exhausted". For payouts-api:

  1. More than 50% remaining: normal release policy.
  2. 25 to 50% remaining: risky changes need a second reviewer, and planned experiments are paused.
  3. Less than 25% remaining, or a fast-burn alert is firing: only fixes that reduce errors ship.
  4. Budget exhausted: freeze, with the P0 and security exceptions above.

Fast-burn alerts, which fire when the budget is being spent many times faster than normal, are covered with starter thresholds in our golden signals guide.

Using error budgets as guardrails for AI agents

The SRE workbook notes that roughly 70% of outages come from changes to a live system. AI agents that act on infrastructure are another source of change, and two properties make them different from a human operator. They act quickly, and they can act confidently on a wrong conclusion.

In July 2025, a Replit coding agent ran destructive commands against a live production database during a declared code freeze. The freeze existed as an instruction in text. Nothing in the system stopped the agent from acting on production. Error budgets help here because they turn "be careful right now" into a number that a pipeline, an admission policy or a role binding can check.

Map budget tiers to agent permissions

Use the same tiers as your policy, and decide what an agent may do in each one without a human:

Budget remainingAgent may do on its ownNeeds human approval
More than 50%Investigate; run pre-approved, reversible runbook steps such as restarting one crash-looping pod or scaling within existing autoscaler limitsRollbacks, config and flag changes, anything touching data
25 to 50%Investigate and propose actionsEvery action
Less than 25%, or fast burnInvestigate onlyEvery action, and the agent should propose the safest one first, usually a rollback
ExhaustedInvestigate onlyOnly P0 and security fixes, as the policy says

Treat this as a starting point; a payments service might never allow unattended actions at all. (Our post on AI SRE agents covers autonomy levels more generally.)

Estimate an action's budget cost before allowing it

The tiers work better when each action has an expected cost. payouts-api averages about 60 requests a minute (2,400,000 ÷ 40,320). Two examples:

  • Restart one of six replicas. Worst case, one-sixth of traffic fails for 2 minutes: 60 × 2 ÷ 6 = 20 failed requests, under 2% of the 1,200-request budget.
  • Push a config change to every pod. If it's wrong and takes 5 minutes to detect and revert, all traffic fails: 60 × 5 = 300 failed requests, 25% of the budget.

The first is safe to pre-approve when the budget is healthy. The second should always have a human in front of it, because one mistake would cross the workbook's 20% postmortem line.

Verify, and revert automatically

After any action, the agent should watch the SLI for a fixed period, say 10 minutes. If the error rate rises instead of falling, it reverts its own change, drops to investigate-only and pages a human. That's the same canary logic you'd apply to a deploy.

Track the budget agents spend

Record every agent action as an event with the actor, the action and the target, so budget spent can be attributed to agent changes the way it is to deploys. If agent-attributed spend in a window passes a threshold (20% mirrors the workbook's outage rule), lower the agent's tier until someone reviews what happened.

Enforce it outside the prompt

A prompt instruction can be ignored, as the Replit case showed. Enforce tiers where the agent can't talk its way past them:

  1. Give the agent a read-only identity by default. Our post on self-hosted AI SRE deployment shows a read-only Kubernetes role.
  2. Grant write access through a separate, narrowly scoped role that a gate hands out per action.
  3. Have the gate check remaining budget and burn rate before granting it, and log the decision.

AI SRE and chaos engineering practices: spending budget on purpose

Chaos engineering spends error budget deliberately. The Principles of Chaos Engineering recommend running experiments in production and minimizing the blast radius, and an error budget gives that blast radius a number. A reasonable rule: run experiments only when more than 50% of the budget remains, and cap each one at 10% of what's left. For payouts-api at 60% remaining, that's 72 failed requests per experiment.

The same experiments are how you build trust in an AI SRE before giving it more room. Inject a fault you understand, such as killing a dependency's pods or adding 300 ms of latency to its database, and check three things: whether the agent identified the right cause, whether it proposed the right action, and whether it refused to act when you lowered its tier. Raise autonomy only after it passes the same test several times.

How we approach this at KubeSense

AgentSRE, our AI SRE, is built around the human-in-the-loop end of the table above. When a threshold is crossed, KubeSense raises the alert, routes it and opens an incident. AgentSRE runs a root cause analysis across your telemetry, runbooks and documentation, then posts the data sources it checked, the root cause and the resolution steps to the incident. An engineer decides what to do. Every implementation keeps a human in the loop. AgentSRE connects to systems such as Kubernetes, Git or Splunk through MCP and pulls only the data it needs for the incident.

Two other parts help with error budgets in practice. AnomalyAgent flags anomalies around deployments, which shortens the search for the change that burned your budget. And the platform keeps full, unsampled telemetry in your own cloud account or data center, so the evidence for a budget decision is there when you need it.

If you'd like to see it on your own services, book a 15-minute demo.

Key takeaways

  • An error budget is 1 minus the SLO, multiplied by the requests or minutes in the window.
  • Use request-based budgets for busy APIs, time-based budgets for thin or spiky traffic, and rolling windows for day-to-day decisions.
  • Write the policy first, with tiers between healthy and exhausted.
  • Map those tiers to what AI agents may do alone, and enforce them through roles and gates, not prompts.
  • Use chaos experiments, capped by budget, to test an AI SRE before giving it more autonomy.

FAQ

What is an error budget in SRE?

It's the amount of failure an SLO allows over a time window. A 99.9% SLO over 1 million requests gives a budget of 1,000 failed requests.

How do you calculate an error budget?

Multiply 1 minus the SLO by the valid requests in the window (request-based) or by the minutes in the window (time-based). Remaining budget is 1 minus failures so far divided by failures allowed.


Tags

SRE error budget
SRE