Business

Writing a Shutdown Section for an Agent Runbook

Antonio Evans11 min read

A split scene: on the left, an operator at a terminal with a printed runbook open to a page titled SHUTDOWN, numbered steps checked off, a red STOP button on the desk; on the right.
Key points

Key points

  1. 1A shutdown section is a numbered checklist that turns a fired stop rule into specific actions, each with one owner, a time budget and a check that proves the step worked.
  2. 2The order matters: freeze ingress first, snapshot evidence second, revoke credentials third, and drain or terminate outstanding work last.
  3. 3A stop rule is only as good as its rehearsal, so schedule a drill at least once a quarter and after every change to the agent's tools or credentials.
  4. 4Most failures come from stopping the model while leaving other action paths open, so the checklist must cover every way the agent can affect the world.

Why the stop decision is the easy part

A stop rule and a kill switch are different things. The rule is the trigger: a threshold, an alert, a human judgment. The switch is the mechanism. A widely quoted framing gets this right: a shutdown button without decision rights is not a control, it is a rumor the governance discussion. Boards asking about kill switches are really asking about activation thresholds, named owners, audit logging, rollback procedures and a formal restart path, which is documented governance rather than a hidden button.

The operational point is sharper still. An AI agent kill switch is a procedure with a testable outcome, not a feature you ship the operational analysis. If you disable an agent's principal and the agent can still write export files, call a model provider directly or leave accepted jobs running, the kill switch "succeeded" without containing anything. The credential operation returned 200. The workload kept going.

That gap is why the shutdown section exists as a separate document from the stop rule. The stop rule answers "when do we act?" The shutdown section answers "what exactly do we do in the next twenty minutes, in what order, and how do we know it worked?" Legal and policy discussions of kill switches note that there is no literal switch, only a metaphor borrowed from factory emergency stops the policy overview. Your runbook has to make the metaphor concrete.

Define the stop objective before writing steps

Before you write a single step, write one sentence that defines what "stopped" means. Security teams distinguish two levels: containment, which denies specified consequential actions, and quiescence, which additionally requires running execution and outstanding work to reach verified terminal states the operational analysis. A paused job is not terminal. A completed job may already have produced effects you need to reverse.

Three artifacts make the objective reviewable:

  1. Stop scope. Which effects are forbidden (outbound email, database writes, file exports, payment submissions), which execution units must end (containers, jobs, scheduled triggers), and what collateral damage is acceptable while you stop.
  2. Shutdown protocol. The numbered steps, each with an owner, a dependency and a failure path.
  3. Acceptance report. Observed coverage, timing and persistence, written during the incident, not reconstructed afterward.

Build the scope from what actually grants the agent power: credentials, reachable destinations, writable resources and submitted work. "All registered action paths are closed" is a bounded, checkable claim. "The agent cannot cause harm" is not the operational analysis. For example, an invoice agent might have four paths: an enterprise API, a model provider, local file writes and a job queue. Revoking the API credential closes one of four. If the business harm is duplicate invoice submissions, then the queue matters more than the model credential, and the checklist must be ordered accordingly.

A practical decision rule: rank every step by the consequences it removes, not by how easy it is to perform. If a queued job needs no further model call, blocking model access does nothing for that exposure. Teams that reorder around convenience gradually redefine "successful containment" as "the admin action we knew how to do quickly."

The shutdown checklist

Write the section as a numbered checklist, one line per step, with these columns: step, action, owner role, time budget, verification command or check, and rollback or escalation if the check fails. Aim for a complete run in under 30 minutes for a single agent, and state that budget at the top of the section so the on-call engineer knows the target.

