Agent Operations

AI Agent Incident Response: Kill Switches, Rollback, and Recovery

Design AI agent incident response with enforced kill switches, scoped containment, evidence preservation, effect reconciliation, and staged recovery.

· · 8 min read

Prepared with AI research assistance. Sources are linked throughout; worked examples are illustrative unless stated otherwise. Editorial approach.

An AI agent incident begins when automated behavior breaches an operational boundary: unauthorized actions, repeated incorrect changes, unexpected spending, or exposure of information. Response must address both the running computation and the external effects it may already have produced. Restarting a worker can stop one process while leaving queued jobs, credentials, browser sessions, and remote operations active.

This guide proposes an incident design for a hypothetical customer-support agent. Its controls and example thresholds are illustrative engineering choices, not a tested reference implementation or a claim that a particular platform supplies them automatically.

Define incidents by impact and authority

A rising model-error rate is useful telemetry, but severity should reflect consequences. A hundred rejected drafts and one unauthorized refund are different incidents even if both appear as failed runs. Define triggers for policy violations, cross-tenant access, duplicate mutations, sustained failure of task outcomes, and resource exhaustion. Include a way for a person to declare an incident when automated thresholds miss the problem.

Google's incident-response framework separates coordination from technical mitigation, with an incident commander, operations lead, and communications lead. It emphasizes clear ownership and a working record of the response. These roles can be combined in a small team, provided the responsibilities remain explicit. Google SRE Workbook: Incident Response.

For the support-agent example, the operations lead owns containment and evidence collection. The incident commander decides scope and recovery conditions. The communications owner tracks what customers and internal teams have been told. The agent under investigation should not have authority to reopen its own access or rewrite the incident record.

Build a kill switch at enforcement boundaries

A dashboard button is only an interface. Its effectiveness depends on where the decision is enforced. In the proposed architecture, a control record identifies a scope, mode, policy revision, operator, reason, and activation time. Scope may be one run, one workflow version, one tenant, or the entire agent service.

Use explicit modes rather than an ambiguous Boolean:

Mode New work Existing runs Mutation tools
Normal Admit Continue within limits Existing policy
Read-only Admit eligible read tasks Stop before mutation Deny
Quarantined Reject or hold affected work Pause at safe boundaries Deny
Emergency stop Reject affected work Cancel and isolate where possible Deny and revoke affected grants

The tool gateway must check the current policy immediately before executing a mutation. Checking only when a run starts leaves long-running workers with stale authority. The scheduler must also prevent queued tasks from resurrecting the stopped workflow. Background webhooks, delayed messages, and retry workers need the same scope policy.

A policy revision can act as a fencing value: execution requests carry the revision under which they were authorized, and the gateway rejects obsolete revisions. This is a proposed design, not a universal distributed guarantee. If a request already crossed the final enforcement boundary, a later switch cannot retroactively prevent its effect. Record that uncertainty for reconciliation.

Stop credentials, queues, and execution separately

Containment is a collection of controls with different propagation behavior. Cancel active model requests to reduce unnecessary computation, suspend affected queue consumption, block tool capabilities, and revoke or rotate compromised credentials. Isolate a browser or code-execution session when it can continue acting independently of the orchestration worker.

OAuth token revocation has deployment-specific limitations. RFC 7009 defines revocation behavior while acknowledging propagation delays and explaining that immediate revocation of self-contained access tokens requires supporting interactions or another appropriate design. A successful revocation response should not be interpreted as proof that every resource server has already rejected every outstanding request. RFC 7009: OAuth 2.0 Token Revocation.

Test denial at the actual resource boundary. A control-plane flag reading “disabled” is weaker evidence than a denied request using a previously valid agent grant. Avoid putting raw tokens into incident documents; preserve credential identifiers and relevant authorization metadata instead.

Containment should retain a human-operated recovery path. If the same failing agent is the only route to the control plane, the switch is operationally fragile. Conversely, access to the switch must be authenticated and audited because an accidental global stop can itself cause an outage.

Preserve an evidence packet before changing state

Once immediate harm is contained, capture enough information to reconstruct the run. Useful identifiers include the run and tenant, workflow and prompt versions, model identifier, tool schema version, policy revision, checkpoint references, retrieved-document versions, and operation identities. Record timestamps and the order in which evidence was observed; distributed timestamps alone may not establish causality.

