arXiv(opens in a new tab)cs.CROct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.03448

Passing the Test You Trained On: Re-evaluating Prompt-Injection Detectors for LLM Agents

Zhuowen Liu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

LLM agents increasingly screen tool outputs with small prompt-injection detectors, and teams choose among detectors by their scores on public benchmarks. We ask whether those scores predict how a detector behaves inside an agent. We replay the ground-truth tool calls of two agent benchmarks, AgentDojo and τ-bench, without an LLM to obtain tool outputs that are benign by construction, label injected outputs by differential replay, and evaluate fifteen detectors, including Meta's Prompt Guard 2, and two task-aware LLM judges on these outputs and on the BIPIA benchmark. Detection rankings transfer poorly between benchmarks: the best detector on BIPIA catches 2% of AgentDojo injections at a 1% false-positive rate, and a detector that catches 72% of AgentDojo injections catches 15% on τ-bench. False-positive rates on tool outputs, which range from none to over 90%, do transfer between the two agent benchmarks. Where training data is public, the form of the training inputs explains the results. The BIPIA leader was trained on full BIPIA inputs, but having seen InjecAgent's attack strings as short prompts does not help it find them inside tool outputs; the best detector on both agent benchmarks shares no data with any benchmark and was trained on agent-style inputs. Evaluations meant to inform deployment should use the agent's own tool outputs, report detection at a low false-positive rate, and audit what the detector was trained on.

1 Introduction

LLM agents read email, calendars, web pages, and transaction histories on a user's behalf, and every one of those sources can carry text written by someone else. Indirect prompt injection turns that text into instructions [11]. The cheapest defense to deploy is a detector: a small classifier that screens every tool output before the agent sees it and drops what looks like an injection [5, 15, 21]. It needs no change to the agent or the model, which is why guardrail toolkits ship detectors and practitioners compare them.

The threat is simple to state. An attacker who can write a calendar event description, a product review, or a table cell controls part of what a tool returns; if the detector misses that text, the agent may act on it. If the detector is too eager instead, it drops ordinary tool outputs, and the agent cannot finish the user's task.

How would a team decide which detector to deploy? Detector papers and third-party comparisons report accuracy on prompt collections and injection benchmarks; a 2025 evaluation of nine open guardrails, for example, concluded from BIPIA's email and table tasks that PIGuard detects indirect injection effectively [18]. Two things in this practice are unchecked. First, benchmark text is not what an agent's detector screens. Agents see serialized tool outputs (records, lists, confirmations), and false alarms on those translate into failed tasks, not into a percentage on a balanced test set. Second, nobody checks whether the benchmark overlaps with the detector's training data. Prior work showed that same-source splits inflate scores for classifiers the authors train themselves [9] and argued for low-FPR evaluation [13]; neither audits released detectors or evaluates them where an agent would use them.

We evaluate fifteen detectors, from 2023 DeBERTa classifiers through Meta's Prompt Guard 2 to 2026 models built for agent inputs, together with two task-aware LLM judges, on the tool outputs of two agent benchmarks, AgentDojo [7] and τ-bench [23], and on BIPIA [24]. Our central observation is that a detector works on inputs whose form resembles what it was trained on, and that benchmark scores mostly measure this resemblance rather than a general ability to detect injections.

Making this measurement requires three things that existing benchmarks do not provide. First, benign agent tool outputs with certain ground truth: we replay the benchmarks' ground-truth tool calls without any LLM, which yields tool outputs that are benign by construction. Second, reliable labels for injected outputs: substring matching fails because AgentDojo re-wraps injected text when it serializes outputs, so we label by differential replay against the clean environ-ment. Third, a way to connect performance to training data: we audit the published training data of two detectors against all three benchmarks and against InjecAgent's attacks [25], and we include a judge whose training data predates Agent-Dojo.

The results reverse the conclusions a benchmark-based comparison would draw. Detection rankings transfer poorly: between BIPIA and AgentDojo Kendall's τ\tau is 0.01, and even between the two agent benchmarks it is 0.28. PIGuard catches 95.1% of BIPIA injections at 1% FPR and 2.1% of AgentDojo injections; Prismor catches 72.2% of AgentDojo injections and 15.2% of τ\tau-bench's. False-positive rates on tool outputs, by contrast, range from none to over 90% and are consistent across the two agent benchmarks ( τ=0.67\tau = 0.67). The training data explains the pattern. PIGuard was trained on 1,116 full BIPIA inputs; it also saw 53 of 62 InjecAgent attacks, but only as short prompts, and inside τ\tau-bench tool outputs it detects those attacks no better than ones it never saw (52.1% versus 55.8%). Horizon-Labs shares no data with any benchmark, was trained on agent-style inputs, and leads both agent benchmarks (82.2% and 100.0%) with almost no false alarms. Task-aware judges reach 54–78% on the agent benchmarks, below the best dedicated detectors, and every approach misses whole classes of injections outside its training distribution.

We make the following contributions:

• A methodology for evaluating injection detectors where agents use them: clean replay of ground-truth tool calls for benign outputs, differential replay for injected ones, and task-level block rates ( §4§4).

• A measurement of fifteen detectors and two judges on two agent benchmarks and BIPIA, showing that false-positive behavior on tool outputs is stable across agent benchmarks while detection rankings transfer poorly ( §5.1§5.1, §5.2§5.2).

• Training-data audits and a controlled seen/unseen comparison showing that the form of the training inputs, not overlap in attack strings, decides where a detector works ( §5.3§5.3).

• An analysis of what task awareness, attack goals, and input format change, with the finding that task-irrelevant injections evade every approach outside its training distribution ( §5.4§5.4, §5.5§5.5).

The code that rebuilds every evaluation set from the public benchmarks and reproduces every number in this paper is available at https://github.com/lzwhehe/benign-instruction-bench.

References (18)