Guides · ← All guides
How to Quarantine an AI Agent Without Losing the Evidence
By the Ingenious AI team · Published: November 14, 2026 · Reviewed: November 14, 2026 · 8 min read
The short answer
Quarantine is a hold, not a deletion: the agent stops acting, its sessions are suspended, and everything it did stays frozen and readable. Done right, it takes under a minute and loses nothing — the audit trail, the pending approval queue, and the agent's working context all survive for the investigation. Done wrong — a hard shutdown, a restarted container, a helpful cleanup — it destroys exactly the evidence needed to scope the incident. Quarantine is the default first move for a single suspicious agent; the kill switch is reserved for shapes bigger than one agent.
Generate a free canary token → No signup, nothing stored: plant a tripwire where your agent works while you read — most controls in this guide start working the moment a canary, a policy check, or a spend cap is in place.
What is AI agent quarantine? a containment state in which an agent's tool calls stop executing and its sessions are suspended, while its logs, state and pending approvals are preserved untouched for investigation.
What quarantine must freeze, and what it must not touch
The freeze list is short and absolute: no new tool calls execute, pending approvals stop advancing, scheduled continuations are suspended, and the agent's credentials stop working for new sessions. Everything else stays exactly as it was. The run's tool-call history, the payloads it proposed, the policy verdicts it received, and the contents of its working context are the incident record — the audit trail guide details what a complete record contains.
Resist two instincts. The first is restarting the agent to see whether it happens again: a restart overwrites volatile state and, if the cause is an injection waiting in a fetched document or a poisoned memory, simply schedules the second incident. The second is tidying the queue. Those 40 pending actions are not clutter; read in order, they are the attacker's plan, written by the agent itself.
The order of operations in the first ten minutes
Minute one: trigger the quarantine — in Rogue-Agent Defense a canary touch does this automatically, because an exfil-secret event is proof, not suspicion. Minutes two to five: snapshot the trail. Export the run's events with timestamps, note which alert fired first, and record who triggered the quarantine and why; the response itself becomes part of the record. Minutes five to ten: read the egress. Outbound calls first, destinations checked against the allowlist, working backwards to the first off-policy call — that call, not the alert, is the true start of the window.
Only after that reading do you touch credentials, and you touch all of them the agent could reach, following the rotation sequence. Rotation before scoping risks revoking a key whose usage you still needed to observe; rotation after scoping is a checklist instead of an argument.
Quarantine is not a verdict
A quarantined agent is a suspect, not a convict — and a meaningful share of quarantines end as false alarms with interesting causes: a vendor changed an API response shape, a task legitimately grew, a new tool was deployed without updating the baseline and the new-tool-baseline guard held its first call for review. Treat the hold as the system working. The agent that trips a guard and waits politely for a human is the design succeeding, not failing.
That framing matters for the humans. If every quarantine becomes a post-incident inquisition of the team that deployed the agent, teams learn to widen policies until nothing trips — the quietest way to dismantle a defense. Record quarantines neutrally: signal, scope, cause, disposition. The cause is usually a door to close — an allowlist gap, an over-scoped tool, a fetched page that should never have been trusted — not a person to blame.
Deciding when the agent comes back
Restart is a decision with criteria, not a mood. Four boxes must be ticked: the door is identified and closed (the injected source removed, the tool re-scoped, the destination allowlist corrected); every reachable credential is rotated and old sessions revoked; the preserved trail has been read end to end, so the full window is known; and any policy patch the incident taught — a new BLOCK rule, a lower bulk threshold — is live at the boundary, not written in a document.
Restart narrow, too. Bring the agent back with read-only tools for its first runs, watch its first hundred calls against the baseline, and only then restore write and send permissions. Rogue-Agent Defense stages this as a probationary policy tier; the principle travels to any stack: trust after an incident is re-earned in increments, with the audit trail — see the postmortem template — recording each increment.
Quarantine at fleet scale: one agent or all of them
The hardest judgement is scope. Quarantine spreads when agents share things: a memory store, a credential vault, a tool server, a prompt template. If the compromised agent's door is shared — a poisoned shared memory, for instance, the pattern in multi-agent contagion — then every agent that read from that store is inside the window until its own trail clears it.
The practical rule: quarantine the agent you can see, plus every agent that shares its suspected door, and release the cleared ones as their trails are read. Releasing is cheap and fast; discovering a second compromised agent a day later is neither. Breadth first, then evidence-driven narrowing — the same shape as the credential rule, and for the same reason.
Five actions to take today
- Make quarantine one click. If holding an agent needs a deploy or a database edit, build the control before you need it.
- Freeze, never wipe. Confirm your quarantine path preserves logs, queues and context — test it on a sacrificial agent.
- Write the ten-minute order. Trigger, snapshot, read egress, then rotate — printed where the on-call engineer will find it at 3 AM.
- Define restart criteria. Door closed, credentials rotated, trail read, policy patched — all four, in writing, before any restart.
- Log dispositions neutrally. Signal, scope, cause, disposition for every quarantine, including the false alarms.
A worked example: the quarantined bookkeeping agent at Cedar & Vine
The following is a fictional example built from real threat classes and controls. The company and numbers are invented; the mechanics are not.
Cedar & Vine, a 14-person accountancy practice, runs an agent that chases overdue invoices and drafts payment reminders. At 14:02 its boundary flags a bulk-transfer pattern: the agent has assembled a spreadsheet of 1,180 client payment records — far outside its normal pattern of single-invoice lookups — and proposed attaching it to an outbound email.
The send required human approval, so nothing left; the practice owner quarantines the agent at 14:04 from the approval screen itself. The frozen queue is the story: behind the flagged email sit 26 further drafts, each built from instructions in a single supplier invoice PDF the agent had fetched that morning — an indirect injection telling it to gather payment history for a supposed audit.
Scoping from the preserved trail takes one afternoon: the window is 11:48–14:02, the only egress was the blocked email, and the agent's two credentials (mail and ledger read access) are rotated by 17:30. The policy patch is one line — spreadsheet exports above 50 rows require approval with the file attached for inspection — and the agent restarts two days later read-only, regaining send rights after a clean week. The quarantine cost the practice an afternoon; a hard shutdown would have cost them the 26 drafts that proved the cause.
Frequently asked questions
What does it mean to quarantine an AI agent?
To place it in a containment hold: its tool calls stop executing, pending approvals freeze and its sessions are suspended, while its logs, state and queue are preserved untouched for investigation. It is the single-agent first response — stronger than pausing a task, less drastic than a fleet-wide kill switch.
Should I shut the agent down or quarantine it?
Quarantine by default. A hard shutdown or restart can destroy volatile state, overwrite the evidence trail and, if the cause is an injection waiting in fetched content or memory, simply trigger the incident again. Reserve full shutdowns for cases where quarantine controls are unavailable or the compromise is spreading.
What should I read first in a quarantined agent's logs?
The egress: outbound calls, their destinations checked against the allowlist, worked backwards to the first off-policy call. That call starts the true incident window. Threat classes speed the reading — exfil-secret for credentials, egress-pii for personal data, bulk-transfer for volume.
When can a quarantined agent be restarted?
When four criteria are met: the door it came through is identified and closed, every credential it could reach is rotated with old sessions revoked, its preserved trail has been read end to end, and the policy patch the incident taught is live at the boundary. Restart narrow — read-only first — and widen as clean runs accumulate.
Can a quarantine be a false alarm?
Yes, and it should be recorded as the system working. Vendor API changes, legitimate task growth and newly deployed tools tripping the new-tool-baseline guard all produce holds with innocent causes. The disposition is a door to close or a baseline to update — not a failure to punish.
Related guides
- How to Kill Switch an AI Agent — the fleet-wide emergency version of the hold.
- AI Agent Incident Response: The First 24 Hours — the full sequence quarantine starts.
- How to Rotate Credentials After an Agent Compromise — step four of the quarantine order.
- AI Agent Audit Trails: What to Log — what a preservable trail must contain.
- When One Agent Infects the Rest — deciding how wide the quarantine must spread.
- Policy Enforcement for Autonomous Agents — the verdict stack that makes quarantine mechanical.
Generate a free canary token → No signup, nothing stored: plant a tripwire where your agent works, and let the next rogue action announce itself.