Case study
Measuring an on-call agent on faults it cannot see coming
Pager answers a production alert the way an on-call engineer would: it reads metrics, logs, traces, deploy history and the database, names a root cause, and proposes a fix that a person approves. Most of the work went into the benchmark around it, which measures how often the agent is right, how often its fix would hurt, and what that costs.
- Role
- Solo project: design, lab, agent, benchmark, evaluation; built with AI coding assistants
- Stack
- Go services, Python agent (LangGraph), Prometheus, Loki, Tempo, Postgres, Redis, Docker Compose, k6
- Models
- GLM-5.3-flash and Claude Haiku 5.5 through OpenRouter
- Model spend
- $4.25 across every study and demo
The problem
AI incident responders are easy to demo and hard to trust. A demo shows one good investigation; an on-call team needs to know the miss rate, which misses are dangerous, and whether the agent beats a much cheaper baseline. Answering that needs incidents with a known answer, many of them, run under the same conditions.
What I built
- A system that breaks on purpose. Seven Go services behind a gateway, Postgres, Redis Streams and a fake external provider, with metrics, logs, traces and multi-window SLO burn-rate alerts. 26 injectable faults, each with ground truth: the faulty component, a closed mechanism label, acceptable fixes and harmful ones. Faults arrive with decoys, such as an unrelated deploy a minute earlier.
- An investigator that can only read. 16 tools on a reviewed allowlist; the database and Redis users it connects as cannot write. Every claim in its report cites a tool result by id (E1, E2, …), and a validator rejects reports that cite evidence that does not exist.
- A scorer and a ledger. Each incident is scored offline against ground truth, including whether the proposed fix would have done harm. Every published number has an evidence entry: commit, host, exact command, sample size, raw archive and limits.
- Human approval. The proposed fix runs only after a person approves it, through a signed, crash-safe journal.
What the numbers say
The main study injected 77 incidents, 74 of which paged, and ran six agent setups on each live incident. Claude Haiku with tools named the exact service and mechanism in 42 of 74 (57%). The cheaper GLM-5.3-flash did better with one request and a fixed evidence bundle (35 of 74) than with its tool loop (14 of 74). Harmful fixes were rare: 7 of 271 valid reports, six of them rollbacks of the decoy deploy.
On the lab side, 95 of 100 valid injections paged, median 42 s. One fault, a gateway out of file descriptors, never paged at first, because the failure happens before any request handler records a metric. The fix was a synthetic edge probe, not a lower threshold: that fault then paged 4 of 4 times.
Mistakes the data exposed
- The agent's budget counted text it never sent. GLM's tool loop lost to its own single prompt mostly on budgets. The request-size limit measured the model's reasoning text, 42% of the counted bytes, which the client never sends back. And a run that hit any limit ended with no report at all. After fixing both, every one of 38 tool-loop runs in the re-run finished, where 55 of 74 had hit a budget or the deadline before.
- My own scorer was wrong. It first reported 63 harmful fixes. It counted the correct rollback of a bad config deploy as harmful and compared free-text targets literally. After the fix, the same archive scored 7.
- The ground truth disagreed with the instructions. The agent was told to name an outside job when one caused the fault; three database faults named the database instead. I changed the rule for every fault at once, kept both scores side by side, and the change moved results in both directions.
- A reviewer model that agreed with everything. A second model checking finished reports marked all 10 it saw as supported, including 6 that were wrong. I removed it.
- The lab lied quietly. In one run the tracing backend ran out of memory and restarted during investigations. The health gate now refuses to start an incident unless metrics, logs and traces are ready and stable, and every incident records any backend restart.
After the fixes
GLM was re-run on one incident per fault, all three setups on the same live incidents (19 paged). Tool agent 11, single prompt 10, tool agent without runbooks 13. The tool loop no longer loses, but 19 incidents cannot separate it from the single prompt, and I report it that way. Fitting the model's stated confidence to how often it was right on the first study improved the Brier score on the re-run from 0.239 to 0.214; the approval page now shows that track record next to the confidence.
Making it usable on any stack
Version 0.4 runs Pager against anyone's systems from one config file, while the lab keeps the exact prompt and tools the benchmark measured (a test freezes them).
-
A real alert, end to end. A poison message was injected into the lab, Alertmanager's
own webhook body went to
pager serve, and Pager, configured like any other system, named the worker, the poison message and the dead-letter fix for $0.0016. One run. -
Kubernetes with a read-only role. Six tools through
kubectl, limited to reading.pager checkfailed admin credentials and passed the read-only role on a live k3s cluster, and one investigation found a bad rollout with that role alone. - The same tools over other stores. Elasticsearch, OpenSearch, Jaeger, Zipkin and VictoriaMetrics were tested against the real servers. They exposed two bugs, a missed match on hyphenated service names and a search that failed on mixed indices, both fixed.
- Reports where people look. Mattermost, ntfy, email and Gitea were checked on the receiving server. PagerDuty, Opsgenie, Datadog, Teams, Discord, GitHub and Jira follow their published formats but have not been run against the live services.
Limits
- The lab is synthetic, and each incident ran once on one host.
- The main study stopped at 77 of 100 planned incidents when the API account ran out of credits.
- Six faults whose behaviour depends on the host were excluded.
- Equal call and time limits are not equal dollar budgets across models.
What I would do next
Run two incidents per fault on the current code to test the newest changes and get enough incidents to tell the tool loop and the single prompt apart; teach the agent to check that a recent change touches the failing path before blaming it, which is where most harmful fixes come from; and run the documented vendor adapters against real accounts.
See the live benchmark Watch an investigation
Source code available on request.