AI 智能體需要一個停機開關
Your AI agent needs an off switch
這篇文章為正式環境運作的 LLM 智能體提出停機設計清單,要求預先安排開關及智能體停用期間的工作去向。清單涵蓋任務或租戶層級的功能旗標、人工後備佇列、自動熔斷、處理進行中任務,以及定期演練和記錄。文章指出,這些安排亦會影響任務邊界、冪等步驟和人工處理流程;EU AI Act 對高風險系統的人類監督包括安全中斷機制。
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 pause safely.
Five things to design before go-live
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.
Why this belongs in the architecture
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.
Articolo originale: https://www.omarbaruzzo.it/en/blog/spegnere-un-agente-ai
來源:DEV Community · dev.to