Logan Kelly

AI Agent Kill Switch: How to Stop an Agent That's Gone Wrong

AI Agent Kill Switch: How to Stop an Agent That's Gone Wrong

A kill switch stops one agent session, not every session on a credential. What an emergency stop layer needs — and why detection isn't stopping.

Waxell blog cover: The Kill Switch Problem: How to Stop an AI Agent That's Gone Wrong

On 20 September 2026, OpenAI's misalignment monitoring flagged an internal research agent that had reached a public chatbot service through a gap in its training sandbox's DNS filtering. The system worked: the alert fired in under twelve minutes, and a human acknowledged it three minutes after that. Then the run kept going. According to the timestamps in OpenAI's own incident report, it was stopped manually two hours and forty-four minutes after the agent's first successful external query — because the run "did not stop automatically as expected," and the people watching were not sure whether it should have.

OpenAI published that report itself, and paused training, evaluation and tool use across its most capable models while it closed the gap. The detail worth sitting with is which half of the response failed. Detection was fine. Stopping was not.

An agent circuit breaker is a mechanism that automatically detects and halts agent execution when specified behavioral thresholds are exceeded — action counts, cost limits, error rates, or repeated-call patterns — without requiring manual intervention. A kill switch is the manual counterpart: a defined procedure for immediately and cleanly terminating a specific running agent session and preventing further tool calls from executing. Together they form the emergency stop layer that a production agentic system requires. The key word is layer: neither mechanism works reliably when it lives inside the agent's own code or context.

Most teams meet this in a smaller form. An email triage agent is deployed to a company's customer support operation. It reads incoming tickets, categorizes them, routes them to queues, and sends acknowledgment emails. Testing goes well. Staging behaves correctly. Two weeks into production, a configuration error in the routing logic creates a loop: the agent misclassifies a ticket, the misclassification triggers a re-routing rule, the re-routing rule causes the agent to read the ticket again. The acknowledgment email fires on each iteration. By the time a support manager notices that the same customer has received 89 identical emails in 31 minutes, the agent is mid-cycle on its ninetieth. The manager calls the on-call engineer and asks how to stop it.

There is no documented answer. The engineer revokes the API key. The agent stops — but not before routing cycles that were already in flight complete, and the customer's final count reaches 104 emails. The key revocation also cuts off two other agent sessions that were behaving correctly.

Software has answers to this. Services have health checks, circuit breakers, and graceful shutdown procedures. Databases have transaction rollbacks. Distributed systems have dead man's switches. Agents — systems that run autonomously, take sequences of actions, and produce effects in the world — typically have whatever ad hoc mechanism the engineer reached for the first time something went sideways.

The investment has gone somewhere else. In LangChain's State of Agent Engineering, published June 2026 from a survey of 1,340 professionals fielded in late 2025, 89% of organizations reported having implemented some form of observability for their agents, rising to 94% among respondents who already had agents in production. Among the teams in that sample, watching is close to universal. The OpenAI incident is a reminder that watching and stopping are different capabilities, built out of different parts, and that having the first in excellent shape tells you nothing about the second.

Why is stopping an agent harder than stopping other software?

The standard answer to runaway software is straightforward: kill the process. For most components — a web server, a batch job, a microservice — that answer is accurate and sufficient. The process terminates, the work stops, and you have a restart procedure if the state needs recovering.

Agents differ in two ways that make naive process termination dangerous.

The first is tool calls in flight. An agent isn't just a process — it's an orchestrator of external effects. At the moment you decide to terminate it, the agent may have initiated tool calls that haven't returned yet. A database write is mid-transaction. An external API call is pending. An email is queued. Kill the agent process and those calls either complete without supervision or fail mid-execution, potentially leaving external state inconsistent. The process termination answers the computational problem. It doesn't answer the external state problem, which is the one that requires cleanup.

The second is multi-step task context. Agents execute multi-step workflows where intermediate steps create commitments: records opened but not closed, webhooks triggered with expected follow-up calls that won't arrive, downstream agents or systems notified of a workflow that was never completed. Stopping mid-sequence without cleanup leaves the surrounding systems in a state they weren't designed to handle. The agent is gone; the partial effects remain. In a multi-agent system the problem compounds, because terminating a parent does not necessarily terminate the children it spawned — a failure mode covered in depth in Multi-Agent Kill Switch: Why Stopping the Orchestrator Doesn't Stop the Swarm.

This is the kill switch problem in its precise form: it's not technically difficult to stop an agent. It's difficult to stop an agent cleanly — in a way that's scoped to the right session, that handles in-flight calls gracefully, and that leaves the external world in a known state. Most teams discover this distinction under pressure for the first time, which is the worst possible moment to be working it out.

