Skip to content

What a guardrail does when its detector fails

We coded what 16 guardrail libraries, gateways, frameworks and agent hooks do when a detector errors or times out. Five let the call through, one of them ours.

The AgentFox team7 min read

Default on detector error by component: libraries mostly raise, hub integrations mostly closed with seven open each, all four agent hooks open.

The short answer

A guardrail decides whether a prompt, an output or a tool call may proceed. The question this post answers is what it does when it cannot decide: the classifier raises, the moderation API times out, the judge returns something that does not parse. A guardrail that fails open in that moment is one an attacker only has to make busy. We coded the shipped defaults of 16 guardrail libraries, gateways, frameworks and agent hooks and found that on a detector error, 5 let the call proceed, 7 raise to the caller, 3 block and 1 mixes both. The paper, accepted at the Trustworthy and Aligned AI workshop of IEEE BigData 2026, is on the research page.

What we coded

Sixteen systems at pinned commits, 98 rows, with the error case and the timeout case coded separately for each detector or integration. Fifteen are open source; Claude Code's hooks were coded from their documentation. All coding was done by LLM agents and no human checked every row, which the paper says in its first paragraph. Two checks stand in for that: 27 rows were confirmed by fault injection, making the detector fail and watching what the system did, and a second agent run recoded 19 random rows with a Cohen's kappa of 0.63 (95% interval 0.40 to 0.85), a measure of run-to-run consistency and nothing more.

Where fail-open sits

Stacked bars of the default on detector error by component: libraries mostly raise, framework cores and gateway cores split between closed and open, NeMo and LiteLLM hub integrations mostly closed with 7 open each, and all four agent hooks open.
Default on a detector error, by where the component sits. Open means the call proceeds.

The pattern is not by vendor but by layer. Detector libraries mostly raise: the caller gets an exception and has to decide. Framework cores block. The open defaults concentrate in three places: agent hooks, where all four coded hook runners let the call through when the hook fails; gateway cores, three of five; and the integrations inside hubs whose own core fails closed, where 7 of 22 NeMo Guardrails integrations and 7 of 52 LiteLLM detector hooks allow on error. An operator who reads "fails closed" on the hub and then wires in a detector through it may be running a check that does not hold.

Six ways a failure escapes control

The paper lists six, each with execution evidence. In short:

  • No time bound. Nine systems have a detector path that waits forever, so a slow detector is not a failure, it is an outage of the agent.
  • A timeout that does not bound latency. One service sets the status code to timed out but returns only after the scanner ends.
  • The check runs beside the action. One SDK runs input guardrails in parallel with the agent's turn by default; with a tool that records its calls, a guardrail that tripped after half a second tripped after the tool had run.
  • Failures labelled as successes. Two scanners in one library return a fallback result when their LLM call fails and mark it a success, so a caller checking the status cannot tell a failed check from a passed one.
  • Partial open paths inside systems that are closed on the main path.
  • A declared fail mode that does not cover errors. That one was ours.

The bug in our own guardrail

AgentFox is one of the sixteen, and the paper says so with the conflict of interest. At the commit we coded, a detector that raised was allowed even with fail_mode set to closed: the switch covered a detector that timed out, not one that errored. We found it during the study, fixed it, and report it as found. The shipped default is still open, with a 40 ms budget per check, because an unreachable detector should not take a production agent down by default; the point is that closed now means what it says, and a failed check is recorded as failed. The setting is described in the configuration reference.

What to ask a guardrail vendor

The paper's recommendations are four, and they double as questions for any vendor:

  1. Is the fail mode declared, per check, for errors and timeouts separately? Kubernetes admission webhooks and Envoy's authorization filter default to fail closed and say so in their schema. A check that guards a state-changing tool call should default closed; one on a read-only step may default open, in writing.
  2. Is the verdict three-valued? Allow, deny, and unknown. A detector that could not answer must not be reported as one that passed.
  3. Does the timeout bound latency? Not the status code, the wall clock.
  4. Does a failed check reach the audit record? With the detector, the cause and the decision taken, so an auditor can see every call that went through unchecked.
detectors:
  injection_classifier:
    timeout_ms: 150      # time to a decision
    on_timeout: deny     # allow | deny | escalate
    on_error: deny
    on_malformed: deny   # 200 body, no verdict
  pii_service:
    timeout_ms: 400
    on_timeout: allow    # chosen and audited
    on_error: escalate
verdict_values: [allow, deny, unknown]
audit:
  on_unknown: record     # detector, cause, decision

The paper's table names each system and its class. The per-hook evidence stays private until the maintainers have had time to respond to the reports, and the data will be released after that. Where we lose is in the same table: our default was open, and our closed mode had a hole.

Frequently asked questions

What does fail open mean for an AI agent guardrail?

When the detector behind the guardrail raises an error or times out, the call it was checking proceeds as if it had passed. Of 16 guardrail systems we coded, 5 do this by default on a detector error, 7 raise the error to the caller, 3 block, and 1 mixes both.

Which kinds of guardrail fail open most?

Agent hooks, gateways and the integrations inside hubs whose own core fails closed. 7 of 22 NeMo Guardrails integrations and 7 of 52 LiteLLM detector hooks allow the call on a detector error. Detector libraries and framework cores mostly raise or block.

Did AgentFox fail open?

Yes, in one case: at the commit we coded, a detector that raised was allowed even with fail_mode set to closed, because the switch covered timeouts and not errors. We found it during the study and fixed it; the paper reports it as found.

How reliable is the coding?

All coding was done by LLM agents, no person checked every row. 27 of the 98 rows were confirmed by fault injection, and a second agent run recoded 19 random rows with a Cohen's kappa of 0.63, which measures run-to-run consistency only.

Try AgentFox on your own agent

One command finds your agents. It starts in watch mode, so nothing is blocked until you say so.

uvx agentfox scan