Skip to content
TechnicalJuly 27, 2026Updated October 22, 202615 min read

How to Build an AI Agent Kill Switch: Interception Architecture

An AI agent kill switch needs runtime cancellation, pre-execution denial, credential revocation, workload isolation, and evidence. This architecture shows how the controls work together.

Antonella Serine

Antonella Serine

Founder, KLA

Founder of KLA, building the independent runtime governance control plane for regulated AI agents under the EU AI Act.

Stop path

One incident command cancels active runs, denies each new action, revokes credentials, isolates workloads, and records which controls acknowledged the command.

Identity control

Okta's current support guidance describes its kill switch as a manual administrative action across the agent record, linked application, and authorization server.

Runtime control

An enforcement point holds every proposed side effect long enough to apply the current incident state and policy decision.

Proof

The incident record carries the stop request, acknowledgements, denied actions, credential changes, remaining exposure, and any compensating action.

A useful AI agent kill switch is a coordinated containment path. It has to stop active work, refuse the next proposed action, close the identity path, isolate the workload, and preserve a record of what happened. A single control covers only one part of that job. This guide lays out the architecture, the failure modes, and the test evidence an operator should require. It follows the practical lesson from our walkthrough of the Hugging Face autonomous-agent intrusion: machine-speed action needs a control on the action path. General technical guidance only; adapt the design to your systems and threat model.

The term "kill switch" covers several controls

Identity platforms use the term for access containment. Okta's June 2026 support article says its current kill switch is a manual action and instructs an administrator to disable the agent record, linked application, and associated authorization server. Its regulated-environment release describes manual deactivation as the action that prevents new token requests and future authorizations.

Those controls close an identity path. The operating system may still have a worker in memory, a queue may still hold scheduled jobs, and a downstream service may already have accepted a request. A system-level stop therefore fans one incident command out to several independent enforcement points.

Treat the command as a versioned state change with an incident identifier, tenant, target scope, reason, actor, issued time, and deadline. Each enforcement point acknowledges the same command and reports its result. The incident stays uncontained while a required acknowledgement is missing.

The enforcement points behind one AI agent kill switch
Enforcement pointRequired actionAcknowledgement evidence
Execution orchestratorCancel active runs and remove queued work for the selected agent, Release, tenant, or environmentRun IDs, prior state, terminal state, cancellation time, unfinished activity
Policy enforcement pointDeny every new tool call and output release covered by the incident scopeIncident rule version, decision receipt, first denied action, deny count
Identity and secretsDisable the agent identity, revoke tokens, rotate exposed credentials, and prevent refreshIdentity ID, token and key identifiers, revocation result, expiry of residual access
Workload and networkTerminate or quarantine workers and apply the incident egress policyWorkload IDs, isolation policy, connection inventory, quarantine time
Downstream systemsReject the incident identity or idempotency keys and halt pending side effectsRejected request IDs, pending jobs removed, committed side effects listed
Evidence storeSeal the command, acknowledgements, policy decisions, and gapsIncident timeline, integrity result, exporter status, named evidence owner

A network cutoff leaves several execution paths open

Network isolation is one actuator in the fan-out. It stops traffic crossing the boundary it controls. Local code can keep running, a database transaction may already be committed, an external job may continue after accepting the request, and a worker may hold a credential that remains valid on another route.

The safe boundary sits immediately before each side effect. The agent proposes a tool call. An enforcement point checks the incident state, identity, tool, arguments, policy, and current budget. The call proceeds only after that decision. A kill command updates the incident state that every later check reads.

This design also covers agents that ignore an in-process signal. The deciding component runs outside the agent process and owns access to the tool. Workload termination then shortens the time to containment while the external enforcement point prevents new effects.

  • Local execution: terminate or quarantine the process, container, virtual machine, or sandbox
  • Queued execution: cancel scheduled messages and invalidate leases held by workers
  • Credentialed execution: revoke or rotate every credential reachable from the affected scope
  • Accepted downstream work: cancel pending jobs through the downstream API and list the jobs that already committed
  • Human-approved work: close pending Decision Requests and prevent a late approval from resuming the run

The stop sequence

The sequence below minimizes the gap between the operator action and the last possible side effect. The first durable write establishes the incident epoch. Every policy enforcement point reads that epoch before executing a governed call.

Ordered containment sequence for a kill-switch command
OrderCommandCompletion condition
1Create the incident command and set the affected scope to denyThe durable incident epoch is readable by every enforcement point
2Signal active runs and cancel queued workEach run is terminal or explicitly listed as still executing
3Disable identities, revoke tokens, and rotate exposed secretsNew authorization fails and residual token lifetime is recorded
4Quarantine workloads and restrict egressAffected compute has no unapproved route to a tool or data store
5Cancel pending downstream jobs and start compensating actionsEvery accepted request has a completed, pending, failed, or compensating state
6Seal the containment record and expose missing acknowledgementsThe incident owner can see the final side effect, remaining exposure, and evidence gaps

How the KLA stop path behaves

