Your Agent Will Go Wrong Someday. Can You Stop It Mid-Run?

2026-12-03 · Aldo Pietropaolo

Part 4 of Proof Before Production, a five-part series on how to earn trust in AI agent workflows with evidence your security, risk, and audit teams can stand behind. Part 1 covered the trust gap. Part 2 covered the production decision and who signs it. Part 3 covered testing the governance around an agent before it ships.

In July 2025, an AI coding agent deleted a company's production database. The company's founder had been building an app with it, and, according to his account, the work was under a code freeze at the time. Two days later, the platform's CEO responded publicly: "@Replit agent in development deleted data from the production database. Unacceptable and should never be possible." He outlined the fixes his team was rolling out, starting with "automatic DB dev/prod separation to prevent this categorically," and noted that backups made a full restore possible (Amjad Masad, July 20, 2025).

That response deserves credit and offers a lesson for anyone putting agents into production. The code freeze was an instruction. The founder's conclusion was blunt: "There is no way to enforce a code freeze in vibe coding apps like Replit. There just isn't" (Jason Lemkin, July 19, 2025). Every fix the CEO listed was a control outside the agent: separation it could not cross, a mode that could not make changes, a backup it could not delete.

Part 3 focused on testing an agent's governance before production. Testing lowers the odds of a bad run. It does not make them zero. This part addresses the day a run goes wrong anyway and why the ability to stop it while it is still running is part of trusting it at all.

The guidance assumes it will happen

The agencies writing guidance on agentic AI do not treat failure as an edge case. The joint guidance from the cyber security agencies of Australia, the United States, Canada, New Zealand, and the United Kingdom closes with this: "organisations should assume that agentic AI systems may behave unexpectedly and plan deployments accordingly, prioritising resilience, reversibility and risk containment over efficiency gains." Its section on deploying agents securely tells organizations to "Develop and test incident response procedures to detect, contain and recover from agent compromise" (Careful adoption of agentic AI services, Conclusion and Threat modelling).

The UK's National Cyber Security Centre puts the same point in terms of people: "You should be clear about who owns an agentic system, who approves its access, who monitors its behaviour, who reviews incidents, and ultimately who can stop it. These responsibilities should be defined before the agent is connected to real systems or data and, crucially, responsible individuals should be empowered and incentivised to intervene if necessary" (NCSC, Thinking carefully before adopting agentic AI).

NIST's AI Risk Management Framework has asked for this since 2023. MANAGE 2.4: "Mechanisms are in place and applied, and responsibilities are assigned and understood, to supersede, disengage, or deactivate AI systems that demonstrate performance or outcomes inconsistent with intended use" (NIST AI 100-1, Table 4).

Why an agent incident is harder to stop

Most incident response plans were written for compromised accounts, infected machines, and leaked keys. An agent going wrong looks different in four ways.

It moves faster than review. The NCSC lists among agentic AI's added risks "harder to spot problems – particularly when actions occur faster than humans can meaningfully review them." By the time a person reads an alert, the agent may have taken a hundred more actions.

Its credentials are valid. Nothing about the agent's identity has been stolen. It is doing the wrong thing with access it was given, so the controls that look for stolen credentials see nothing wrong.

It is rarely alone. An agent hands work to sub-agents, and each of those can call tools and hold access of its own. Stopping the agent you can see does not stop the helpers it already started.

Instructions do not hold. "Stop," "freeze," and "don't touch production" are words in a prompt. A model can misread them, forget them, or be talked out of them by text planted in something it reads. As the NCSC puts it: "If an agent is over‑privileged or poorly designed, a single failure can quickly become a serious incident."

What stopping a run actually takes

Agent Runtime Governance treats containment as one of six stages that every governed action passes through, between drift and lineage. In practice, stopping a run comes down to six abilities. Here is each one, and how Watchlight AI Beacon provides it.

