Incident Runbook and Failure Mode Catalog
When an agent misbehaves, nobody should be inventing the plan. Write it down, keep it short and rehearse it.
Declare early, give the incident one lead, contain by disabling actions or rolling back, preserve evidence, find who and what was affected, communicate on a schedule, recover in steps and turn the lessons into controls and tests. Use a failure mode catalog to recognize problems quickly.
What you will learn: an agent incident runbook, severity levels, containment options, a catalog of failure modes, communication, review and debugging drills.
Prerequisites: Loops, Performance, Incidents and Maturity and Risk Tiers, Approvals and Human Oversight.
The example runs in November 2026 with Python 3.13 and only the standard library. Its severity rules are illustrative. Legal and regulatory notification duties depend on your situation, so obtain qualified advice; this is general information, not legal advice.
What counts as an incident
An incident is an event that harms, or could soon harm, people, data, money, systems or trust and needs a coordinated response. Agents add cases that ordinary monitoring may miss: wrong actions performed correctly, confident false answers, policy breaches and runaway spending while every service reports healthy.
| Level | Example | Response |
|---|---|---|
| SEV1 | Money moved wrongly, personal data exposed, unsafe action continuing | Immediately, with lead and specialists |
| SEV2 | Major function broken or spend far above plan | Urgently, with an owner |
| SEV3 | Lower quality with a workaround | Planned ticket and follow-up |
Define your own levels with examples before you need them. When unsure, choose the higher level; it is easy to downgrade.
| Role | Duty |
|---|---|
| Incident lead | Decides, assigns and keeps the timeline moving |
| Technical responders | Contain, investigate and repair |
| Communicator | Updates users, managers and partners |
| Recorder | Logs actions, times and evidence |
| Privacy, security, legal | Assess duties and risk |
| Business owner | Runs the fallback process and accepts return to service |
In a small team one person may hold several roles, but someone must clearly be in charge.
The runbook
- Declare the incident, set a severity and name the lead.
- Stop continuing harm with the smallest reliable control.
- Preserve traces, logs, state, versions and memory before they expire or change.
- Scope: which runs, users, records, actions and time window?
- Communicate what is known, unknown and next, with the time of the next update.
- Find the cause without delaying containment.
- Repair data and effects, with checks and a record.
- Return gradually, with watch conditions and a stop rule.
- Review and assign follow-up work with dates.
Containment options
| Control | Use when | Watch for |
|---|---|---|
| Disable one tool | A specific action is wrong | Queued calls still pending |
| Require approval | Actions are needed but suspect | Reviewer capacity |
| Read-only mode | Any write could add harm | Hidden writes such as memory |
| Pause the queue | Work is accumulating damage | Deadlines and tasks in progress |
| Roll back | A release caused it | State compatibility |
| Revoke credentials | Access may be misused | Other services sharing them |
| Quarantine data or memory | Content is poisoned or wrong | Copies, caches and summaries |
| Turn the agent off | Scope is unknown and risk is high | Manual fallback must start |
Each control should be a tested setting that on-call staff can use quickly, with its own access control and audit record. See Action Guardrails and Policy Engines.
Make first actions automatic
Simple rules help a responder at night. They suggest a starting point and never replace judgment.
"""Turn incident facts into a severity and first steps (illustrative rules)."""
CONTAIN = {
"wrong_action": "disable the affected write tool",
"data_exposure": "cut the route that sends data out",
"runaway_cost": "lower the budget cap and pause the queue",
"bad_answers": "roll back to the last good release",
"outage": "switch to the fallback or the manual process",
}
def severity(incident):
if incident["kind"] == "data_exposure":
return 1
if incident["kind"] == "wrong_action" and not incident["reversible"]:
return 1
if incident["still_happening"] and incident["people_affected"] > 10:
return 2
return 3
def plan(incident):
level = severity(incident)
steps = []
if incident["still_happening"]:
steps.append(CONTAIN[incident["kind"]])
steps.append("preserve traces, versions and logs")
if level == 1:
steps.append("page the incident lead and the privacy or legal contact")
elif level == 2:
steps.append("page the incident lead")
else:
steps.append("open a ticket for the owning team")
steps.append("list who and what was affected")
return level, steps
INCIDENTS = [
{"name": "refunds sent twice", "kind": "wrong_action", "reversible": False,
"still_happening": True, "people_affected": 6},
{"name": "spend tripled overnight", "kind": "runaway_cost", "reversible": True,
"still_happening": True, "people_affected": 40},
{"name": "yesterday's summaries were poor", "kind": "bad_answers", "reversible": True,
"still_happening": False, "people_affected": 25},
]
if __name__ == "__main__":
for incident in INCIDENTS:
level, steps = plan(incident)
print(f"SEV{level} {incident['name']}")
for number, step in enumerate(steps, 1):
print(f" {number}. {step}")
Output:
SEV1 refunds sent twice
1. disable the affected write tool
2. preserve traces, versions and logs
3. page the incident lead and the privacy or legal contact
4. list who and what was affected
SEV2 spend tripled overnight
1. lower the budget cap and pause the queue
2. preserve traces, versions and logs
3. page the incident lead
4. list who and what was affected
SEV3 yesterday's summaries were poor
1. preserve traces, versions and logs
2. open a ticket for the owning team
3. list who and what was affected
The three signals lead to different severity and containment, while evidence preservation comes before repair in every case. Adapt the rules to your systems, test them in drills and let the lead override them with a recorded reason.
An illustrative first hour
Times are examples to show order and rhythm, not targets for your service.
| Minute | Action |
|---|---|
| 0 | Alert: more refunds than orders for several customers |
| 3 | On-call declares SEV1, takes the lead and opens a log |
| 5 | Refund tool disabled; a test confirms calls are now rejected |
| 8 | Queued refund tasks paused; traces and queue copied to restricted storage |
| 12 | Business owner starts the manual refund process |
| 15 | First update sent; privacy, legal and finance informed |
| 25 | Affected refunds listed from system records |
| 35 | Recent release linked to a new retry path; rolled back |
| 45 | Second update; reconciliation owner named |
| 60 | Review of containment; next checkpoint and handover agreed |
Two habits stand out: containment is verified instead of assumed, and the list of affected items comes from the system of record, not from the agent's own account.
Failure mode catalog
| Failure mode | Warning signs | First containment | Lasting control |
|---|---|---|---|
| Duplicate action | Repeated records or messages | Disable the write tool | Idempotency keys and verification |
| Wrong target | Complaints; mismatched IDs | Require approval | Resolve and confirm identifiers in code |
| False success | Claim without a matching record | Stop automated confirmations | Generate status from results |
| Prompt injection | Unexpected tool use after reading content | Block outbound and write tools | Least privilege and policy checks |
| Data exposure | Other users' data appears | Disable the access path | Permission filtering at source |
| Poisoned memory | Odd behavior persists across sessions | Quarantine memory | Write validation and provenance |
| Runaway loop | Steps and spend climb | Pause and cap | Progress checks and budgets |
| Stale knowledge | Answers follow retired policy | Remove or filter sources | Freshness checks |
| Silent quality drop | Reopens, edits and complaints rise | Roll back or add review | Canary set and sampling |
| Provider outage | Errors and timeouts | Fallback or manual path | Tested alternatives |
| Approval bypass | Effects without approval records | Turn off the action | Enforce approval at execution |
| Agent-to-agent cascade | One bad result spreads | Break the handoff | Validation and limits between agents |
Keep the catalog alive. After each incident, add or sharpen an entry, link the test that covers it and name its owner. The OWASP GenAI Security Project and MITRE ATLAS are useful prompts for security entries.
Preserve evidence
- Copy relevant traces, logs and queue contents to restricted storage.
- Snapshot state and memory before editing.
- Record versions of model, prompts, tools, policies and data.
- Note times with time zones and who did what.
- Limit access and respect privacy; keep only what the investigation needs.
- Follow legal advice on holds and notifications.
Pause automatic deletion for the affected records where your obligations permit, and document that decision (Safe Logging, Sampling and Retention).
Communicate plainly
Incident: refund agent, SEV1
Status: contained; refund tool disabled at 14:05 UTC
Impact: duplicate refunds suspected; counting affected orders
Users: refunds are handled by staff until further notice
Unknown: cause; full scope
Next: update at 14:45 UTC; lead: on-call owner
State facts, label guesses, avoid blame and keep the promised update time even when nothing has changed.
Recover and verify
- Reproduce the failure safely and confirm the fix against it.
- Run safety, recovery and regression gates.
- Reconcile affected records and decide what to do for affected people.
- Handle queued and half-finished tasks deliberately; do not simply restart them.
- Restore in stages, with extra review and clear stop conditions.
- Close only when the business owner agrees and monitoring is quiet for an agreed period.
Review without blame
Ask how the system let the event happen: which control was missing, why detection took the time it did and what made response harder. Write a timeline, contributing causes, what went well and actions with owners and dates. "The model made a mistake" is not a root cause; ask why that mistake could reach the outcome.
Questions the traces must answer
Test your telemetry against these questions before an incident. Each unanswered one is work to do now.
- Which runs used this tool, version or document between two times?
- Who requested each run, and under which permissions?
- What arguments were sent, and what did the tool report?
- Which approvals existed, who gave them and what did they see?
- Which memories were read or written, and where did they come from?
- Which other agents or services received the output?
Hand over cleanly
Long incidents outlast one person. A handover states the current severity and status, containment in place, open questions, actions in progress with owners, promised update times and anything that must not be switched back on. The new lead confirms aloud or in writing that they now hold the role, and the change is recorded in the timeline.
Production debugging drills
Practice in a safe environment with synthetic data. Time each drill and note missing access or instructions.
| Drill | Planted problem | Pass when the team can |
|---|---|---|
| Double charge | Retry without an idempotency key | Stop writes, list affected orders, repair |
| Hostile page | Harmless test instruction in a document | Trace the effect and name the missing control |
| Spend spike | Tool that always returns "try again" | Cap spend and find the loop |
| Wrong answers | Retired document back in the index | Trace the source and remove it |
| Quiet regression | Changed tool description | Isolate the change and roll back |
| Lost approver | No reply to a pending approval | Expire safely and escalate |
Rotate roles so that response does not depend on one expert. After each drill, change the runbook, a switch, an alert or a test; a drill that changes nothing was probably too easy.
Start small if you have nothing yet
A first runbook can be one page: who leads, how to disable each action, where traces are, who must be told and how staff continue the work by hand. Rehearse that page once, fix what failed and expand it from there. A short plan that people have used is worth more than a long one that nobody has opened.
Readiness before the first incident
| Prepare | Test it by |
|---|---|
| On-call contacts and escalation | Sending a test page |
| Kill switches and rollback | Using them in a rehearsal |
| Access to traces and records | Letting a new responder find a run |
| Message templates | Drafting an update during a drill |
| Manual fallback | Having staff process a sample case |
| Notification decision path | Walking through it with privacy and legal advisers |
Keep the runbook where it can be read when your main systems are down, and review it after changes in tools, owners or regulations.
Measure the response
| Measure | Question it answers |
|---|---|
| Time to detect | How long did harm continue unnoticed? |
| Time to contain | How quickly could the team stop further harm? |
| Time to recover | When was verified normal service restored? |
| Who detected it | Monitoring, staff or a customer? |
| Repeat incidents | Did an earlier action fail to prevent this? |
| Actions completed | Are review follow-ups done on time? |
With few incidents, averages mislead, so read individual timelines. Avoid targets that reward closing quickly or declaring less often; the aim is less harm and honest records. Share a short, privacy-safe summary with other teams that run agents, because the same missing control is often absent elsewhere. Add the incident's case to the evaluation set before closing, and note which release gate will now catch it.
Common mistakes
| Mistake | Better approach |
|---|---|
| Debugging while harm continues | Contain first |
| Deleting bad data immediately | Preserve a restricted copy, then correct |
| Several people issuing changes | One lead coordinates actions |
| Restarting all queued tasks | Check effects and replay safely |
| Asking the agent what happened and believing it | Use traces and system records |
| Review actions with no owner | Assign dates and check completion |
Incident readiness checklist
- Severity levels have examples and response expectations.
- Roles and backups are named.
- Containment controls are built and tested.
- Evidence capture is quick and access controlled.
- Affected users and records can be identified from traces.
- Communication and notification paths are agreed.
- The failure catalog links to tests and owners.
- Drills happen on a schedule and lead to changes.
Frequently asked questions
Should a wrong answer be treated as an incident?
It depends on harm and reach; one trivial error is a defect, while repeated or consequential wrong answers may need incident response.
Who can turn the agent off?
Name that authority in advance and make sure on-call staff can contain harm without waiting for a meeting.
When must incidents be reported outside the organization?
Duties vary by law, contract, sector and facts, so involve privacy and legal specialists early because some deadlines are short.
How often should we run drills?
Set a regular schedule that your team can keep and add one after major changes or real incidents.
References and further reading
- Google SRE Book: managing incidents: roles and coordination.
- Google SRE Book: postmortem culture: blameless review.
- NIST SP 800-61 Rev. 3: incident response recommendations.
- OWASP GenAI Security Project: risks and response resources.
Next steps
Loops, Performance, Incidents and Maturity
Build run guards, alerts and root cause practice.
Red Teaming and Incident Response
Handle security incidents.
Chaos, Recovery Testing and Release Gates
Rehearse failures before release.