Most guardrail comparisons are a feature table written by whoever is selling one of the products. This one is a benchmark run, on one machine, with the result file checked into the repository. It is also a comparison we lose part of, so it seems worth being clear about that up front.
What we ran
llm-guard is the most widely used open source prompt-injection scanner. It takes text and returns a score. AgentFox containment is a different kind of control: it decides whether a tool call may proceed, from the grant the agent holds and the provenance of each argument. It never looks at the payload.
AgentDojo gives both of them the same work: 588 attack pairs, where an injected instruction arrives inside a tool result, and 97 benign tasks the agent is supposed to finish. An arm is scored on both. Stopping every attack by refusing everything is easy and useless, so the benign column is the one that keeps the attack column honest.
The four arms
Four configurations, same harness, same traces. Attacks through is lower-is-better. Benign tasks finished is higher-is-better.
At its default threshold, llm-guard alone let 86 of 588 attack pairs through, and it finished 42 of 97 benign tasks. With detectors switched off entirely, AgentFox containment let 0 of 588 through, and finished 24 of 97 benign tasks. Run both and no attack survives either, but the pair finishes 11 of 97, which is the worst benign score on the board.
Where llm-guard beats us
It gets more work done. Forty-two finished tasks against twenty-four is not a rounding difference, and if your agent does something low-stakes where a blocked call costs more than a leaked row, that difference is the whole decision.
The reason is in how the two controls fail. A detector that is unsure lets the text past, because its job ends at a score. Containment that is unsure escalates to a person, because its job ends at an action that cannot be taken back. We chose the second behaviour deliberately, and the benign column is what it costs. We publish that column on the benchmark page next to the attack column, in the same table, at the same size.

Why tuning does not close the gap
The obvious reply is that we ran llm-guard at its defaults and defaults are nobody's production config. So we swept the threshold.
Hold its false positive rate on clean text at 5% or below, which is roughly the most a team will tolerate before they turn the thing off, and it still lets 389 of 588 through. Push the threshold the other way until it stops every attack, and it only gets there once the text is chunked and tuned on the test set, at which point it flags 130 of 339 clean outputs. That is more than a third of normal traffic interrupted.
This is the shape of every detector result we have run, and it is not a criticism of llm-guard specifically. A classifier trades recall against precision along one dial. Somewhere on that dial is a setting you can ship, and that setting lets attacks through, because the attacks that matter are the ones phrased to look ordinary. We wrote about the general case in why detection is a speed bump.
What the catching costs
The number that gets left out of detector comparisons is what the detector does to traffic that was fine. At its default threshold llm-guard flagged 82 of 339 clean tool outputs. Roughly one in four normal results is treated as an attack.
Nobody runs that for long. They raise the threshold, the false positives fall, and the attacks that were already slipping through slip through more easily. The dial does not have a setting that makes both columns good, which is the point of showing the sweep rather than one row from it.
Latency
A detector runs a model. A containment check runs a comparison. On the same traces, llm-guard added 71.9 ms at the median against our 6.9 ms, and its tail is longer still. If you are checking every tool call in an interactive session, that difference is the one your users feel. There is a fuller breakdown in the latency study.
Which one you want
If your agent only reads and summarises, a detector is a reasonable and cheap control, and llm-guard is a good one. Nothing it can get wrong is permanent.
If your agent sends, writes, pays, deletes or deploys, the question stops being whether the text looked suspicious. It becomes whether this agent was ever entitled to make this call with these arguments. That question has an answer that does not depend on recognising the attack, which is why we build the second control and measure it against the first in public.
Running both is defensible if you can live with the benign column. We would rather you picked that knowingly than discovered it in week three.
Frequently asked questions
Is AgentFox an alternative to LLM Guard?
They do different jobs. LLM Guard reads text and scores how likely it is to be an injection. AgentFox containment decides whether a tool call is allowed given what the agent was granted and where its arguments came from. You can run both, and on AgentDojo running both stops every attack but finishes the fewest benign tasks of any arm we measured.
Does LLM Guard stop prompt injection?
Partly. On AgentDojo's 588 injection pairs, llm-guard at its default threshold let 86 through. Lowering the threshold catches more attacks and flags more clean text, and no threshold we swept both kept false positives under 5% and closed the gap.
Which completes more legitimate tasks?
LLM Guard. At its defaults it finished 42 of AgentDojo's 97 benign tasks against AgentFox containment's 24. Containment is stricter because it escalates to a human rather than guessing, and that is a real cost we publish next to the win.
Why does a detector miss attacks a permission check catches?
A detector has to recognise the attack in the text. A containment check never reads the payload: it compares the tool being called and the provenance of its arguments against what that agent was granted. An attack phrased in a way no classifier has seen still has to call a tool it was never allowed to call.
Can I reproduce these numbers?
Yes. The runner and the result file are in benchmarks/head_to_head/ in the repository, and every figure on this page is bound to that result file, so a rerun that moves a number fails our CI before it reaches the site.