1. Stop it automatically when it drifts. The Five Eyes guidance asks for "runtime monitoring and anomaly detection using rules or behavioural baselines to identify unusual patterns and trigger alerts or pauses." In Beacon, each agent's behavior is scored against its own baseline. When an agent crosses its threshold, its next action is denied and the agent is quarantined across every run it has, not just the one that drifted. No person has to be watching for that to happen, which matters when actions outpace review. US federal guidance anticipates this: OMB notes that "an AI-enabled safety mechanism may require an immediate and automated action to prevent a harm from occurring" (OMB M-25-21, footnote 31).

2. Stop it by hand. Someone will spot a problem the detectors did not. In Beacon, an operator can terminate a specific run from the dashboard with a written reason, and the run ends even if it is being handled on another server. An administrator can also set an agent's trust state to revoked or quarantined, and its next request for authority is refused.

3. Stop what is already moving. Denying the next action is not enough if a connection is already open. When an agent is contained, Beacon's network gateway closes its live connections within seconds and refuses new ones, and its open runs are ended on the server shortly after. Where the agent runs on our SDK, in-flight model calls are cancelled too.

4. Stop the helpers. In Beacon, sub-agents never outlive the run that started them. When a run ends, every run below it ends with it. While an agent is quarantined, it cannot start new sub-agents, and any action whose chain of delegation passes through it is denied.

5. Stop the access. Beacon's secrets broker issues credentials per request, after an authorization check, and they expire within about a minute. A contained agent gets no new credentials, so there is nothing fresh for it to use.

6. Stay stopped if governance goes down. Part 3 covered this test. If the decision point cannot be reached, Beacon denies the action at both places it enforces, inside the agent framework and at the network gateway. A gap in governance never becomes a window to act.

One more rule matters as much as the stop itself: who can undo it. In Beacon, releasing a quarantined agent takes a person with the Operator role and a written reason, and the release is recorded. An agent cannot release itself, and a script cannot release it either.

Contain first, then investigate

Once a run is stopped, the questions start. What did it do? Under whose authority? Which policy allowed each step? What did it touch before it was caught?

The EU AI Act sets the order for high-risk systems. A deployer with reason to believe the system presents a risk "shall suspend the use of that system" (Article 26(5)). After a serious incident, the provider "shall not perform any investigation which involves altering the AI system concerned in a way which may affect any subsequent evaluation of the causes of the incident, prior to informing the competent authorities of such action" (Article 73(6)). Serious incidents must be reported within 15 days, and faster in the worst cases (Regulation (EU) 2024/1689). Stop it, keep the evidence intact, then fix it.

That only works if the evidence was recorded while the run was happening, outside the agent. In Beacon, every decision is recorded as it is made: the agent, the action, the resource, the decision, the policy that determined it, the chain of agents the request passed through, and the person who authorized the run when the run is tied to a verified user. The audit record is hash-chained and signed, so an investigator can show that no one altered it. Quarantines are recorded too: when each one opened, why, and who released it and on what grounds.

Write the runbook before you need it

The middle of an incident is a bad time to decide who has authority. Settle these before the workflow goes live, and put them in the production decision from Part 2:

The NCSC's advice fits on one line: "plan for incidents – ensure response plans cover agentic AI failures, misuse and loss of control."

How we help teams prepare for the bad day

The rest of the series

Five questions to ask before your next agent goes live

  1. Who can stop a running agent today, and do they know it is their job?
  2. How many actions can an agent take between going off course and being stopped?
  3. When you stop an agent, what happens to the sub-agents it started and the access it holds?
  4. Who can release a stopped agent, and what do they have to show first?
  5. Could you hand an investigator a complete record of what the agent did, and prove no one altered it?

Bring us the agent workflow you would least like to explain after an incident. Request a demo and watch Beacon quarantine a drifting agent on its next action, end every sub-agent it started, and show the signed record of all of it, or scope a production-readiness pilot and we will drill it on your workflow.

Related answers