Skip to main content

How we evaluate an AI SRE

Incident investigation has no ready-made reference answers, the scene disappears, answers leak, and the same configuration can reach different conclusions on repeat runs. This post covers how Flashduty handles each of the four problems, and one change we believed worked but didn't ship after evaluation.

Flashduty Engineering

How we evaluate an AI SRE

Every change to AI SRE looks reasonable: add a sentence to the prompt, add a subagent, add a rule. Without evaluation, you can't tell whether the result is better or worse.

Evaluating a question-answering agent is relatively easy. Ours answers how to use the product, and its case bank has 135 questions: 100 have answers in the official docs, and 35 should be declined. The bank is fixed, so scores stay comparable after you change models.

Incident investigation has none of these properties. This post covers the four problems you have to handle when evaluating it, and what we do about each.

Evaluating incident investigation raises four problems

ProblemWhat it looks likeWhat we do
No reference answerAfter an incident is handled, few people come back to fill in the root causeWrite questions from incidents whose root cause we established ourselves
The scene disappearsLogs and metrics expire, while code and configuration keep changingGrade steps whose data expired by an expired-data rubric
Answers leakFix commits and postmortem docs appear after the incidentDraw a line at the moment of the incident, and check after the run
Results fluctuateThe same configuration run repeatedly can reach different conclusionsRun each question several times and grade blind

A question that points straight at live data goes stale within days.

Before tackling these four, there's an easier question you can answer first.

Start with the easier question: does it run well

Judging whether an investigation's conclusion is right needs a reference answer. Judging whether a session ran well doesn't.

Before we had a case bank, we had AI read online sessions, as a closed loop.

  1. Pick. From online sessions, pick the ones with negative signals, such as a user pressing stop midway, a tool error, or a user's own words expressing dissatisfaction.
  2. Read. A stronger model reads the whole process and decides whether the problem lies in the platform, the knowledge, or the environment.
  3. Argue against. Another model is assigned to argue against the conclusion, and only the problems that survive stay.
  4. Compare. After a fix, new sessions randomly use the new or the old version, and we compare the user interruption rate and the tool error rate.
  5. Roll out. The better version rolls out.

Reading is limited to sessions from allowlisted and consenting customers.

The problems this step finds have one thing in common: nothing reports an error online, yet the user didn't get a complete result. Monitoring can't see this kind of problem. You find it only by reading the whole process.

Here's how one change was judged. We trimmed the system prompt from 20 KB to 12 KB. After splitting old and new versions by session, the tool error rate fell from 1.33% to 0.57%, so we rolled it out.

This loop has a clear limit: the model reading the sessions doesn't know the root cause either. It can judge whether a session ran well, but not whether the investigation was right.

Reference answers come from incidents we resolved ourselves

To judge whether an investigation is accurate, you need a reference answer. We considered three sources.

OptionHowUpsideProblem
Traffic recordingRecord every query made during an investigation and replay it as isReplayable and cheapA query from a new version may be missing from the recording
Simulated systemBuild a business system and inject faultsData is liveHard to make complex enough, and the faults are easy to spot
Our own incidentsRecord real incidents with established root causes as questionsReal incidents with certain root causesData expires and answers can leak

We picked the third. Flashduty's own online services are also managed with Flashduty and AI SRE. When routine troubleshooting establishes an incident's root cause, we record it as a question on the spot.

A question has three parts: the question text, the reference answer, and the grading rubric. The last two are used only for grading and never go to AI SRE.

Take a real question as an example. The question text is one sentence asking it to investigate the cause of an incident, and the alert says one Redis instance's memory usage reached 80%. The reference answer is the conclusion established at the time: memory had been rising slowly for weeks, 99.7% of keys had an expiry time, and no evictions had happened, so the cause was more data being written, not a leak.

Which questions get in matters more than how many

You don't need thousands of questions to evaluate a change. A dozen representative ones are enough. A question enters the bank when it meets four conditions:

  • Common incident type. Your customers will hit it too.
  • No internal knowledge needed. The data needed to judge right from wrong exists in ordinary systems.
  • No duplicates. Keep one question per kind of incident.
  • No score without investigating. If you can score by looking at the alert alone and checking no other data, the question doesn't test investigation.