#ActionOwnerBudgetVerification
1Declare the stop in the incident channel and name the incident commanderOn-call engineer2 minIncident record exists with timestamp and commander
2Freeze ingress: deny new requests at the gateway or disable the triggerPlatform engineer3 minGateway rejects the agent identity; trigger shows disabled
3Throttle rather than kill if partial service is safe, to avoid half-written statePlatform engineer2 minRate limit applied; queue depth stops rising
4Snapshot state: logs, traces, prompts, tool calls, queue contents, file exportsAgent owner5 minSnapshot stored, checksum recorded, restore tested once
5Revoke credentials: agent identity, refresh tokens, scoped API keys, task grantsIdentity owner3 minRevocation response confirmed and a resource denies the token
6Terminate execution units: containers, jobs, scheduled runsPlatform engineer3 minZero running pods or jobs; no restart events after termination
7Drain or quiesce outstanding work to a terminal stateAgent owner5 minQueue empty or items explicitly parked; each parked item has an owner
8Confirm quiescence: no calls, no writes, no queued work for a full observation windowOn-call engineer5 minMonitoring shows zero agent actions for the window
9Notify affected stakeholders and open the restart decision recordIncident commander5 minNotice sent; restart criteria documented

Three details in that table carry most of the weight:

Freeze ingress before snapshotting. If the agent keeps accepting work while you copy logs, the evidence is moving under you and the queue keeps growing. The exception is a partial throttle, which sometimes beats a hard stop because a half-completed write is harder to reason about than a bounded intake. Write down which of the two your team defaults to.

Verification means the resource denies, not the issuer responds. Revoking a refresh token stops new issuance. It does not prove the resource rejects an access token already in hand. The OAuth revocation specification requires support for refresh-token revocation, recommends access-token revocation, and acknowledges propagation delay RFC 7009 via the operational analysis. Self-contained tokens can be validated locally, so issuer-side changes need resource-side enforcement to bite immediately. Your verification step should be an actual denied call from the agent's identity, not a green checkmark in an admin console.

Snapshot before you kill. Terminating processes destroys the fastest source of evidence: in-memory state, the current context window, the exact tool call in flight. Capture first, unless execution is actively causing harm, in which case your scope document should say so and you swap steps 4 and 6 in that specific scenario.

Here is a verification sequence you can adapt for the credential step, written as a test anyone on call can run:

# 1. Confirm the token is rejected by the resource, not just the issuer
curl -s -o /dev/null -w "%{http_code}\n" \
  -H "Authorization: Bearer $AGENT_TOKEN" \
  https://api.example.com/v1/orders
# Expect 401. A 200 means revocation has not propagated.

# 2. Confirm execution units are gone
kubectl get pods -l agent=invoice-bot -o wide
# Expect empty list, then wait one full observation window and repeat.

# 3. Confirm no queued work can start
kubectl get jobs -l agent=invoice-bot
# Expect no active jobs; inspect any parked items one by one.

The acceptance report is the last artifact: a short record of what was checked, when, by whom, and what was observed, per the runtime policy guidance that a stop needs a testable outcome the operational analysis. It doubles as the evidence a board or auditor asks for, alongside activation thresholds and named owners the governance discussion.

Cover every action path, not just the model

The most common way a written shutdown section fails is that it stops the visible thing. For a conversational agent, that means revoking model access. But the same runtime often holds cloud API rights, code execution, Kubernetes access and MCP tool connections. The control surface has to cover all of them.

Sort the agent's tools into tiers and write the shutdown treatment for each tier into the runbook:

Action tierExamplesShutdown treatment
ReadLogs, metrics, tracesLeave recording on; do not disable observability
Read of sensitive dataSecrets, customer recordsDeny first, since it is fast and has no side effects
Reversible, narrow reachRestart one pod, scale within limitsHalt scheduled triggers; terminate on checkpoint
Reversible, wide reachRoll back a deployment, restart shared servicesFreeze ingress and require a second approver to resume
IrreversibleSchema migration, data deletion, credential rotationExplicit deny at the gate before execution
Security-sensitiveIAM changes, disabling audit logsRefuse from outside the agent, then revoke the grant