Separate observed facts from hypotheses. “Gateway accepted action X under policy revision 18” is evidence. “The model ignored instructions” is a hypothesis until the trace and enforcement behavior support it. A tool could have returned an incorrect status, a retry worker could have duplicated the request, or an approval could have applied to an outdated proposal.

Preserve originals with access controls rather than copying sensitive transcripts into a broadly visible chat. If retention restrictions prevent keeping a payload, record its permitted metadata and the resulting investigation limit. Agent observability and tracing describes how production traces can support diagnosis without making every prompt a permanent log entry.

Distinguish rollback from recovery of external effects

Rolling back a prompt, model route, or workflow release changes future execution. It does not reverse an email already sent or a refund already submitted. Keep a ledger of affected operations with states such as confirmed applied, confirmed not applied, and outcome unknown. Resolve uncertainty through authoritative service records and stable action identifiers.

Checkpoint recovery also needs care. LangGraph documents that replay from a previous checkpoint re-executes subsequent nodes, including model calls, API requests, and interrupts, which can return different results. Forking creates a new branch; it does not erase the original execution history. Therefore, replaying a saved state is not equivalent to undoing business effects. LangGraph: Use time-travel.

For the hypothetical support agent, recovery runs should initially have mutations disabled. Read authoritative order and refund state, compare it with the operation ledger, and produce a reconciliation plan. Apply reversals only where the downstream service supports them and the responsible person authorizes them. Some effects require compensation or customer communication rather than a technical undo. See compensating transactions for agent workflows.

Walk through an unauthorized-refund incident

Assume a new workflow release interprets a support-note field as authorization. A monitoring rule detects a refund whose recorded approval identity is missing. The example is fictional; no actual customer or performance measurement is implied.

First, the responder quarantines the affected workflow version and denies its refund capability at the gateway. Other read-only support tasks continue if their isolation has been established. Suspending only new conversations would be insufficient because existing runs and queued retries could still issue refunds.

Second, the operations lead lists all refund operations from that version, including pending and unknown results. A timed-out request remains unresolved until the payment service confirms whether it committed. Retrying with a fresh identity could create another refund.

Third, the team rolls the workflow back and repairs the missing server-side approval check. It does not assume the previous prompt alone constitutes a sufficient fix. The failed boundary was allowing a mutable note to confer authority.

Fourth, responders reconcile each operation, document customer impact, and arrange supported compensation or communication. Any resumed run receives current permissions and fresh approval requirements. A checkpoint containing an old approval is not accepted simply because it once passed validation.

Reopen traffic with evidence and rehearse the controls

Recovery criteria should be concrete: affected actions reconciled or explicitly assigned, the offending capability blocked until its check passes, regression cases added, and a limited rollout showing acceptable task outcomes. Reopen a bounded cohort before restoring broad autonomy. Monitor policy violations and external effects, not only whether requests return successfully.

Google's emergency-response discussion describes weaknesses exposed by untested rollback procedures and stresses hands-on preparation. For an agent service, rehearsal should exercise the entire control path, including queue consumers and resource servers. Google SRE: Emergency Response.

A useful exercise disables one workflow during a delayed mutation, then attempts a stale retry and a delayed webhook. Inspect whether the gateway denies new effects, whether legitimate unrelated work continues, and whether operators can identify the already committed action. Measure containment propagation under those conditions rather than inventing an aspirational response time.

Finally, write a postmortem with impact, contributing conditions, detection gaps, mitigation, and assigned follow-up actions. Google's blameless approach focuses on improving systems rather than blaming individual responders. An agent incident should similarly identify which missing constraint, misleading tool contract, or weak rollout process allowed the failure. Google SRE: Postmortem Culture.

Frequently asked questions

Is stopping the model enough to stop an agent?

No. Queued jobs, tool requests, browser sessions, and delegated workers may continue independently. Enforce containment at the scheduler, tool gateway, identity layer, and relevant execution environment.

Can a checkpoint restore the system to a safe state?

It can restore or branch workflow state according to the framework's semantics. External effects require separate reconciliation, and resumed execution needs current authorization and compatibility checks.

Should every incident trigger a global shutdown?

Use the smallest scope whose isolation you can demonstrate. Broader containment is justified when scope is uncertain or shared capabilities could spread harm. Preserve the reason, evidence, and authority behind that decision.

Source reference list

AI Agents
Incident Response
Agent Operations
Reliability