Most production agent failures do not look like explosions. They look like momentum.

A tool returns a response that is technically valid but semantically suspicious. A credential expires halfway through a workflow. A guardrail flags an output, but the surrounding orchestration treats that flag as one more error message to summarize. A browser session changes state outside the agent’s plan. A user revokes approval, but the agent still has cached context that points toward the old path.

The dangerous part is not always the first failure. It is the next step: the agent keeps going because the workflow has retries, fallbacks, and a bias toward completion, but no explicit state for “we no longer trust the assumptions that made this run safe.”

That missing state is quarantine mode.

Quarantine mode, as this essay uses the term, is a reversible, logged, capability-reduced runtime state for AI agents. It is what an agent enters when the system cannot safely continue normal execution, but also should not throw away the run. The agent is still observable. The evidence is still preserved. Some low-risk actions may remain available. High-impact actions stop until a deterministic recovery path succeeds.

This is different from an error handler. Error handling asks, “Can I recover and continue?” Quarantine asks, “Should this run still be allowed to act?”

That distinction matters as agent systems become less like chatbots and more like operators. The Model Context Protocol authorization specification (2025-06-18) defines an optional HTTP authorization flow so a client can call a restricted MCP server on behalf of a resource owner. The same specification covers authorization-server metadata discovery, dynamic client registration, and access-token handling, and it describes a protected MCP server as an OAuth resource server. Those are protocol rules for the boundary. If a token check or a protected-resource check fails during a run, the runtime should narrow what the agent may do next. Asking the model to “be careful” is not that control.

Guardrail tooling is a second, separate control. The OpenAI Agents SDK guardrails documentation says guardrails check user input and agent output. Input guardrails run on the initial user input. Output guardrails run on the final agent output. When a guardrail sets tripwire_triggered, the SDK raises an exception: an input tripwire can stop the agent before it starts when the guardrail is configured to block, and an output tripwire rejects the candidate final output. That is a real stop. It is also a different object from the state in this essay. Quarantine is for the run that has already started, should stay inspectable, and should lose normal side effects until a separate recovery check passes. The SDK documents the tripwire. It does not define that quarantine state. Treating the tripwire as one more sentence for the model to summarize leaves the run in the old state.

The state has to be visible in the trace. OpenTelemetry’s generative AI semantic conventions page now says those conventions have moved to the OpenTelemetry GenAI semantic conventions repository. That repository’s readme describes shared spans, metrics, and events for generative AI clients, including MCP. That is a shared vocabulary for model operations. It does not name a quarantine span. If a run enters the state this essay describes, the application has to record its own event: which signal fired, which capability was restricted, which artifacts were frozen, what cleared the condition, and what action resumed afterward. Otherwise “the agent got stuck” stays a story instead of a field an operator can query.

One place to make the decision is outside the model’s free-form reply. The Claude Code hooks reference (the older docs.anthropic.com hooks URL redirects here) documents lifecycle events a hook can attach to, including PreToolUse before a tool call, where the hook can block the call, PostToolUse after a tool call succeeds, UserPromptSubmit when a prompt is submitted, Notification when Claude Code sends a notification, and Stop at the end of a turn. The reference is for one product. The transferable point is that a check which blocks a tool can live at a hook-shaped point in the runtime, not only inside the model’s next paragraph. The walkthrough later on this page is an illustration of that idea. It is not a Claude Code configuration, and it is not a configuration anyone at Alchemic Technology ran.

Entry, reduced capability, and recovery

A practical quarantine mode starts with entry triggers. Teams should define a short list, not a giant policy novel. Useful triggers include failed authorization verification, revoked approval, mismatched tool schema version, conflicting source-of-truth data, a guardrail tripwire after the run has already called a tool, an abnormal trace pattern, missing required evidence, stale workspace state, repeated tool failure before an irreversible action, or a human operator’s explicit pause.

Then define what the agent can still do. In quarantine, the system might allow read-only inspection, trace summarization, evidence packaging, user clarification, ticket creation, and rollback planning. It should block actions that mutate customer data, spend money, send external messages, deploy code, alter permissions, or overwrite records. The goal is to keep the run inspectable and to freeze blast radius.

Next, preserve an evidence bundle. A quarantine event should capture the triggering signal, current task, active permissions, recent tool calls, relevant inputs, proposed next action, model output, guardrail result, and an operator-visible explanation. This bundle should be boring enough for an engineer to inspect and structured enough for a dashboard, an audit, or a regression test.

Recovery should be explicit. “The model says it is fine now” is not a recovery path. Acceptable recovery checks include a fresh authorization challenge, a successful schema negotiation, a human approval tied to the new state, an independent validator passing, a tool replay in dry-run mode, or a corrected source-of-truth read. When the run resumes, the trace should show that quarantine ended and which check cleared it.

NIST’s AI Resource Center describes the AI Risk Management Framework as operationalized through four functions: Govern, Map, Measure, and Manage (AI RMF overview; the agency landing page is nist.gov/itl/ai-risk-management-framework). Quarantine mode is one way to turn those verbs into runtime behavior: map the condition, measure a signal, manage the risk by reducing capability, and leave a record a person can govern. The framework does not require a feature with this name. The mapping is this essay’s.