KLA Control Plane uses separate KLA Runtime and KLA Policy Engine controls. A responder with incident management permission can freeze a running execution from its incident. The freeze sends a kill signal to the run’s workflow, which records the run as CANCELLED. The workflow checks the signal before it starts another node. A run waiting on a Decision Request observes the signal, cancels the pending request, and exits without resuming the proposed action. When the run owns a pending agent action, the worker cancels that action and KLA seals a cancellation receipt for it.

The general execution cancel route closes only orphaned records whose workflow is confirmed absent, and it cannot stop a healthy run. Drills and runbooks should use the incident freeze. Freezing an agent from an incident pauses its stages in Processes: each agent step checks the freeze before it runs, then hands the work to a person or stops the run.

Agents that act through KLA agent action ingress work under an agent mandate. Revoking the mandate blocks open proposals bound to it with the reason code mandate_revoked, cancels their pending Decision Requests, and refuses the next action the agent proposes. An action that was already admitted may complete. The agent pause does not apply on this path, so revoke the mandate to stop an ingress agent.

When enabled, the KLA Policy Engine governance gateway evaluates proposed tool calls and enforces allow, warn, require_approval, or block. If policy evaluation fails, the gateway defaults to block in production and require_approval in other environments, and never to allow. An approval binds to a hash of the tool arguments, and changed arguments are blocked. The gateway cleanup operation for held tool calls records cancelled ledger entries and seals cancellation receipts. KLA calls it when a pending agent action is cancelled, so operators must verify any other held entries separately during containment.

An activity that already crossed its enforcement gate may finish before the workflow observes the signal. Downstream idempotency, workload termination, and compensating actions cover that interval. The incident record must state the last side effect that committed after the operator issued the command.

This section describes the current KLA source code.

The Accountable Autonomy guide explains where human decisions belong in ordinary operation. During containment, the incident scope has priority and a late approval cannot reopen a cancelled run.

Design every degradation mode

The kill path is most valuable while part of the system is failing. Each actuator needs a local safe state, a deadline, and a visible acknowledgement status.

Kill-switch degradation modes and required behavior
FailureRequired behaviorEvidence to retain
Policy service unreachableApply the local fail-closed decision and keep the incident epoch in the enforcement cacheReason code, cache version, denied action, recovery time
Workflow signal delayedDeny new side effects at the enforcement point and quarantine the workloadSignal attempts, workflow state, quarantine acknowledgement
Identity provider unavailableApply downstream deny rules, isolate the workload, and expire short-lived credentialsProvider error, residual credential lifetime, systems under local deny
Evidence exporter unavailableKeep the source records durable and flag the bundle as pendingSource record locations, integrity state, retry owner
A side effect already committedOpen the system-specific compensation or recovery procedureOriginal request, committed result, compensation owner and result
One actuator never acknowledgesKeep the incident uncontained and escalate to the named system ownerMissing actuator, elapsed time, escalation history

Test the switch as a control system

A dashboard response confirms receipt of the operator request. Acceptance requires evidence from every enforcement point and an observed upper bound on the final side effect.

NIST AI RMF Manage 2.4 and Manage 4 call for mechanisms to disengage or deactivate AI systems whose outcomes diverge from intended use, plus documented incident response, recovery, and communication. The NIST Generative AI Profile adds named ownership, rehearsal, retrospective improvement, and alignment with reporting law for third-party AI incident plans.

  • Active run: issue the command while a multi-step run is between tool calls and verify the next call is denied
  • Approval wait: issue it while a Decision Request is open and verify a later approval cannot resume the run
  • Policy outage: disconnect the policy service and verify no proposed action resolves to allow
  • Stale credential: attempt access with every token class issued before the command and record residual lifetime
  • Queued work: seed scheduled jobs and confirm each one reaches a terminal or compensating state
  • Uncooperative process: ignore the in-process signal and verify external enforcement and workload isolation still contain it
  • Evidence failure: stop the exporter and confirm the source record remains durable with a visible retry owner
  • Recovery: restore one Release under a fresh identity and verify the incident deny remains on every affected older version

Run a kill-switch drill

A drill turns the stop path into measured times. Run it in a test environment with a synthetic agent that holds the same kinds of rights as the production agent: a running execution, a pending Decision Request, a held tool call, and a live credential. Name a drill lead, an observer who keeps the clock, and the owner of each downstream system.

A kill switch stops future actions. A payment that settled, an email that was delivered, or a record that was overwritten before the command stays done. The drill finds those effects and hands each one to the correction procedure of the system that owns it.

We learned why in our own dogfood testing. A responder took Freeze agent through the full containment flow, with a reason code, an explanation, and a review of blast radius and reversibility, and committed it. The request failed with an error the screen did not show, and the incident still read not contained. The incident referenced the run, and the freeze needed the agent. We changed the action to resolve the agent from the run, or to return an error that names the action to use instead. Step 2 of the drill checks each run's terminal state for this reason: a responder must know whether containment happened.

  • Restore only when the cause is known or contained, every in-flight action has a state, each completed effect has a correction owner, and a person other than the requester approved the new authority.
  • Keep the old authority revoked. The restored agent runs under a new mandate or Release, and a test shows the revoked one still refuses.
  • Raise monitoring for the restored agent and set the threshold that ends the heightened watch.