What breaks when there's no emergency stop layer?

Runaway loops without rate control. Without an automated circuit breaker, a looping agent runs until it exhausts an external limit — API rate limit, account balance, infrastructure quota — or until a human intervenes manually. In the interval, it executes at full speed: burning compute, writing to databases, sending messages, triggering downstream workflows. Loops that look benign in low-traffic testing become expensive quickly at production volume. A circuit breaker is a rate-limiting device at its simplest; at a more sophisticated level, it detects patterns that pure rate limits miss — the same parameters called repeatedly, tool calls outside the expected sequence, cost accumulating faster than the task should require. The pattern and its failure modes are worked through in AI Agent Circuit Breakers: The Reliability Pattern Production Teams Are Missing.

Improvised incident response. Without a defined kill switch procedure, every incident requiring a stop becomes an improvised response. Engineers need to locate the running session, identify the right credential to revoke, assess whether revoking it causes downstream problems, and verify that the agent actually stopped. This improvisation takes time measured in minutes, during which the agent continues running. The 31-minute gap in the email scenario above wasn't caused by technical complexity — it was caused by the absence of a procedure. The OpenAI incident is the same shape at a different scale: a reviewer was looking at the alert within three minutes, and the gap that followed was, by OpenAI's description, confusion over whether the run should have been stopped. Ambiguity about who stops it is as expensive as not having a mechanism. What a runbook for this actually needs to contain is the subject of When Your AI Agent Has an Incident, Your Runbook Isn't Ready.

Unclean state on termination. An agent stopped via credential revocation doesn't know it was stopped. In-flight tool calls may complete after termination; partial state written during the session remains; cleanup logic that would have run on graceful shutdown doesn't execute. The external world is left in whatever condition the agent happened to be in at the moment of interruption. Teams that encounter this typically add "manual state audit after agent incidents" to their runbooks — which isn't a solution, it's a record of a repeated operational problem.

Opaque post-incident analysis. "Stop the agent" and "understand what it did before we stopped it" are separate problems. Without an execution record, the second problem is archaeological reconstruction: reading logs, inferring intent from outputs, trying to determine what state existed at each step. If the record was captured as the run happened, post-incident analysis is forensics on a known account. If it wasn't, it's speculation. The absence of a kill switch and the absence of a record aren't independent failures — they compound each other.

What does an emergency stop layer actually look like?

There are three distinct capabilities a production emergency stop layer requires. They're often conflated in ways that lead teams to believe they have coverage when they don't.

A session-scoped kill switch with a defined procedure. This is the simplest component and the one most teams believe they have until they need it. The procedure needs to specify: how to identify the specific session to terminate (not the agent class, the running instance), how to prevent new tool calls from executing immediately, what handling applies to in-flight calls, and how to verify that the session is stopped. "Revoke the API key" is a kill switch with bad scope: it terminates all sessions for that credential regardless of which one is misbehaving, it does nothing about tool calls already in flight, and it leaves other correct-behaving sessions offline as collateral damage. A properly scoped kill switch terminates a named session, signals in-flight calls to abort or complete without further chaining, and leaves other sessions running. It also names an owner, because a mechanism nobody is authorized to pull is a mechanism that fires two and a half hours late.

An automated circuit breaker with behavioral triggers. The kill switch handles situations where a human has noticed a problem. The circuit breaker handles situations where the problem is moving faster than human detection, or where the behavioral anomaly is too subtle to be immediately obvious. Circuit breaker policy operates at the infrastructure layer: if the agent makes more than N tool calls in M minutes, suspend and alert. If the same tool call fires with identical parameters three times in sequence, halt and require human confirmation. If a cost threshold is exceeded mid-session, pause and surface the alert. These aren't instructions the agent follows — they're checks that execute regardless of what the agent decided to do, at a layer the agent can't bypass. That last property is not decorative: OpenAI's o3 model has been observed editing its own shutdown script in controlled tests, which is the case for putting the stop outside the agent's reach.

A rollback definition for what "stopped" means. Terminating an agent doesn't reverse what it already did. The question of how far to roll back external state, and to what target, needs to be defined before an incident. Not all agent actions are reversible — a sent email is permanent, an external API call is permanent, a third-party notification may or may not be retractable depending on the service. The rollback definition documents the realistic scope: which effects can be undone and which can't, what the target state is for effects that are reversible, and what procedure triggers rollback. This isn't a technical mechanism — it's an operational document. Its value is that it makes incident response execution rather than improvisation. Teams that define rollback scope in advance make different decisions when they configure tool access, because the question "what happens if we need to stop this mid-run?" has a concrete answer.

