If you run an LLM agent in production, here is a checklist for the day you have to turn it off: feature flag, fallback queue, circuit breakers, in-flight work, drills. Every AI agent that runs in production will have to be stopped at some point. The model provider has an outage. A model update changes behaviour in a way the eval set did not catch. Someone finds a prompt injection path. A loop starts calling tools at night and the bill grows by the hour. None of this is exotic, and none of it is under your control.
Most teams can say how to stop the agent: roll back, scale to zero, revoke the API key. Few can answer the question that matters: what happens to the work while the agent is off? If the honest answer is "nothing gets done", the project did not ship a feature. It shipped a dependency on a system nobody can safely.
A switch outside the model and outside the release. A flag per task and, where it makes sense, per tenant, that operations can flip in seconds, without a deploy and without the development team on call. Rolling back a release is not a switch: it is slow, and it takes everything else with it.
A fallback path. When the agent is off, the work goes back to people: a queue with an owner, holding the same inputs the agent would have seen. Often the fallback is simply the procedure that existed before the agent. Keep it alive and documented, even if nobody uses it for months.
Automatic breakers. Some stops should not wait for a human. A circuit breaker on provider errors and timeouts. A ceiling on spend per time window. Thresholds on quality signals you already collect, such as a sudden rise in abstentions or in proposals rejected by users. When a breaker trips, the system moves to the fallback path on its own and someone is notified.
A rule for work in flight. Stopping new work is easy. The hard part is the case that is half done: a record updated, a message not yet sent. Steps need to be idempotent, and the switch needs a defined behaviour: stop accepting new tasks, then finish or park what is in progress in a state someone can resume. Never leave a step half written.
A drill. A switch that has never been used does not work. Test it in staging with every release and in production on a schedule, during working hours. Log every flip: who, when, why, and when the agent was turned back on. That log belongs next to the decision ledger, because it explains the gaps in it.
The off switch looks like an operations detail, but it shapes the design. It forces the agent to sit behind a clear task boundary, with structured inputs that a person can also process. It forces idempotent steps. It forces the team to keep the manual path alive. A system built this way is easier to test and easier to hand over, and it degrades instead of failing.
For high-risk systems, the EU AI Act makes the point explicitly: human oversight includes being able to interrupt the system through a stop button or a similar procedure that brings it to a halt in a safe state. Even outside that scope, a customer who signs a contract will ask the same question after the first incident.
If you had to switch your agent off tomorrow at 10:00, who would do the work at 10:05?
Original and updates: [the kill switch checklist for LLM agents](https://www.omarbaruzzo.it/en/blog/spegnere-un-agente-ai).
Articolo originale: [https://www.omarbaruzzo.it/en/blog/spegnere-un-agente-ai](https://www.omarbaruzzo.it/en/blog/spegnere-un-agente-ai)