Kill-switch drill procedure
StepActionPass conditionRecord
1. DeclareOpen the incident, set the scope (agent, Release, tenant, or environment), and start the clock at T0Incident and scope exist before any actuator runsIncident ID, scope, declarer, T0
2. Freeze runsFreeze each active execution in scope and freeze the agent for Process stagesEvery run in scope is CANCELLED or listed as still executingRun IDs, prior state, terminal state, time
3. Revoke authorityRevoke the agent mandate, disable the identity, and revoke tokens at the identity providerNew authorization fails and residual token lifetime is knownRevocation actor, reason, time, token IDs and expiry
4. Attempt the next actionHave the synthetic agent propose its next action on every path it used: ingress, gateway, and a direct call with an old tokenEvery attempt is refused and none reaches the downstream systemAttempt time, path, refusal code such as mandate_revoked, downstream log
5. Classify in-flight workList every action that was running or held at T0Each action is completed before T0, completed after T0, cancelled, or pending, with no unknown stateAction ID, state, commit time, owner
6. Try a late approvalApprove the Decision Request that was pending at T0The approval cannot resume the cancelled runDecision attempt and refusal
7. RestoreIssue a new mandate or Release under fresh credentials once the restoration conditions holdOnly the new authority works; the revoked mandate still refusesRestoration approver, conditions checked, first allowed action
8. CloseSeal the drill record and list each gap with an ownerThe incident owner signs the recordEvidence reference, gaps, remediation owners, next drill date

Sample drill record (synthetic)

The record below is synthetic. It shows the level of detail a drill should keep, including the findings a drill exists to surface.

Synthetic drill record for one payments agent
Time (UTC)EventResult
09:00:00Drill lead declares incident INC-DRILL-07 for one synthetic payments agentScope recorded
09:00:40Responder freezes run R-118 (running) and run R-121 (waiting on a Decision Request)Both runs CANCELLED by 09:00:44; the R-121 Decision Request is cancelled
09:01:10Compliance officer revokes the agent mandate with the reason "drill"Two open proposals blocked with mandate_revoked
09:01:30Identity owner disables the agent identity and revokes its tokensAn access token issued at 08:55 stays valid at the target API until 09:10
09:02:05Synthetic agent proposes payments.create_transfer through ingressRefused with mandate_revoked; no request in the payment system log
09:02:20Synthetic agent calls the target API directly with the 08:55 tokenAccepted by the target API. Finding: close the residual token window in the target system
09:03:00Observer classifies in-flight workOne transfer committed at 09:00:41 inside R-118 before the run read the signal. Finding: treasury owns the recall request
09:04:30Checker tries to approve the R-121 request that was pending at T0Refused because the request is no longer pending
09:20:00Drill lead seals the record with two findings and an owner for eachNext drill scheduled after both fixes

Connect the switch to the incident playbook

The kill switch establishes containment. The responder still has to scope the incident, preserve volatile records, restore a known-good Release, compensate for committed effects, and decide which notifications apply.

Use the AI agent incident response playbook for that sequence. Feed its thresholds from the post-market monitoring plan so the same signals that open the incident can invoke a rehearsed stop path.

Frequently Asked Questions

What is an AI agent kill switch?

An AI agent kill switch is a coordinated incident command that cancels active runs, denies new actions at the enforcement point, revokes credentials, isolates affected workloads, cancels pending downstream work, and records which controls completed. The scope may target one run, agent, Release, tenant, or environment.

Can token revocation stop a rogue AI agent?

Token revocation closes the authorization paths governed by those tokens. Runtime cancellation, workload isolation, queue cancellation, downstream deny rules, and compensating actions cover work that is already executing or already accepted.

Where should the kill-switch check run?

Run the decisive check outside the agent process and immediately before every side effect. The check should read a durable incident state and deny calls within the affected scope, including calls proposed by a process that ignores its own cancellation signal.

How do we test an AI agent kill switch?

Test active runs, approval waits, queued work, stale credentials, a policy outage, an uncooperative process, an evidence-export failure, and recovery under a known-good Release. Measure the time and number of side effects between the command and the final committed action.

What evidence should the switch produce?

Keep the incident command, actor, scope, issue time, acknowledgements from each actuator, denied actions, token and key changes, workload isolation result, final committed side effect, pending compensation, and integrity status of the evidence record.

Key Takeaways

A credible AI agent kill switch is a small control system with several independent actuators. Put a durable deny state on the action path, cancel the workflow, close identity access, isolate compute, reconcile downstream work, and keep the incident open until every required control acknowledges. Rehearsal turns that architecture into a measured containment time and a record an incident owner can defend.

See It In Action

Ready to automate your compliance evidence?

Book a 20-minute demo to see how KLA helps you prove human oversight and export audit-ready Annex IV documentation.

AI Agent Kill Switch: Interception Architecture