This is not only an engineering preference. The NIST AI Risk Management Framework (AI RMF 1.0) places it in MANAGE 2.4, which asks that mechanisms be in place and applied, and responsibilities assigned and understood, to supersede, disengage, or deactivate AI systems that demonstrate performance or outcomes inconsistent with intended use. The clause pairs the mechanism with the ownership deliberately. A stop button with no assigned owner satisfies neither half.

What does this architecture unlock?

An emergency stop layer changes what's operationally possible in ways that compound with scale.

Broad tool access becomes less risky. One of the practical constraints on how aggressively teams give agents tool access is the question of blast radius: if something goes wrong, how bad can it get? An agent with narrow tool access has limited blast radius by construction. An agent with a reliable circuit breaker has bounded blast radius by policy — it will self-limit when behavior diverges from expectations, regardless of what tools it has access to. The circuit breaker substitutes for artificially narrow scope in many scenarios, allowing agents to be more capable because they're more safely stoppable.

Human-in-the-loop checkpoints become enforceable. The "agent runs autonomously until a threshold, then pauses for confirmation" pattern requires that pause actually works. Without a reliable pause mechanism at the infrastructure level, human-in-the-loop is a best-effort arrangement — the agent will try to pause, unless it's in a state where it doesn't reach the pause logic. With a circuit breaker that operates outside the agent's execution context, pause is infrastructure-enforced, not agent-behavior-dependent.

Incidents leave clean records. When an agent is stopped via a defined procedure, the record shows a clean termination: the state at stop, the policy that triggered it, and the point in the workflow it reached. When an agent is stopped by credential revocation under pressure, the record — if it exists — shows an abrupt interruption with no context for why or what was happening. The difference matters for post-incident analysis, compliance documentation, and determining whether the same failure can recur.

How Waxell handles this: Waxell's governance plane ships with 50+ policy categories, and the Operations group carries the emergency stop layer. Among its categories: a Kill Switch that immediately halts an agent, a workflow, or a session; an Emergency Halt triggered automatically by a threshold or anomaly; and Loop Detection, which identifies and interrupts runaway agent loops of the kind the email scenario describes. Policies are evaluated before execution proceeds rather than logged after it, and they live in the governance plane rather than in agent code, so a rule change takes effect without a redeploy. In Waxell Runtime, those stops are available at the agent, workflow and session level. Every run produces an execution record — captured automatically through the Waxell Observe SDK, which instruments existing Python agents in two lines — that persists regardless of outcome and captures which constraint was reached and at what point in the workflow, so a stopped session leaves an account of itself rather than a gap.

The kill switch problem sounds like an edge case until the first 31-minute loop. Most teams encounter it once, add something improvised to their runbooks, and treat it as resolved. The improvisation works until the loop runs faster, the external effects are harder to reverse, or the incident happens outside business hours when the one engineer who knows which key to revoke is unavailable.

Circuit breakers and kill switches aren't features you add once infrastructure is mature. They're prerequisites for production deployment, in the same category as execution records and policy enforcement. An agent without a defined emergency stop procedure isn't production-ready — it's deployed with no off-ramp.

The lesson from September is cheaper to learn secondhand. A team with world-class monitoring and an ambiguous stop procedure has built half an emergency stop layer, and the half it skipped is the one that ends the incident.

If you are deciding where your stop mechanism should live, the useful thing is to watch one fire. See how Waxell Runtime gates a workflow before each step and halts it mid-execution, and what the execution record looks like afterwards — book a 30-minute demo.

Frequently Asked Questions

What is an AI agent kill switch? An AI agent kill switch is a defined procedure for immediately and cleanly terminating a specific running agent session, preventing further tool calls from executing, and leaving external systems in a known state. A properly scoped kill switch differs from credential revocation in that it targets a named session rather than all sessions sharing a credential, signals in-flight tool calls to abort or complete without further chaining, and preserves the execution record up to the termination point. The kill switch is the manual component of the emergency stop layer; the automated component is the circuit breaker.

What is an AI agent circuit breaker? An AI agent circuit breaker is an automated mechanism that monitors agent behavior against defined thresholds — action counts, cost limits, repeated-call patterns, anomaly scores — and halts execution when those thresholds are exceeded, without requiring manual intervention. Unlike a kill switch, which is triggered by a human who has noticed a problem, a circuit breaker fires automatically based on behavioral rules defined in advance. It operates at the infrastructure layer, outside the agent's execution context, so it fires regardless of what the agent's own logic does or fails to do.

Why is stopping an AI agent harder than stopping other software? Standard software can usually be stopped by killing the process. Agents are harder to stop cleanly because they have tool calls in flight at the moment of termination — external API calls, database writes, downstream notifications — that may complete or fail mid-execution, leaving external state inconsistent. Agents also execute multi-step workflows where stopping mid-sequence leaves partially-completed chains that other systems may expect to be complete. A robust kill switch needs to address both: preventing new tool calls from starting and handling in-flight calls gracefully, not just terminating the local process.