That tiering mirrors the human-in-the-loop guidance that recommends explicit approval on high-impact or irreversible actions, action previews before execution, and four risk levels from reads up to irreversible changes the runtime policy guide. The same guide recommends a unique agent identity with a named owner, denying unreviewed tools by default, and testing revocation paths, all of which belong in the shutdown section as prerequisites.

For sandboxed code agents, add an egress check to the checklist. Start with an explicit list of destinations, operations and credentials each task needs, then test network controls from inside the actual runtime, because a policy file alone does not prove enforcement the sandbox security guide. Where an egress gateway is the enforcement point, test what happens when the gateway is unavailable: the intended result is a failed task with a clear error, not a silent route around the restriction. Keep infrastructure control credentials outside agent-controlled processes, and validate that revocation works while a task is still running by checking what the application does when its next authenticated request fails.

Drill schedule and the review loop

A checklist nobody has executed is a hypothesis. Incident-response practice treats discussion-based exercises (tabletops) as the low-risk entry point, then moves to functional exercises where participants actually perform the tasks in a simulated environment the tabletop guide. A shutdown rehearsal should be a functional exercise: someone really revokes a test credential, really kills a test job, really runs the verification command.

A schedule that holds up:

CadenceExerciseWhat it proves
MonthlyMicro-drill: one step, ten minutes, one engineerThe verification command still works
QuarterlyFull functional drill on a staging agentEnd-to-end timing against the 30-minute budget
After any tool or credential changeStep-level replay of affected stepsNew action paths are covered
After every real stopTimed review within five working daysThe written steps matched reality
Twice a yearTabletop with legal, comms and leadershipDecision rights and stakeholder notice hold

The single-step drill is where most of the value sits. Pick the step people are least sure about, usually credential revocation, and have the on-call engineer run only that step plus its verification during a calm week. If the verification fails, you have found a propagation delay or a caching problem while nothing is on fire.

The review loop after a real stop follows the same discipline as an incident postmortem: reconstruct the timeline from logs, identify which step was late or skipped, and change the document rather than the memory. Record the actual per-step durations in the acceptance report and compare them with the budgets. Two patterns typically show up. First, the step everyone thought took three minutes took nine because a console page was deprecated. Second, a step failed outright because the owner role was ambiguous. Both fixes are edits to the runbook, and both disappear if nobody writes them down.

Treat the checklist as versioned code. Keep it in the same repository as the agent's deployment configuration, review changes like a pull request, and link the current version from the alert that fires the stop rule. Runbooks that live in a wiki drift from reality, which is exactly why responders stop trusting them at 3am and improvise the runbook automation summary.

The traps that make a written stop rule fail

Seven failure modes account for most of the gap between a documented shutdown and an executed one.

Stop authority without decision rights. If the threshold is undefined or the owner is unnamed, the stop becomes a meeting. Fix it by writing the trigger conditions, the named role that can fire without asking, and the escalation path into the same section.

Credential revocation mistaken for termination. A revocation response proves the issuer acted. It does not prove the resource rejected an in-hand token, and cached active responses can keep a revoked token usable the operational analysis. Fix it with a denied-call verification as in the script above.

Stopping the model and leaving the workload. Termination removes execution units, not outstanding work. Queued submissions, accepted jobs and scheduled triggers need their own drain step with a terminal-state definition the operational analysis.

Unverified egress controls. Kubernetes network policies are additive, and another matching policy can allow traffic you expected to block the sandbox security guide. Test from inside the sandbox and test direct IP access, not just DNS.

Vendor promises in place of local controls. Waiting for a model provider or cloud host to decide in a crisis is not control the governance discussion. Contract language, testing and compensating controls are the mitigations, but the checklist must be executable with what you hold.

A runbook that was never rehearsed. The tabletop literature is blunt: tabletops reveal unclear authority, slow handoffs and conflicting assumptions that penetration tests cannot the tabletop guide. A shutdown section is a claim about authority. Rehearse it.

