Guardrails, in plain words.
Meta's own paper puts its prompt-injection classifier at 88.7% recall at a 1% false-positive rate; an independent benchmark puts the same model near 1% when the injection is buried in tool output instead of typed by a user. Both numbers are real, and the gap between them is the entire lesson: a guardrail is a classifier with an operating point, not a wall, so its strength is only ever "what gets through at the false-positive rate I can actually afford". Which is why the one check that must never be probabilistic is the one standing in front of the irreversible action.
Step 1A guardrail is a check you own, not a property of the model.
People say "the model has guardrails" and mean two different things. One is built-in behaviour the lab trained into the weights: the model tends to refuse certain prompts. That is a model property — useful, but not something you control, and it leaves when you change models. The other is the kind this entry is about: a piece of code you write that wraps a model call. Input passes a pre-check before the model sees it; output passes a post-check before your application uses it; a tool call passes an action-check before it fires. The model did not change — you put gates around it.
The distinction matters because the failure modes differ. Built-in refusals are jailbroken by clever prompting, which is a research problem you cannot schedule. Wrapped checks fail in boring, fixable ways — a regex was wrong, a classifier was undertrained, a rule was missing. The pleasant news is that the boring failures are the ones you can fix. The unpleasant news, and the subject of the rest of this page, is that most wrapped checks are themselves models, and a model inside your guardrail inherits every property you were trying to defend against.
A useful test: if your "guardrail" disappears the moment you switch model, it was never a guardrail — it was a model property you were hoping for. Real guardrails are code you own, sit outside the model, and survive a swap.
Step 2Three places they live — and only one of them can say no and mean it.
Every guardrail in production sits in one of three positions relative to the model call, and most systems use all three:
- Input guardrails run before the model. They reject or rewrite what comes in: block text that looks like an injection attempt, redact PII before it reaches a provider, refuse known-banned categories. Cheap, and they let you fail without spending a model call.
- Output guardrails run after the model. They inspect the completion before your app uses it: drop unsafe output, catch leaked secrets, reject anything that fails a schema check.
- Action guardrails run between the model's proposed tool call and the side effect. Is this destination on the allowlist? Is the amount under the daily cap? Has a human approved this class of write?
The three are not interchangeable, and the reason is not where they sit but what kind of judgement they make. An input or output check almost always asks a semantic question — "is this text an attack?", "is this answer harmful?" — and semantic questions get answered by classifiers, which means by probabilities. An action check can ask a structural question: is this exact string in this exact list, is this integer below this integer. That check has a false-positive rate of zero by construction, it cannot be talked out of its answer, and it is the only layer in the stack where "no" is not a confidence score. Everything else is triage.
So the layering is real but asymmetric. Input filters thin the traffic; output checks catch the model's own mistakes; the action check is what actually bounds the damage, and it is the one you should be unwilling to make clever. See reference monitor for the general shape and auto-approval and allowlists for how that list is maintained without becoming a rubber stamp.
Step 3Read the operating point, not the headline score.
Guardrail vendors publish AUC, which is a summary across all thresholds and tells you nothing about the one you will ship. The number you need is a pair: catch rate at a stated false-positive rate. Meta's LlamaFirewall paper (May 2025) gives Prompt Guard 2 at 22M parameters an English AUC of 0.995, recall of 88.7% at a 1% false-positive rate, a multilingual AUC of 0.942, and about 19 ms per classification; the 86M model is reported higher on both axes and slower. Take that pair at face value and work out what it means on your traffic:
20,000 checks/day, 1% FPR, 88.7% recall, 50 real attempts/day
false blocks 19,950 benign x 1% = ~200 legitimate requests blocked/day
missed attacks 50 x (1 - 0.887) = ~6 attacks through/day
caught 50 x 0.887 = ~44
tighten the threshold to catch 5 more:
recall 0.887 -> 0.98 costs roughly 5-10x the FPR
false blocks ~1,000-2,000/day = the product is now broken
Two things fall out of that arithmetic. First, 200 false blocks a day is already a support queue, so the FPR — not the recall — is what decides whether you can deploy the thing at all; your real operating point is chosen by what your users will tolerate, and the catch rate is whatever is left. Second, the threshold is a product decision with a dial, which is why it belongs in the same conversation as decision-model thresholds rather than in a security review.
Then there is the harder problem: that 88.7% was measured on a distribution, and yours is different. A reproducible third-party benchmark built from AgentDojo-style injections reports Prompt Guard 2 catching on the order of 1% of 629 attacks at its default threshold when the injection arrives buried in tool output rather than in a user turn, rising to roughly a third on unseen domains once the threshold is retuned to a 2% false-alarm budget. Nothing is contradictory here — it is the same classifier, a different input distribution, and a different threshold — but it does mean a published recall figure transfers to your system only if your attack surface looks like the evaluation set. For agents it usually does not, because the dangerous text arrives from a retrieved page or an API response, not from the person typing. Measuring this on your own traffic is the subject of evaluating guardrails and detectors.
Step 4Against an attacker who reads your defence, the number moves by an order of magnitude.
Everything above assumes attacks arrive as a fixed distribution. Real ones adapt. In The Attacker Moves Second (Nasr, Carlini, Sitawarin, Tramèr and colleagues, October 2025; USENIX Security 2026), the authors re-evaluated twelve published jailbreak and prompt-injection defences across four families — prompting, adversarial training, detector models, and secret-knowledge checks — against attackers allowed to tailor their approach to each defence's design and spend real optimisation effort. Most of those defences had originally reported attack success rates near zero. Under adaptive attack, most exceeded 90%. Detector models held up better than the rest and still broke: the paper reports 71% against one of them.
The paper's own exclusion is the most useful sentence in it. The authors did not include designs that fix an agent's plan before it reads untrusted content, because those attacks mostly cannot change what such an agent does. That is the whole finding restated: detection scales with how much the attacker knows about your detector, and constraint does not. A filter is a guess about text. An allowlist is a fact about capability.
So the honest claim about an input guardrail is narrow and still worth something: it raises the cost of casual and automated attempts, it gives you a signal to alert and rate-limit on, and it buys time. The dishonest claim is that it makes the class of attack go away. Design as if every probabilistic check will eventually be passed, and ask what the agent is then able to do — which is the question blast radius is for.
Step 5What to actually build.
The shape that holds up has two stages for the probabilistic part and a hard stop for the rest.
- Cheap classifier first, expensive policy second. A small detector at tens of milliseconds triages everything; a slower policy-aware model adjudicates what it flags. This is not a thrift measure — it is what OpenAI describes doing internally, pairing its Safety Reasoner with smaller, faster classifiers for triage. The open-weight version of that reasoner,
gpt-oss-safeguard(October 2025, 120b and 20b), takes the policy as text at inference time instead of baking it into weights, which is the one genuine advance in this category: you can change a policy without retraining a classifier. - Buy the broad classifiers, build the specific rules. Do not try to out-train a lab on toxicity or PII; do not expect a bought guardrail to know what "approved" means in your workflow. Your allowlists, your caps, your schemas, your approval classes — those are yours and they are the ones that bound damage. Product-level comparisons of the bought half live in Lakera Guard vs Prompt Guard 2 vs Prompt Shields vs ProtectAI DeBERTa and NeMo Guardrails vs Guardrails AI vs Llama Guard vs LLM Guard.
- Decide what a failed check does. A guardrail that times out and is skipped is not a guardrail; a guardrail that fails closed on a transient error is an outage. Choose per check, write it down, and test it — see fail-closed and fail-open.
- Remove the capability instead of filtering the request, where you can. Meta's "Agents Rule of Two" (October 2025) is the compact version: within one session, an agent should hold at most two of untrusted input, access to sensitive data, and the ability to change state or communicate externally. Dropping one of the three is a structural fix that no classifier accuracy can substitute for. The failure mode it names is the lethal trifecta.
Do these three in one sitting. Write down the stated catch rate and false-positive rate of every classifier you run, then compute false blocks per day on last week's volume — if you cannot state both numbers, you do not know what the check does. Second, list every tool call that is irreversible (money moves, messages leave, data is deleted) and confirm each one is gated by a structural check — an allowlist, a cap, a human — and not by a model's opinion. Third, pick one irreversible path and inject an attack into a tool result rather than a user message; that one test tells you more than any vendor benchmark, because it is the distribution your agent actually lives in.
The operational version — layering, monitoring, and the pitfalls at scale — is Operations · Safety & Security · Guardrails. The reason none of this is solvable at the text layer is prompt injection, in plain words, with the current state of defences in prompt-injection defence in 2026.