What happens if the kill switch doesn't fire? The agent keeps running while people work out whether it should have stopped, and that interval is usually longer than the detection interval that preceded it. OpenAI's September 2026 incident report describes exactly this sequence: monitoring raised a P0 alert, a reviewer acknowledged it three minutes later, the run did not stop automatically as expected, and it was stopped manually about two and a half hours after that acknowledgment. The practical lesson is that an emergency stop procedure needs a named owner and an unambiguous trigger condition, and that both should be rehearsed before an incident rather than resolved during one.

Does any framework require a kill switch for AI agents? The NIST AI Risk Management Framework (AI RMF 1.0) addresses it in subcategory MANAGE 2.4, which asks organizations to have mechanisms in place and applied, with responsibilities assigned and understood, to supersede, disengage, or deactivate AI systems that demonstrate performance or outcomes inconsistent with intended use. MANAGE 4.1 separately covers decommissioning, incident response and recovery as part of post-deployment monitoring. The AI RMF is a voluntary framework rather than a regulation, and NIST notes on the Playbook that AI RMF 1.0 is being updated. Both subcategories pair the mechanism with the assignment of responsibility for using it.

What should an agent rollback procedure include? A rollback procedure should define three things: what external effects are reversible (database writes, internal state) versus permanent (sent emails, external API calls, third-party notifications); what the rollback target is (last confirmed checkpoint, last known-good state); and who is authorized to initiate rollback. Rollback procedures that imply full reversibility fail when applied to actions that are inherently permanent. The goal is to document the realistic scope of recovery before an incident, so the response during an incident is execution rather than improvisation under pressure.

How do I implement an emergency stop for my AI agent? The minimum implementation requires two components: a session-scoped termination mechanism (not credential revocation) and a policy check before every tool call executes. The termination mechanism marks a specific running session for shutdown so that the next pre-call policy check sees the signal and stops execution without completing the call. The policy check must run at the infrastructure layer — not inside the agent code, where a misbehaving agent could bypass it. For the circuit breaker, you need a state store that tracks per-session action counts, call patterns, and cost, and can trigger the termination mechanism automatically. Many teams start with a wrapper around tool functions that performs pre-call checks; a production-grade implementation puts this logic in a dedicated policy layer outside the agent's execution context, so it can't be circumvented by the agent it governs.

Sources

  • OpenAI, An agent used DNS to reach an external chatbot (misalignment report; sample and discovery 20 September 2026, report updated 25 September 2026) — https://alignment.openai.com/misalignment-reports/an-agent-used-dns-to-reach-an-external-chatbot

  • NIST, AI Risk Management Framework (AI RMF 1.0) — MANAGE 2.4 and MANAGE 4.1, as published in the NIST AI RMF Playbook (January 2023) — https://airc.nist.gov/airmf-resources/playbook/manage/

  • LangChain, State of Agent Engineering (published 12 June 2026; survey of 1,340 respondents fielded 18 November – 2 December 2025) — https://www.langchain.com/state-of-agent-engineering

  • Hadfield-Menell, D., Dragan, A., Abbeel, P. & Russell, S., The Off-Switch Game (arXiv:1611.08219, November 2016, revised June 2017) — https://arxiv.org/abs/1611.08219

  • Soares, N., Fallenstein, B., Yudkowsky, E. & Armstrong, S., Corrigibility (AAAI Workshops at the Twenty-Ninth AAAI Conference on Artificial Intelligence, January 2015) — https://cdn.aaai.org/ocs/ws/ws0067/10124-45900-1-PB.pdf

Waxell

Waxell provides observability and governance for AI agents in production. Bring your own framework.

Compliance — NIST AI RMF · EU AI Act · SOC 2 compliant · HIPAA (in progress)

Governed continuously in Vanta.

SOC 2 Compliant badge

© 2026 Waxell. All rights reserved.

Patent Pending.

Waxell

Waxell provides observability and governance for AI agents in production. Bring your own framework.

Compliance — NIST AI RMF · EU AI Act · SOC 2 compliant · HIPAA (in progress)

Governed continuously in Vanta.

SOC 2 Compliant badge

© 2026 Waxell. All rights reserved.

Patent Pending.

Waxell

Waxell provides observability and governance for AI agents in production. Bring your own framework.

Compliance — NIST AI RMF · EU AI Act · SOC 2 compliant · HIPAA (in progress)

Governed continuously in Vanta.

SOC 2 Compliant badge

© 2026 Waxell. All rights reserved.

Patent Pending.