No restart path. A shutdown with no documented criteria for resuming invites pressure to "just turn it back on." Write the restart conditions, the approver, and what must be fixed before the stop signature is cleared, alongside the shutdown steps in the same record.

Rehearsing the people and keeping the document honest

The shutdown section sits inside a wider operating model. Someone has to own the agent in production after the build team moves on: stability, observability, runbooks and long-term health are a distinct role, and it is the role programs most often forget to staff the vision AI team blueprint. The same split applies to any agent in production. A builder takes the agent from zero to one; a scaler ports it across teams and works themselves out of each deployment; an operator keeps it trusted for years. The shutdown section belongs to the operator, not the builder, and the operator should be the one who signs off on each drill.

When you assemble the drill, invite the roles that make decisions rather than just the engineers who run commands. Cross-functional tabletops are designed to validate escalation paths and clarify ownership of decisions such as system shutdowns, and to test out-of-band communication when email or chat may be compromised the tabletop guide. A shutdown drill that only involves the platform team proves the commands work. It does not prove that legal, communications and the business owner know who speaks and when.

One more habit keeps the document accurate: let the drill produce the edit. Every functional exercise ends with a dated diff to the checklist, and every diff gets a retest of the changed step at the next monthly micro-drill. That loop, not the initial writing, is what makes a written stop rule hold up at 3am.

If your team is standing this up for the first time, a structured review of the current stop rules, action paths and owner roles can save a quarter of guesswork. The Quanta experts can work through your agent's shutdown plan with you and hand back a completed runbook and drill calendar as deliverables.

FAQ

FAQ

How long should a shutdown section be?

One page for the checklist itself, plus supporting detail such as the scope definition, verification commands and acceptance report template. If the numbered steps do not fit on a screen next to the incident channel, they will not be followed under pressure. Move explanation to an appendix and keep the numbered actions terse.

What is the difference between containment and quiescence?

Containment denies specified consequential actions, such as stopping new writes or submissions. Quiescence additionally requires running execution and outstanding work to reach verified terminal states the operational analysis. Most high-impact incidents need both, and the shutdown section should state which one the stop rule demands.

Can I just revoke the agent's API key and be done?

Not unless every consequential action depends on a resource that rejects the revoked token immediately. Self-contained tokens can be validated locally, cached active responses can keep a revoked token usable, and revocation propagation has delay the operational analysis. Always add a denied-call verification and check for other action paths such as file writes and queued jobs.

How often should we rehearse the shutdown?

Run a ten-minute single-step drill monthly, a full functional drill on a staging agent quarterly, and a step-level replay after any change to the agent's tools or credentials. Add a cross-functional tabletop twice a year so legal, communications and leadership rehearse their decisions, which is the part technical drills cannot test the tabletop guide.

Who should own the shutdown section?

The operator who owns the agent in production, not the builder who shipped it. That role owns stability, observability and runbooks, and it is the one programs most often leave unstaffed the vision AI team blueprint. Name one person and one backup in the document itself, so the stop decision never waits on availability.

Sources

Sources

  1. AI Kill Switch Governance Questions for Boards | by Tyson Martin - Medium
  2. The AI agent kill switch is a procedure, not a feature
  3. AI Kill Switches: Can AI Models be Turned Off? - Texas Law
  4. How to implement runtime policy enforcement for AI agents
  5. AI Agent Sandbox Security: Egress, Secrets, Endpoints
  6. Cybersecurity Tabletop Exercises: Steps & Scenarios
  7. Kubernetes Node Drain runbook, automated by ...
  8. How to Staff a Vision AI Team: 3 Core Roles
About the author

About the author

Antonio Evans
Antonio Evans

Antonio Evans is the founder of Quanta Intelligence and a fractional CTO who builds HIPAA-ready AI systems for health and life-science companies. Before that he was technical co-founder of FriendsEAT for twenty years, CEO of Socialdraft, and a data engineer at IBM. Antonio lives with his dog Santino in Lisbon, Portugal.

All articles