---
title: How to stop a rogue AI agent: kill switches, quarantine and runtime controls
url: https://opencontroller.lyzr.com/blog/how-to-stop-a-rogue-ai-agent
published: 2026-11-11
updated: 2026-11-11
author: Lyzr
---

# How to stop a rogue AI agent

**You stop a rogue AI agent at three points: its identity, its traffic, and its runtime. Block the identity so no system accepts its calls, cut it at the gateway so in-flight requests fail, and quarantine it so you can investigate without losing evidence.** All three must exist *before* the incident. If your only lever is rotating a shared API key, stopping one agent means stopping many.

## What makes an agent "rogue"?

An agent goes rogue when it acts outside its approved purpose, permissions or normal behaviour. Common causes:

| Cause | What it looks like |
| --- | --- |
| Prompt injection | A document or web page instructs the agent to exfiltrate data or call an unexpected tool |
| Bad release | A new prompt or model version starts approving refunds it used to refuse |
| Poisoned or changed tool | An MCP server's tool description changes after approval |
| Compromised credential | Calls arrive from an unexpected location or at an unusual rate |
| Drift | Quality slowly degrades as data or users change |
| Runaway loop | The agent retries or recurses, burning budget |

The OWASP Top 10 for Agentic Applications and MITRE ATLAS catalogue many of these patterns and are good inputs for your detection rules.

## Detect: signals worth alerting on

1. **New tool or destination.** The agent calls a tool, API or domain it has never used.
2. **Permission or scope expansion.** It requests scopes outside its registered profile.
3. **Rate and spend spikes.** Calls or token spend jump against its baseline.
4. **Policy denials cluster.** Many blocked attempts in a short window.
5. **Quality drop.** LLM judges on production traffic score groundedness or task adherence below threshold.
6. **Sensitive data in outputs.** Guardrails catch PII or secrets heading out.

Baselines should be per agent and per version. "Normal" for a claims agent is not normal for an HR agent.

## Respond: the five layers of control

| Layer | Action | Speed | Requires beforehand |
| --- | --- | --- | --- |
| 1. Policy | Deny a specific tool or action for this agent | Seconds | Policy enforced in the path |
| 2. Budget | Hard-stop spend or rate | Seconds | Per-agent budgets on the gateway |
| 3. Quarantine | Agent stops acting; state and logs kept | Seconds | Registry and gateway control |
| 4. Identity block | All systems reject the agent's identity and delegations | Seconds to minutes | Distinct agent identity |
| 5. Kill | Terminate runtime, revoke credentials, retire version | Minutes | Runtime connector or owner action |

Use the lightest layer that contains the risk. Quarantine is usually the right first move: it stops harm and preserves the evidence you need to understand what happened.

## Fail-closed or fail-open?

Decide per risk tier, in advance. For agents that move money or change records, fail closed: if the policy check can't run, the action doesn't happen. For read-only assistants, failing open may be acceptable to protect availability. Write the choice into the agent's registry record so nobody decides it mid-incident.

## Run the drill before you need it

1. Pick one production agent.
2. Time how long it takes an operator to quarantine it.
3. Check that its in-flight actions failed safely.
4. Confirm you can reconstruct its last 50 decisions with agent, version, caller and policy.
5. Restore it from a known-good version.

If any step needs a different console, a ticket or a key rotation, fix that first.

## After the incident

Turn the failure into a regression test, fix the cause (prompt, policy, tool approval or credential), evaluate the new version against the old one, and release it through the normal approval path. Don't hot-patch a quarantined agent back into production.

## How Opencontroller does this

[Opencontroller](/blog/what-is-opencontroller) monitors agents for behavioural deviation, raises alerts, and can automatically quarantine and kill an agent, with policies applied across the whole agent estate. Each agent has Block and Quarantine controls on its identity and access panel, which act through the connected platform. LLM judges score real production traffic, and live guardrails check groundedness and task adherence.

## Frequently asked questions

**Can we stop an agent running on a SaaS platform we don't host?**
Yes, if the platform's admin API allows it and the connection is authorized, or if the agent's calls to your systems pass through your gateway. Registration alone doesn't give you a kill switch.

**Is deleting the agent a good response?**
Rarely as a first step. You lose the evidence needed to find the cause and other affected agents.

**Who should be allowed to quarantine an agent?**
The agent's owner and the security operations team, at minimum. Write it down before an incident.

## Related

- [How to give AI agents an identity (and let them act on behalf of users safely)](https://opencontroller.lyzr.com/blog/ai-agent-identity-on-behalf-of-delegation.md)
- [LLM gateway vs agent gateway vs AI control plane: what's the difference?](https://opencontroller.lyzr.com/blog/llm-gateway-vs-agent-gateway-vs-control-plane.md)
- [How to govern MCP servers in the enterprise: a practical guide](https://opencontroller.lyzr.com/blog/how-to-govern-mcp-servers.md)
- [More on Runtime control](https://opencontroller.lyzr.com/blog/cluster/runtime-control)
