THEMIS

SRE for agent fleets: error budgets, autonomy and root cause for AI agents.

sim-large (quarantined)repo.readrepo.writesecrets.readsim-smallsession.lookupdeploy.applygitops.open_prbilling.querykb.searchsim-mediumweb.fetchci.run_testsdocs.writesec.scanlogs.searchmetrics.query1waitingcodersuspendedconciergedeployersupervisedfinopsplannerresearcherreviewerscribesentinelsresupervised
to put a rogue agent under human supervision1
3.1 s
failed journeys traced to the right cause1
670 of 672
through a crashed leader, a rolling redeploy and a database outage of 8 s, with a 30 s exporter timeout2
0 spans lost
run on one laptop by themis demo, with no cloud account1
10 agents

One laptopSQLite, nothing to set up

Free, MIT

Every agent gets an error budget. Spend it too fast and it loses the right to act alone, until it has earned that right back.

Trusted agents act alone on the outer ring.

Each agent has four budgets: tasks done, clean handoffs, safe actions and staying within cost. Themis counts them from the OpenTelemetry spans the agent already sends.

Burn the budget and the agent is pulled in.

Spending it 14.4 times too fast over both the last hour and the last five minutes moves an agent to the inner ring. Its risky actions then wait for a person to say go or no-go.

If it keeps burning, or reaches outside its allow-list five times, it docks at the centre and stops. Only a person moves it back out, and the reason goes in the audit log.

Tools and models sit on the rim.

A tool or model that keeps causing failures is quarantined, so callers switch to their fallback. When the quarantine ends traffic tries it again, and a second offence doubles the time.

Close-up of one journey's steps in the Themis dashboard, with the failing steps in red.

One failed ship_change journey, recorded during a live run: 371 ms across 16 steps. Themis named the coder as the cause: coder handed invalid work to reviewer.

The deployer agent's page: its four budgets, the safe-actions budget burning, and its move to supervised.

A rogue agent is caught before its next risky action runs.

3.1 s

From the start of a rogue_agent fault on the deployer to Themis putting it under supervision. After that, a person saw every unsafe action before it ran.1

Each failed journey is traced to what broke it.

99.7%

670 of 672 failed or stopped journeys were traced to the agent, tool or model that caused them, checked against the simulator's record of what it broke.1

The incidents page: open incidents, and a table of what is breaking journeys, by cause.
What one journey used: each agent with its pod, model, tools, cost and tokens.

Every journey shows what it used, agent by agent.

5,220 tokens

$0.0042 on 5,220 tokens for the whole journey, split by agent, with the pod and node each one ran on.

Specifications

root cause named correctly670 of 672 failed or stopped journeys (99.7%)1
rogue agent put under supervision3.1 s after the fault began1
poisoned agent suspended3.8 s after the fault began1
rate-limited model quarantined4.8 s after the fault began1
silently wrong tool quarantined17.8 s after the fault began1
span ingest, one process11,757 spans a second1
gate snapshot p95 under load22 ms2
span ingest p95 under load35 ms2
dashboard overview p95 under load64 ms2
availability outside the injected faults100.00%2
spans lost through a crashed leader, a rolling redeploy and a database outage of 8 s0 with a 30 s exporter timeout, 132 with the 10 s default2
journeys judged twicenone2
new evaluator after the leader crashes43.5 s2
handover on a rolling redeploy0.6 s2
telemetry inOTLP over HTTP, OpenTelemetry GenAI conventions
incidents outAlertmanager webhooks, signed with HMAC-SHA256
storageSQLite on one machine, PostgreSQL for several replicas
runtime dependencies8 Python packages
licenceMIT
  1. 1 themis bench: 16 simulated users, seed 7, 3,955 journeys across 10 agents, 4 faults one after another, SLO windows compressed 120 times, postgresql, x86_64, 2 CPUs, Python 3.13.18. The models and tools are simulated; the control plane is the code in this repository.
  2. 2 scripts/soak.py: 3 replicas behind a load balancer on production settings (15 s evaluator interval), 40 journeys a second (480 spans) with 100 gate pollers and 3 dashboard viewers for 240 s, on PostgreSQL. The leader was killed with SIGKILL, another stopped with SIGTERM, and PostgreSQL stopped for 8 s. x86_64, 2 CPUs, Python 3.13.18, shared by every process. Latency measured at the load balancer.

“Hope is not a strategy.”

A traditional SRE saying, as it opens the first chapter of Site Reliability Engineering (O’Reilly, 2016). Themis is that idea applied to AI agents.

Themis 0.2.0

Free, MIT licence

Get Themis on GitHub