"Can't find it" is also a question. We also record incidents that ended as a false alarm or with insufficient evidence, and the reference answer says "can't be determined, and which evidence is missing". If the bank held only incidents with findable root causes, AI would be tuned to give a conclusion in every case.

Questions retire. A question leaves the bank when its evidence expires, its reference answer is overturned, or the system changes so that the same problem no longer occurs. So far we've recorded 20 questions, and 9 are still usable.

Draw a line at the moment of the incident

If you evaluate against a past incident in today's environment, the environment holds both data that has already disappeared and data that appeared only afterward. Both are bounded by the moment of the incident.

Bounded by the moment of the incident: alerts, metrics, logs, code, and changes before it can be read; fix commits, postmortem docs, timeline comments, and modified alert rules after it are answers and must not be read

Data before the line expires. We keep logs for 7 days and metrics for about one month. Alerts, changes, and code are kept long term. After logs expire, any step that only logs could prove is graded by an expired-data rubric: an answer written as a guess or one saying the data can't be found counts as correct, and one written as confirmed counts as overstated. Within one batch of evaluations, the old and new groups see the same data, so the comparison still holds.

Data after the line is the answer. After an incident, the answer gets written down piece by piece: fix commits, postmortem docs, comments on the incident timeline, modified alert rules. For the Redis question above, the fix commit appeared 3 hours after the incident.

Two things prevent leakage:

  • A rule up front. The question text states the moment of the incident and forbids reading anything after it.
  • A check afterward. When the evaluation finishes, we check every command it ran and every tool return. A run that read content from after the incident doesn't count and runs again.

The rule alone isn't enough. In one batch of 69 runs, 15 read content from after the incident, mostly subagents that read the title of the fix commit. After we wrote the incident moment more clearly into the question text, none of the next 36 runs did.

The same configuration gives different conclusions

Results fluctuate even when you repeat the same configuration. Among our 10 questions, five had given different conclusions across two runs. With a single run, you can't tell whether a difference comes from the change or from the fluctuation.

So each evaluation follows three rules:

  • Run each question three times. For both the new and the old version.
  • Alternate the two groups. This avoids the environment differing when one group runs after the other.
  • Grade blind. Shuffle the answer numbers before grading, and reveal which group each belongs to only afterward.

A change we believed worked and didn't ship after evaluation

We once believed that AI's biggest problem when investigating incidents was stating guesses as conclusions.

The change was to have it write conclusions as an evidence chain: each link states its evidence, and if any link is unconfirmed, the whole must be written as a "hypothesis". Before the change we ran six small trials, and it looked effective. We also felt it should be.

We then evaluated it on three of our own incidents, running each wording 18 times with blind grading.

Evidence-chain rule results: before the change, 14 of 18 runs correct; with the rule in the system prompt, 0 runs marked a hypothesis and 13 were correct; with the rule in the user message, 17 runs marked a hypothesis and 11 were correct

With the rule in the system prompt, the model didn't follow it, and the number of correct answers didn't change. When we moved the rule into the user message, 17 of 18 runs marked a "hypothesis", but it also marked correct conclusions as hypotheses, and the correct count dropped to 11.

We didn't ship this change. With only six runs it looked effective, and the conclusion didn't hold once we ran more.

This evaluation also exposed an error in our own case bank. On one question, every answer disagreed with the reference answer at the same point. When we checked, the reference answer we wrote had left out one step. When every answer is wrong in the same place, check the reference answer first.

One thing to try first

A case bank takes time to build, but you can start the first step right away: filter 20 sessions where a user interrupted midway, and read them from start to finish.

Most of the problems in those 20 sessions won't show up on any monitoring chart.

This is the second post in our series on building AI SRE. The first is Building an always-on AI SRE.

Related articles

Less noise. Faster recovery.

Start free, no credit card required. Or book a demo to see the full incident workflow end to end.