Study retests 15 prompt injection detectors: benchmark scores poorly predict agent deployment performancePassing the Test You Trained On: Re-evaluating Prompt-Injection Detectors for LLM Agents
Quick read
Evaluation and benchmarksBased on the paper PDF (generated by Gemini); refer to the original
The authors evaluate 15 prompt injection detectors on two agent benchmarks, finding weak ranking transfer across benchmarks, false positives often interrupting tasks, and training input format determining detection effectiveness.
- LLM agents typically use lightweight detectors to filter indirect prompt injections in tool outputs, but the industry commonly selects models based on public benchmark evaluations, without testing whether these benchmark scores reflect detector performance on real tool outputs inside agents and the cost of false positives.
- Without LLM replay, real tool calls from AgentDojo and τ-bench generate benign samples; environment-difference replay labels injected samples; 15 detectors and 2 LLM judges are evaluated on agent outputs and BIPIA, with training data overlap audited.
- Detector ranking transferability across benchmarks is weak (correlation coefficients not statistically significant), while tool-output false-positive rates are consistent across benchmarks; training-data input format determines effectiveness, with BIPIA's top performer PIGuard detecting only 2.1% on AgentDojo (at 1% FPR).
- The tested environments are synthetic simulations, and format changes alter false positive rates; injections all come from benchmark templates, with no adaptive attacks tested; the audit is limited to exact literal overlaps in public training sets, and commercial closed-source detectors are not included.
- Evaluated models
- JasperLSProtectAI v1ProtectAI v2ProtectAI v2-smallTestSavant-LPrompt Guard 1PIGuardPrompt Guard 2 (22M)Prompt Guard 2 (86M)Qualifire SentinelSentinel v2SheltronPrismor-1.5BWolf DefenderHorizon-Labsdeepset/deberta-v3-base-injectionfmops/distilbert-prompt-injection
- Benchmarks
- AgentDojo v1.2τ-benchBIPIAInjecAgentAESLCFineWeb-Edugithub-readmes
- Metrics
- FPRTPRTPR @ 1% FPRAUROC任务阻断率(Tasks)
Researcher Zhuowen Liu at the Japan Advanced Institute of Science and Technology (JAIST) retested 15 prompt injection detectors and 2 task-aware LLM judges in a paper, finding that detection rankings on public benchmarks transfer poorly to real agent scenarios. The study used no-LLM replay of real tool calls from AgentDojo and τ-bench to construct benign outputs, then used differential replay to label injected outputs, and compared on BIPIA. PIGuard, the best performer on BIPIA, detected only 2.1% of AgentDojo injections at a 1% false positive rate, while Prismor, which detected 72.2% of AgentDojo injections, achieved only 15.2% on τ-bench; the Kendall τ between BIPIA and AgentDojo was only 0.01. In contrast, false positive rates on tool outputs remained consistent across the two agent benchmarks (τ=0.67), ranging from 0% to over 90%.
Why it was selectedThe paper retests 15 injection detectors using real tool outputs from AgentDojo and τ-bench, pointing out that public benchmark scores poorly predict deployment performance.
Paper analysis
What problem does this paper attempt to solve?
Public benchmark evaluations fail to reflect the detection rate and false-positive cost of prompt injection detectors on real agent tool outputs, and benchmark rankings exhibit transfer bias.
Can prompt injection detection scores on public evaluation benchmarks predict detectors' real performance inside agents.
- Application scenario and importance: Defending against indirect prompt injection in agent deployments. LLM agents frequently call tools to read untrusted external data; lightweight detectors serve as the simplest defense layer without modifying the model and are widely used to filter tool outputs.
- Existing evaluation shortcomings: Benchmark text formats are disconnected from real tool outputs. Existing benchmarks are mostly balanced text sets, not reflecting the amplification of false positives by structured outputs; and industry evaluations generally do not check overlap between benchmarks and detector training data.
- Threat model: The victim system is an LLM agent with a detector deployed between tools and the agent.
- Attacker capabilities: Controls part of the data returned by tools (A1, e.g., email bodies, calendar descriptions, product names, or spreadsheet cells), and cannot modify user requests, the agent, or the detector.
- Attack goals: Includes action goals, task-irrelevant goals, and task-relevant goals.
- Defense goals: Benign outputs pass through to avoid blocking tasks (G1), and injections are identified at an operating point satisfying G1 (G2).
- Attack scope: Only static benchmark attacks; adaptive attacks are out of scope.
- Core claim of the paper: Detector effectiveness depends on the similarity between input format and training input. Benchmark scores mainly reflect format similarity, not general prompt injection recognition capability.
What related research exists?
The research covers injection detection evaluation methods, safety empirical shortcomings, detection defenses, and multi-layer protection. The authors emphasize that existing evaluations overlook tool output formats and training data leakage.
The paper cites and discusses related work, mainly divided into the following four groups:
- Injection detection evaluation methods:
- Fomin (2026) — trained activation probes on 18 datasets, reporting lower AUROC under leave-one-dataset evaluation than with same-distribution splits;
- Jacob et al. (PromptShield, 2025) — advocated evaluating detectors at low FPR and built an evaluation benchmark;
- Li et al. (PIGuard, 2025) — measured over-defense on benign prompts containing trigger words.
- The authors note the difference from this work: directly evaluating publicly released detectors on tool outputs actually processed by agents, converting false positives into the proportion of blocked tasks, and auditing training-set leakage.
- Machine learning and security research flaws:
- Arp et al. (2022) and Evertz et al. (2026) — catalogued flaws such as data leakage and improper metrics in security empirical research;
- Nasr et al. (2025) — reported that defenses evaluated against static attacks fail under adaptive attacks.
- The authors note that this paper directly measures the overlap between detector training sets and benchmarks, rather than only making indirect inferences.
- Detection defense mechanisms:
- Fine-tuned encoder classifiers — ProtectAI (2024), PIGuard (2025), and Prompt Guard built into LlamaFirewall (2025);
- New-generation agent-oriented detectors — Sheltron, Wolf Defender, and Horizon-Labs released in 2026, trained on tool responses containing injections or incorporating role and source markers;
- Task- and alignment-aware methods — Liu et al. (DataSentinel, 2025) detect injections based on a minimax game, and Jia et al. (AlignSentinel, 2026) use attention-feature separation and instructions aligned with user tasks. The authors' training-free task-aware judge is consistent with AlignSentinel's intuition and is used only for attribution diagnosis.
- Comparison baselines and evaluation benchmarks:
- Baseline methods include 15 open-source or license-protected detection classifiers and 2 quantized LLM judges;
- Benchmark datasets use AgentDojo (2024), τ-bench (2025), and BIPIA (2025); the first two provide tool-call chains, and the latter provides injection contexts.
- Positioning of this paper: The authors position this paper as revealing input-format overfitting and data leakage behind high benchmark scores, and establishing an evaluation standard for real agent operating environments.
- Injection detection evaluation methods:
How does the paper address this problem?
Generate benign outputs via model-free replay, label injections via environment-difference replay, audit training-set overlap, and measure detection performance at a low false-positive-rate operating point.
The paper builds an evaluation benchmark containing benign and injected tool outputs, uses detection rate at a low false-positive-rate operating point as the core metric, and combines training-data audits to analyze the sources of performance.
Data construction and difference-replay labeling
- Deterministic construction of benign samples: Directly execute the real tool-call sequences of 97 tasks from AgentDojo v1.2 and 675 tasks from τ-bench without an LLM; the resulting 339 AgentDojo outputs (AD-Clean) and 1,533 τ-bench outputs (TB-Clean) are benign by construction.
- Difference-replay labeling of injections: Replay the same tool-call sequences after implanting attack payloads at environment injection points, and compare whether the call results match the clean-environment outputs. This design overcomes the problem that AgentDojo serializes multi-line text into YAML and re-wraps and escapes it, causing substring matching to fail completely.
- Attack sample composition: AD-Matched uses 3 attack templates (585 benign and 432 injected outputs); AD-Shift uses 5 other templates (975 benign and 720 injected outputs); TB-Matched implants 62 attack instructions from InjecAgent into τ-bench product names (1,533 benign and 584 injected outputs).
Evaluation metrics and task-blocking measurement
- Low false-positive-rate metric: Use the core metric TPR@1%FPR to represent the proportion of injections correctly identified when the false-positive rate is controlled at 1%. The authors note that the vast majority of outputs processed by agents daily are benign, and the default threshold of 0.5 does not reflect practical value.
- Task-blocking rate conversion: Measure the proportion of tool outputs incorrectly blocked by detectors on AD-Clean and TB-Clean, and treat a task as blocked if any tool output in it is blocked, reporting the task-blocking rate (Tasks).
Detector runtime configuration and task-aware judge
- Unified detector configuration: Run strictly according to each detector's model card specifications, with input truncation lengths ranging from 512 to 2,048 tokens. Sheltron uses an overlapping sliding window with step size 768 and supports role and source markers; Prompt Guard models segment at 512 tokens and take the maximum score.
- Task-aware judge diagnosis: Prompt Qwen2.5-7B-Instruct and Llama-3.1-8B-Instruct (both quantized to 4-bit NF4) with the user request and a single tool output truncated to 6,000 characters, and compute a risk score from the probability ratio between the first generated token being Yes versus No.
Training-data audit method
- Literal matching retrieval: For PIGuard, whose training data is public, normalize text case and whitespace, then search for the first 80 characters of BIPIA attack strings and the first 120 characters of benign contexts; for Horizon-Labs, audit whether the 5 public data sources cited in its training set contain template markers from BIPIA, AgentDojo, or InjecAgent. This method only retrieves exact copies and serves as a lower bound on overlap.
What experiments did the paper conduct?
Evaluating 15 detectors and 2 judge models, finding that detection rankings are uncorrelated across benchmarks, training set format determines effectiveness, and removing formatting reduces default false positives.
Experimental Setup
- Models under test: 15 detectors, covering JasperLS, ProtectAI (v1, v2, v2-small), TestSavant-L, Prompt Guard 1, PIGuard, Prompt Guard 2 (22M, 86M), Qualifire Sentinel, Sentinel v2, Sheltron, Prismor-1.5B, Wolf Defender, Horizon-Labs; plus 2 LLM judge models (Qwen2.5-7B-Instruct, Llama-3.1-8B-Instruct, 4-bit NF4 quantized).
- Datasets and scale: 7,504 general benign texts (about 2,500 each from README, AESLC emails, FineWeb-Edu web pages); AD-Clean (339 benign); AD-Matched (585 benign, 432 injected); AD-Shift (975 benign, 720 injected); TB-Matched (1,533 benign, 584 injected); BIPIA test set (1,200 benign, 2,435 injected).
- Baselines and metrics: FPR, TPR, and AUROC measured at each detector's default threshold of 0.5; TPR @ 1% FPR measured at a 1% FPR threshold; task blocking rates (Tasks) under AD-Clean and TB-Clean are reported.
- Confidence intervals: 95% percentile intervals based on 1,000 stratified bootstrap resamples are reported.
Main Results
The main evaluation results are shown in the table below (per Table 2; TPRs are all measured at the 1% FPR threshold):
Swipe horizontally to read the table
Model Year Parameters AD Task Blocking Rate (%) AD-Matched TPR (%) TB Task Blocking Rate (%) TB-Matched TPR (%) BIPIA TPR (%) Horizon-Labs 2026 308M 0.0 82.2 1.6 100.0 37.7 Wolf Defender 2026 308M 3.1 73.8 0.0 90.8 3.5 Prismor-1.5B 2026 1.5B 17.5 72.2 67.7 15.2 4.0 Prompt Guard 2 (86M) 2025 279M 2.1 69.4 0.0 57.9 10.4 Sheltron 2026 68M 28.9 20.1 6.7 95.2 57.2 PIGuard 2025 184M 59.8 2.1 20.9 52.7 95.1 ProtectAI v2 2024 184M 69.1 0.5 80.3 10.1 0.7 JasperLS 2023 184M 97.9 23.4 99.6 18.7 4.9 (Note: To control length, the table omits intermediate-gradient ProtectAI v1, ProtectAI v2-small, TestSavant-L, Prompt Guard 1, Prompt Guard 2 (22M), Qualifire Sentinel, Sentinel v2, and the judge models; full data in Table 2.)
- Weak ranking transfer across benchmarks: Kendall rank correlation between BIPIA and AD-Matched is 0.01 (p = 1.00), between AD-Matched and TB-Matched is 0.28 (p = 0.17), and between BIPIA and TB-Matched is 0.31 (p = 0.11); none are statistically significant.
- False positives cause high task blocking: At default thresholds, ProtectAI v2 blocks 69.1% of tasks in AgentDojo, and JasperLS blocks 97.9%; but across the two agent benchmarks, detectors' false positive rates on benign tool outputs show consistency (Kendall tau = 0.67, p = 0.001).
- Specialized detectors show clear advantage: Horizon-Labs and Wolf Defender, trained on agent-style data, achieve detection rates above 70% on both agent benchmarks with near-zero false positive rates.
Training Data Overlap Audit and Formal Generalization
- BIPIA data leakage: The audit shows PIGuard's training set contains 1,116 full BIPIA samples, including 65/75 text attacks and 6/50 code attacks from the training half, plus 31% of email contexts and 22% of code contexts (Table 3). Using only test-half attacks, its detection rate at 1% FPR drops only slightly from 97.9% to 95.1%.
- Seen attack strings do not transfer: PIGuard's training set includes 53 attack instructions from InjecAgent (as short prompts), but in τ-bench tool outputs, PIGuard detects 52.1% of these 53 training-seen attacks and 55.8% of the 9 unseen attacks, with no substantial difference.
- Structural transfer without data overlap: Horizon-Labs' training set contains no attack strings or templates from BIPIA, AgentDojo, or InjecAgent, but due to its training format on structured tool outputs, it achieves 82.2% and 100.0% detection rates on AD-Matched and TB-Matched, respectively.
Task Awareness and Attack Goal Coverage
- LLM judge performance: When given the user task, Qwen2.5-7B and Llama-3.1-8B achieve detection rates of 57.4% and 54.3% on AD-Matched (54.3% and 78.3% on TB-Matched), trailing the best-performing specialized classifiers.
- Small model task awareness fails: When given the user task, Sheltron's AUROC rises from 0.86 to 0.91, but its detection rate at 1% FPR drops from 20.1% to 9.0%, and its false positive rate on AD-Clean rises from 10.6% to 26.0% (from 4.4% to 69.7% on τ-bench).
- Task-irrelevant attacks evade: In the BIPIA analysis of 5 attack goal categories (Figure 3), except for PIGuard, trained on full BIPIA, which detects 93%, Prompt Guard 1 detects 39%, and all other methods detect no more than 20% of task-irrelevant attacks.
Impact of Serialization Format and Metadata on False Positives
- Removing markup reduces false positives: After removing HTML and markup from READMEs, PIGuard's FPR drops from 24.6% to 5.6%, and ProtectAI v2's from 9.8% to 4.2% (Figure 4).
- Stripping structural key names: After removing YAML key names from AgentDojo, PIGuard's FPR at default threshold drops from 20.0% to 6.7%, with TPR staying at 73.1% (originally 74.3%). But at the 1% FPR threshold, PIGuard's detection rate only rises slightly from 2.1% to 3.0%, and ProtectAI v2's is 13.2%.
- Source metadata tagging effect: When Sheltron declares the source tag as tool_result instead of generic, AD-Clean false positive rate drops from 28.6% to 10.6%, and TB-Clean from 85.6% to 4.4%.
Other Ablations and Analyses
- Distribution-shifted attack templates (AD-Shift): Horizon-Labs detects 87.9%, Wolf Defender 83.9%, PIGuard 7.9% (Table 2).
- Qwen judge model precision ablation: The 4-bit NF4 quantized version's AUROC on AgentDojo differs from the bf16 version by less than 0.02.
- Excluded detectors: deepset/deberta and fmops/distilbert have 100.0% false positive rates on benign READMEs and block over 75% of AD-Clean outputs, so they were excluded as unusable.
What are some points that can be further explored?
The authors note current limitations in simulated environments, static templates, detector coverage, and judge design; the experiments cover 15 classifiers and 2 agent benchmarks.
Limitations and Future Directions Noted by the Authors
- Simulated agent environment limitations: The tested environments are AgentDojo's synthetic YAML records and τ-bench's JSON outputs based on synthetic databases; real tool outputs (HTML pages, API responses, long documents) are messier, and format changes alter absolute false positive numbers (§6).
- Static attack template limitations: Injection payloads all come from benchmark templates; adaptive attackers aware of the detector or judge mechanism would further lower detection rates, so the measured detection rates are upper bounds (§6).
- Limited detector coverage: The study covers only open-source and license-accessible detectors, excluding commercial closed-source API detectors; only PIGuard and Horizon-Labs have publicly available training sets sufficient for auditing (§6).
- Single task-aware judge prompt: LLM judging costs a 7–8B model forward pass per call, and only a single action-targeted prompt was tested; the authors note that extending prompts to ask about answer changes might cover more attack goals, but with unmeasured false positive costs (§6).
- Literal overlap audit is a lower bound: The overlap audit only matched exact copies; paraphrased rewrites, attacks generated from the same templates, and unpublished training data were not retrievable (§6).
Experimental Coverage
- Detectors and models tested: Includes 15 proprietary classification detectors (22M to 1.5B parameters) and 2 instruction-tuned judge models (Qwen2.5-7B, Llama-3.1-8B); the paper does not test commercial closed-source detection APIs.
- Evaluation benchmarks and environments: Covers 2 agent benchmarks (AgentDojo v1.2's 4 suites totaling 97 tasks, τ-bench's 675 retail and airline tasks), 1 prompt injection benchmark (BIPIA including email, spreadsheet, and code tasks), and 7,504 general benign texts.
- Injection generation settings: τ-bench injections are only placed in retail task product catalog names, using InjecAgent's 62 attack instructions; AgentDojo uses its built-in 8 attack templates.
- Operating point and sampling evaluation: Safety metrics are fixed at the 1% FPR operating point, confidence intervals are based on 1,000 stratified bootstrap resamples; the paper does not report multi-turn interaction blocking performance under optimization for specific adaptive attacks.
Summarize the main content of the paper
The paper reveals that public benchmarks cannot reflect agent detector performance; detection capability stems from input format similarity rather than general defense, and recommends evaluation based on tool outputs and low false positives.
- Research positioning: Evaluate the real-world defensive effectiveness of mainstream prompt injection detectors in the context of agent tool outputs, and test whether public benchmark scores have cross-environment predictive power.
- Core problem: Existing benchmarks use unstructured text and have data overlap, so high scores from evaluations do not reflect detector performance on agent tool outputs or the cost of false-positive blocking.
- Evaluation method: Build benign tool outputs via LLM-free replay of real calls, construct and label injection samples via environment-difference replay, compare 15 detectors and 2 LLM judges at a 1% FPR operating point, and audit training-set overlap.
- Key experimental findings: Detector rankings show weak transferability across benchmarks (correlation coefficients 0.01 to 0.31); PIGuard, which achieves 95.1% detection on BIPIA, detects only 2.1% on AgentDojo; Horizon-Labs, trained on agent-style data with no data overlap, achieves 82.2% (AgentDojo) and 100.0% (τ-bench) detection; detectors also show false-positive rates on tool outputs ranging from 0% to over 90%, which can interrupt up to 69.1% of benign tasks.
- Mechanism and implications: Detector effectiveness depends heavily on the similarity between input data format and training set, rather than on a general understanding of injection instructions; detection defenses for agent deployment should be evaluated on real tool outputs with low false-positive rates as the benchmark, strictly audit training-data leakage, and use detectors as a filtering layer in defense-in-depth.
Related papers
Show 3 more papers
- Deletion, Substitution, Repair and Transplant: Component Attribution in BARBICAN, a Layered Prompt-Injection Gateway for MCPAnalysis / interpretabilityarXiv