Design a kill switch for a production agent fleet
You run 200 customer support agents in production, each capable of issuing refunds. A red team report shows a viable injection chain. You have one hour to deploy a kill switch that suspends refund authority without taking the agents offline. Sketch the design.
A real kill switch is a per-tool config flag checked in the orchestrator at dispatch time, not a code deploy; flip, propagate in seconds, keep agents online.
Picture a busy kitchen where every cook can use any tool. One day someone notices the can opener has a sharp edge that is hurting people. You do not shut down the whole kitchen. You do not redesign the can opener overnight. You put a little sign on the can opener that says do not use, and you tell every cook to look at the sign before grabbing the tool. The cooks keep cooking the rest of the meal. When a customer orders something that needs a can, the kitchen sends a polite note saying that dish needs a manager to approve. That sign is the kill switch. The cooks stay working, only one tool is paused, and pulling the sign down restores normal service in seconds.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
A kill switch is the single most-asked question in any agent incident post-mortem: 'when the red team found the exploit, how fast could we have stopped it?' The honest answer for most teams is hours, because the incident-response surface is the same code-deploy surface they use for any change. Hours is too slow. The exploit chain has been running, customers have been refunded, money has moved. A kill switch shortens that window from hours to seconds, but only if it is designed as a runtime, per-capability, dispatch-enforced toggle rather than a code change.
This walkthrough lays out what a real kill switch looks like in 2026 production agent stacks: where the enforcement check belongs, how the config propagates, what the disabled-call response should look like to the agent, what to log, and how to test the switch before you need it.
Mental model: a kill switch is not a button on a wall. It is a small data field your orchestrator reads on every tool call. The button is just a UI on top of that field.
The three properties of a real kill switch
Runtime-flippable
The switch must change behaviour without a code deploy. Deploys take minutes to hours depending on your release process, plus rollback risk, plus possible config drift. Incidents do not wait. The switch surface is a config service the orchestrator polls or subscribes to: LaunchDarkly, Statsig, ConfigCat, etcd, Consul, or an in-house KV with pub-sub.
Per-capability
The switch acts on a single tool or capability, not the whole agent. Killing the refund tool should not stop the agent from handling password resets or answering FAQs. The unit of control is the entry in your tool registry. Some teams add an extra dimension: enabled_for_tenants (kill refunds only for the affected merchant) or blast_radius_tier (auto-disable all tier-3 tools if a circuit-breaker fires).
Dispatch-enforced
The orchestrator's tool dispatcher checks the flag on every call. Not at agent startup. Not in the model's system prompt. Every. Call. This is what makes the propagation real-time and what keeps the model from being jailbroken into ignoring the kill switch,the model never knew about it in the first place; the rail runs outside the model loop.
If any of these three properties is missing, you do not have a kill switch. You have wishful thinking.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- LaunchDarkly and Statsig are the two flag platforms most LLM-product teams use for per-tool kill switches in 2026.
- Anthropic's Claude tool-use docs recommend gating each declared tool through an orchestrator-side allowlist that can be flipped at runtime.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you keep the kill switch itself from being a single point of failure?
Multi-region flag replicas; default-deny on stale fetches for high blast radius tools; cached last-good config on each agent process; flag mirror in a second provider for the highest-risk capabilities.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Designing the kill switch as a code redeploy or a system-prompt edit. Both are too slow and too coarse; the right surface is per-tool config the dispatcher reads at runtime.
60 second bullets to scan on the way to the call.
The three properties of a real kill switch (runtime, per-capability, dispatch-enforced)
Where the enforcement check lives in the orchestrator
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.