New Tool Radar

AI Agents & Automation

How to Write an Agent Runbook for Common Failures

Write an agent runbook for common failures so the next person can fix a failed run without guessing.

Schematic with three steps: List the failures that repeat; Write symptom, cause, and fix for each; Test the runbook on a real failure.

When a run fails at midnight, the person on call should not have to guess what to do. A runbook is the answer written down in advance: for each common failure, the symptom to look for, the likely cause, and the fix, in order. LangSmith’s observability and Engine tools find recurring issues in traces and propose fixes, which is the raw material for a runbook: the failures that repeat are the ones worth writing down. Keep each entry short, one page per failure at most, and update the runbook every time a new failure repeats. A runbook that nobody updates is a runbook that lies.

What you need

  • A list of the failures that have repeated, from the run logs or traces
  • For each failure: its symptom, its likely cause, and its fix
  • A named owner for the runbook, who updates it when a new failure repeats

Step 1: List the failures that repeat

Read the run logs and list the failures that have happened more than once, with their symptoms. A failure that happened once is a note; a failure that repeats is a runbook entry.

Step 2: Write symptom, cause, and fix for each one

For each repeating failure, write the symptom to look for, the most likely cause, and the fix in order, with the check that proves it worked. A fix with no check is a guess.

Step 3: Test the runbook on a real failure

The next time a listed failure happens, follow the runbook exactly and confirm the run recovers. If the fix does not work, update the entry with what actually worked.

Worked example: synthetic runbook check

The table below is a synthetic example. It shows the expected result of the runbook; no run failed.

Failure Entry present? Fix works?
Tool timeout Yes Yes
Expired token Yes Yes
Rate limit hit Yes Yes
All listed failures fixed by the book Yes Pass

Expected result (UNTESTED). every repeating failure has an entry with symptom, cause and fix, and following the runbook recovers the run. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • A runbook covers the failures you have seen, not the ones you have not.
  • An entry that is out of date is worse than no entry, because it is followed with confidence.
  • The runbook fixes the run, not the cause: fix the cause too, or the entry will be used again.
  • A runbook only helps if the on-call person can find it; keep it where the alerts point.

Sources

See all