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.

BeginnerIntermediateExpert · 12 min read · Last updated:

In short

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.

Versions used

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.

Beginner Roles and severity

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.

LevelExampleResponse
SEV1Money moved wrongly, personal data exposed, unsafe action continuingImmediately, with lead and specialists
SEV2Major function broken or spend far above planUrgently, with an owner
SEV3Lower quality with a workaroundPlanned 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.

RoleDuty
Incident leadDecides, assigns and keeps the timeline moving
Technical respondersContain, investigate and repair
CommunicatorUpdates users, managers and partners
RecorderLogs actions, times and evidence
Privacy, security, legalAssess duties and risk
Business ownerRuns 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

1. Detectalert or report
2. Triageseverity and lead
3. Containstop further harm
4. Investigateevidence, scope and cause
5. Recoverrepair and restore in steps
6. Learnreview, controls and tests
  1. Declare the incident, set a severity and name the lead.
  2. Stop continuing harm with the smallest reliable control.
  3. Preserve traces, logs, state, versions and memory before they expire or change.
  4. Scope: which runs, users, records, actions and time window?
  5. Communicate what is known, unknown and next, with the time of the next update.
  6. Find the cause without delaying containment.
  7. Repair data and effects, with checks and a record.
  8. Return gradually, with watch conditions and a stop rule.
  9. Review and assign follow-up work with dates.

Containment options

ControlUse whenWatch for
Disable one toolA specific action is wrongQueued calls still pending
Require approvalActions are needed but suspectReviewer capacity
Read-only modeAny write could add harmHidden writes such as memory
Pause the queueWork is accumulating damageDeadlines and tasks in progress
Roll backA release caused itState compatibility
Revoke credentialsAccess may be misusedOther services sharing them
Quarantine data or memoryContent is poisoned or wrongCopies, caches and summaries
Turn the agent offScope is unknown and risk is highManual fallback must start
Build switches in advance

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.

Intermediate Triage and evidence

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.

MinuteAction
0Alert: more refunds than orders for several customers
3On-call declares SEV1, takes the lead and opens a log
5Refund tool disabled; a test confirms calls are now rejected
8Queued refund tasks paused; traces and queue copied to restricted storage
12Business owner starts the manual refund process
15First update sent; privacy, legal and finance informed
25Affected refunds listed from system records
35Recent release linked to a new retry path; rolled back
45Second update; reconciliation owner named
60Review 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 modeWarning signsFirst containmentLasting control
Duplicate actionRepeated records or messagesDisable the write toolIdempotency keys and verification
Wrong targetComplaints; mismatched IDsRequire approvalResolve and confirm identifiers in code
False successClaim without a matching recordStop automated confirmationsGenerate status from results
Prompt injectionUnexpected tool use after reading contentBlock outbound and write toolsLeast privilege and policy checks
Data exposureOther users' data appearsDisable the access pathPermission filtering at source
Poisoned memoryOdd behavior persists across sessionsQuarantine memoryWrite validation and provenance
Runaway loopSteps and spend climbPause and capProgress checks and budgets
Stale knowledgeAnswers follow retired policyRemove or filter sourcesFreshness checks
Silent quality dropReopens, edits and complaints riseRoll back or add reviewCanary set and sampling
Provider outageErrors and timeoutsFallback or manual pathTested alternatives
Approval bypassEffects without approval recordsTurn off the actionEnforce approval at execution
Agent-to-agent cascadeOne bad result spreadsBreak the handoffValidation 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).

Expert Recovery and practice

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

  1. Reproduce the failure safely and confirm the fix against it.
  2. Run safety, recovery and regression gates.
  3. Reconcile affected records and decide what to do for affected people.
  4. Handle queued and half-finished tasks deliberately; do not simply restart them.
  5. Restore in stages, with extra review and clear stop conditions.
  6. 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.

DrillPlanted problemPass when the team can
Double chargeRetry without an idempotency keyStop writes, list affected orders, repair
Hostile pageHarmless test instruction in a documentTrace the effect and name the missing control
Spend spikeTool that always returns "try again"Cap spend and find the loop
Wrong answersRetired document back in the indexTrace the source and remove it
Quiet regressionChanged tool descriptionIsolate the change and roll back
Lost approverNo reply to a pending approvalExpire 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

PrepareTest it by
On-call contacts and escalationSending a test page
Kill switches and rollbackUsing them in a rehearsal
Access to traces and recordsLetting a new responder find a run
Message templatesDrafting an update during a drill
Manual fallbackHaving staff process a sample case
Notification decision pathWalking 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

MeasureQuestion it answers
Time to detectHow long did harm continue unnoticed?
Time to containHow quickly could the team stop further harm?
Time to recoverWhen was verified normal service restored?
Who detected itMonitoring, staff or a customer?
Repeat incidentsDid an earlier action fail to prevent this?
Actions completedAre 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

MistakeBetter approach
Debugging while harm continuesContain first
Deleting bad data immediatelyPreserve a restricted copy, then correct
Several people issuing changesOne lead coordinates actions
Restarting all queued tasksCheck effects and replay safely
Asking the agent what happened and believing itUse traces and system records
Review actions with no ownerAssign 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

Next steps