RBRunbook
Study

Domains · Domain 4 · 10% of scored questions

Advanced Debugging and Incident Response

About 6 of the 60 scored questions come from this domain. It has 2 skills:

Lessons

Skill

Complex Failure Diagnosis

Finding where a failure started: model, harness, tools, or data

A production failure in a Claude system has four possible origins: the model output, the agent harness (your loop, message assembly, parsing, retries), the tools, and the data (retrieved documents, tool payloads, indexes). The symptom usually appears far from the origin. Your job is to find the first step that differs from a healthy run, then name the layer that owns that step.

Read the trace forwards, not backwards

Agents keep state across many tool calls, so one bad step sends the rest of the run down a different path. Anthropic's write-up of its research system notes that one step failing can cause agents to explore entirely different trajectories. Start at the top of the trace and stop at the first divergence. A wrong final answer at step 45 that follows from a timed-out lookup at step 6 is a step 6 problem.

Stop reasons are evidence, not errors

A stop reason comes back on a successful response. An error is a 4xx or 5xx status. Mixing them up sends you to the wrong layer.

What you seeLikely originWhat to check
Two or three output tokens, end_turn, right after tool resultsHarnessText blocks added after tool_result blocks, or a finished turn sent back unchanged
max_tokens with a tool call that will not parseHarness configThe output cap. Retry with a higher value
HTTP 200, empty content, refusalSafety classifierstop_details category
Tool input checks fail only after a model changeHarnessRaw string matching on serialized JSON. Parse it instead
Agent declines to follow text inside a tool resultHarness or tool designYour own instructions placed inside the tool result
Refusals are their own failure class

A refusal is a normal HTTP 200 response. Retrying the same request on the same model treats it like a transient fault and will not help. The documented route is to read the category and retry on another Claude model, in the API or in your client. One category is the exception: when the refusal is about reproducing internal reasoning in the output, there is no recommended fallback model and you change the prompt. Look for a reasoning or scratchpad field in the output format, the system prompt, a skill, or a tool description. A refusal can also arrive mid-stream. Discard the partial output; do not store it as an answer.

Non-deterministic and multi-agent failures

The same input can pass on one run and fail on the next. One passing rerun proves nothing about a failure that happens one time in fifteen. Run the case many times, compare the failure rate before and after a change, and read the transcripts of the runs that still fail. For multi-agent systems, check the messages between agents. A small change to the lead agent can change how subagents behave even when their own prompts are untouched, and vague task descriptions cause duplicated work and gaps. If you cannot see why agents fail, add tracing of queries, sources, and tool errors before you change prompts.

Retrieval-grounding failures: find the stage
  1. Was the right passage in the index? If the current document was never ingested, the model can answer faithfully from a stale one. That is a data problem.
  2. Was it retrieved? Embeddings can miss exact matches such as part numbers and error codes. Lexical search (BM25) alongside embeddings addresses that.
  3. Was it used? If the passage was retrieved and the answer still contains claims found in no passage, the fault is in generation. Restrict the model to the provided documents, require a supporting quote for each claim, and allow it to say it does not know.
A citation with a valid pointer shows which passage the answer used. It does not show that the passage is current or correct. An answer can be perfectly grounded in the wrong document.
Do not start with the model. A pinned model ID keeps the same weights, so when one input class fails after a change on your side, look at the harness, tools, and data first. Serving infrastructure can change behaviour slightly without a new model ID, which is a reason to keep request IDs and dated evidence, not a reason to skip your own layers.

Sources
Stop reasons and fallback
Refusals and fallback
Troubleshooting tool use
Handle tool calls
Reduce hallucinations
Citations
Model IDs and versioning
How we built our multi-agent research system
Introducing Contextual Retrieval

Skill

Incident Response and Learning Loops

Running the incident and turning it into tests, monitors, and findings

An incident in an LLM system is often a quality regression, not an outage. Error rates stay flat while answers get worse. The response still follows the same order: limit the harm, coordinate, tell people, then learn.

Mitigate before you diagnose

The SRE book puts the priority in one line: stop the bleeding, restore service, and preserve the evidence for root-causing. In a major incident the instinct is to hunt for the root cause. Resist it. Make the system work as well as it can first.

  • Pick the mitigation the evidence supports. Line the start of the regression up against the change log. Recent changes are a productive place to start, including changes labelled routine. If the regression is confined to one cohort (a region, a prompt version, a proxy pool), revert the change that defines that cohort.
  • Check that rollback will help. If a holdback slice on the old version shows the same regression, your change is not the cause and rolling it back only adds churn.
  • Use the smallest blast radius. If one write tool is causing harm, disable that tool or put it behind approval. Taking the whole assistant offline punishes the traffic that is healthy.
  • Prefer deterministic controls for harmful actions. A new prompt line asking the agent not to repeat a refund is a request, not a control.
  • Keep the traces. Save failing examples and request IDs before a rollback changes the picture. You need them for diagnosis and for support.
Coordinate

Declare early. It is better to declare an incident and close it after a simple fix than to assemble a response hours into a growing problem. A slow rise in thumbs-down rate with two teams investigating separately is already an incident.