A small team can start with one workflow that has a real side effect: billing support, code deployment, customer outreach, intake, procurement, or data operations. Add one quarantine state to the orchestrator. Add three triggers. Block the two most dangerous action classes. Write the evidence bundle to the same place traces already go. Decide in advance which four numbers to watch: quarantine rate, false-positive rate, time to recovery, and prevented high-impact actions. Those numbers are a measurement plan. This post does not report values for them.

The payoff is operational. Teams can treat these failures as state transitions. Operators get a middle ground between blind trust and a full shutdown. Engineers get a record they can replay. Users get a system that pauses when the trust assumption breaks, rather than a system that improvises through the uncertainty.

Retries help when the world is temporarily flaky. Cancellation helps when a run should stop. Escalation helps when a human must decide. Quarantine covers the space between them: the agent may still be useful for inspection, and it is no longer cleared for normal action.

Illustrative example: a refund that must not send itself

Illustrative example. The order, the emails, the amounts, and the agent name below are made up so the state change is easy to follow. This is not a customer incident, not a log from an Alchemic Technology system, and not a measured result.

The agent is billing-draft. Without a person, it may call get_order and write_internal_note. issue_refund and send_email require a person. The signed-in customer on this session is ada@example.com. The user message is: “Refund order 1842.”

The runtime calls get_order("1842"). The tool returns HTTP 200 and a body that validates against the tool schema:

{
  "order_id": "1842",
  "status": "paid",
  "amount_cents": 4200,
  "customer_email": "other@example.com"
}

The schema check passes: the required fields are present and the types are right. A second predicate, customer_email == session.customer_email, fails. ada@example.com and other@example.com are different customers. The order id in the user’s sentence is not authority to move that other customer’s money.

Entry. The orchestrator sets run.state to quarantine and reason to source_of_truth_conflict. This is not an HTTP error. The tool succeeded. The run is no longer cleared to act on the refund.

Capability while that state holds:

ToolIn quarantineWhy
get_orderAllowedRead-only. A later read is also the recovery check.
write_internal_noteAllowedWrites an operator note. It does not email the customer or move money.
issue_refundBlockedMoves money. Blocked until the recovery checks below pass.
send_emailBlockedExternal message. A draft can wait in the note. The send cannot.

The model then produces: “The order id matches, so I will refund $42.00 to the card on file.” That sentence is stored in the trace. It is not a recovery check. The runtime does not call issue_refund. A PreToolUse-style gate, the same shape as the Claude Code hook named above, is what blocks the call. The model’s sentence does not get a vote.

The evidence bundle for this moment is one record:

{
  "event": "quarantine.entered",
  "reason": "source_of_truth_conflict",
  "task": "Refund order 1842",
  "session_customer_email": "ada@example.com",
  "tool": "get_order",
  "tool_status": 200,
  "observed_customer_email": "other@example.com",
  "predicate": "customer_email == session.customer_email",
  "predicate_passed": false,
  "proposed_next_action": "issue_refund order 1842 amount_cents 4200",
  "proposed_action_executed": false,
  "operator_message": "Order 1842 is paid, but it is not this customer's order. Refund is blocked."
}

Recovery is two checks, and both are required. Neither check is “the model says it is fine now.”

  1. A new get_order("1842") returns a customer_email equal to ada@example.com. If the fresh read still shows other@example.com, the run stays in quarantine.
  2. A person approves issue_refund for order 1842 and amount 4200 after that fresh read. The approval names the order and the amount. An approval from an earlier, different order does not count.

When both checks pass, the trace gets quarantine.cleared with the id of the fresh read and the id of the approval, and only then may issue_refund run. If the person declines, the run stays quarantined and the operator message stands. The agent can still write the internal note. It still cannot email the customer or move the money.

How the documents named above sit next to this story:

  • MCP authorization covers a different entry trigger. If get_order had been rejected because the access token failed, that would be an authorization failure at the protocol boundary. The specification defines that token and protected-resource behavior. The quarantine state in the record above is an application state on top of it.
  • An Agents SDK guardrail can trip on input or on final output, and a blocking tripwire can stop work. The email mismatch here happens after a tool has already returned, which is why the run needs a place to sit other than “retry the refund.”
  • OpenTelemetry’s GenAI conventions are the shared names for model operations. quarantine.entered is an application event this example adds. It is not a span the conventions currently define.
  • The NIST functions are the labels for the work: map the conflict, measure the predicate, manage it by blocking the refund, govern it by keeping the bundle. They are not a requirement that a product ship a button called quarantine.

A team that wants this behavior can implement the predicate, the allow/block table, and the JSON record without adopting any of those products wholesale. The record is the part that makes the pause reviewable the next day.

That state deserves a name, a trace event, and a gate in the runtime.

This essay is one entry in the agent safety and permissions reading guide, next to the posts on cancellation, compensating actions, and revocation.

Sources

Links checked 6 November 2026. Each one was opened and matched to the sentence it supports. Upstream pages can change after that date.

Is your agent ready for real work?

The Agent Readiness Kit turns ideas like these into templates you fill in this week: a permission matrix, approval policy, eval suite, failure drills, incident runbook and a 60-point readiness checklist.

Get the Readiness Kit · $19 →