Separate the roles: an incident commander who holds the overall state, an operations lead whose team is the only group changing production, and a communications lead. Uncoordinated changes are the classic failure. If three engineers each adjust the prompt, the retrieval settings, and a sampling parameter, nobody can tell which change moved the metric.

Communicate

Send periodic updates that state what is known: user impact and scope, the mitigation under way, and when the next update will come. Do not present a suspected cause as confirmed, do not name individuals, and do not paste customer conversations into a broad update.

Convert the incident into regression evaluations
  1. Use the real failures. Converting user-reported failures into test cases keeps the suite tied to actual usage. De-identify them where the domain requires it.
  2. Grade the outcome. Check the resulting state, such as the calendar record or the database row, and not only what the agent said it did.
  3. Run several trials. Outputs vary between runs. A regression suite should pass close to 100% of the time, so a drop means something broke.
  4. Test both directions. If the incident was a missed escalation, add cases where escalation is wrong as well. One-sided evals create one-sided optimization.
  5. Distrust a 0% pass rate. It is most often a broken task or grader. Read the transcripts before you touch the agent.
Close the monitoring gap

Ask how the incident was found. A customer email after six days is a monitoring failure, and that alone justifies a postmortem. If the fault existed only in production configuration, more offline cases will not catch it next time. Anthropic's own postmortem of three infrastructure bugs commits to running quality evaluations continuously on true production systems, and names the lack of a clear way to connect user reports to recent changes as a gap.

Write a blameless postmortem

The document records impact, mitigation, root causes, and follow-up actions. Focus on contributing causes without indicting a person or team. You cannot fix people, but you can fix the systems and processes around them. Good action items fall into three groups: prevent recurrence, detect sooner, and mitigate faster. Each needs an owner. A postmortem that is never reviewed might as well not exist.

Writing that the engineer skipped the evals stops the analysis one step too early. Ask why the deploy path allowed a prompt change to reach production without them.
Reaching for a forward fix because the cause seems obvious. An untested fix shipped during an incident is a second change stacked on the first. If a known-good version is minutes away, go back to it and test the fix offline.

Sources
Managing Incidents (Google SRE book)
Postmortem Culture: Learning from Failure (Google SRE book)
Effective Troubleshooting (Google SRE book)
A postmortem of three recent issues
Demystifying evals for AI agents
Claude API errors

Sample questions

Sample question
A freight forwarder's customs agent makes about 45 tool calls per shipment. For one shipment it filed a declaration with the wrong tariff code. The trace shows:
step 6   lookup_tariff(hs=8471.30) -> content: upstream timeout   is_error: (not set)
step 7   model: The lookup gave no code, so I will infer one from the product description.
step 8-44  declaration built with inferred code 8471.41
step 45  submit_declaration -> accepted
The same model ID and prompt produced correct filings for the 300 other shipments that day. The tariff service logged a 40-second brownout that overlaps step 6. Where did this run first go wrong?
  • AIn the submission tool, which accepted a declaration it should have rejected
  • BIn the tariff reference data, which holds a stale code for this product class
  • CIn the harness, which handed a failed tool call to the model as a normal result
  • DIn the model, which lost track of its instructions late in a very long trajectory
Show the answer and explanation

Answer:

  • In the harness, which handed a failed tool call to the model as a normal result

Read the trace from the top and stop at the first step that differs from a healthy run. That is step 6: the lookup timed out, and the harness returned the timeout text as ordinary content without marking it as a failure or saying what to do next. Everything after follows from that. A tool result that is flagged as failed and carries an instructive message lets the model retry or stop instead of guessing. The model did not drift late in the run: the change of course is at step 7, directly after the bad result, and 300 other runs with the same model and prompt were fine. The reference data was never read, because the lookup returned nothing. The submission tool accepting the filing is where the damage landed, not where it began.

Sample question
A bank's dispute-handling assistant hands 9% of sessions to a human in a normal week. From Tuesday 10:05 that figure is 21%. The change log:
Thu 14:00  prompt v31 to 100% of traffic   (handoffs flat Thu-Mon)
Mon 09:00  retrieval index rebuilt         (handoffs flat Mon)
Tue 10:00  gateway routing update, labelled routine:
           region-B traffic moved to a new proxy pool
Tue 16:00  tool schema v5 (planned, not yet live)
Handoffs are 34% for sessions that pass through the new proxy pool and 9% for all others. Each change can be reverted in under ten minutes. What should the team do first?
  • ARevert the gateway routing update and keep the affected traces
  • BReproduce the failure in staging and leave production as it is
  • CRestore the previous retrieval index and re-run the golden set
  • DRoll the prompt back to v30 and watch the handoff rate for an hour
Show the answer and explanation

Answer:

  • Revert the gateway routing update and keep the affected traces

The evidence points at one change. The rate moved five minutes after the routing update, and the regression is confined to sessions on the new proxy pool while everyone else sits at the normal 9%. Reverting is cheap, so mitigate first and keep the traces for root-cause work afterwards. A change labelled routine is still a change. The prompt went out on Thursday and the rate stayed flat for four days, so rolling it back removes a healthy change and leaves users exposed. Reproducing in staging first delays a ten-minute mitigation while a third of region-B sessions fail, and staging may not have the new proxy pool at all. The index rebuild also had a flat day after it and would not explain a split by proxy pool.

↑↓ move↵ openesc close