Prompt injection probes learn conversation, not just injection contentPrompt-Injection Probes Learn the Conversation, Not Just the Injection
The authors train injection probes with matched negative samples in AgentDojo, reducing false positive rates on seen applications' non-injection conversations from 41–80% to 4–27% across 6 models.
Attackers embed instructions (indirect prompt injection) in tool output content the agent reads, such as files or emails, aiming to induce the agent to execute attacker tasks rather than user requests; the attack uses AgentDojo's six attack templates, and the paper does not study adaptive attacks optimized against probe hidden states.
- First-line defense probes against indirect prompt injection in agents score highly on standard evaluations, but often learn shortcuts such as dialogue position and format, leading to many false positives on tool outputs without injection and driving up second-check costs.
- The authors introduce matched negatives into the training data, including clean twins (uncontaminated copies at the same position in the same task) and look-alikes (samples that preserve the injection format but contain harmless content), forcing the probe to discriminate based only on the attack request.
- In evaluations on 6 open-source models in AgentDojo, for seen apps, this paper's method reduces the median clean twins false positive rate from 80% with standard probes to 17%, while maintaining a 95% interception rate of successful attacks (per Table 1); but detection on unseen apps varies by model.
- Tested only on the single AgentDojo benchmark; mainly targets formatted templates, with other templates used only for testing; detection on unseen apps depends on threshold settings, and the intermediate-layer selection rule is not optimal for all models; adaptive attacks were not tested; cost estimates are based on assumptions.
- Evaluated models
- Qwen3-8BQwen3.5-9BNemotron-Nano-9B-v2Nemotron-3-Nano-30Bgpt-oss-20bGemma-4-31B
- Benchmarks
- AgentDojo
- Metrics
- AUROCTwin (%)Look (%)Instr. (%)Plain (%)Stop (%)second checks per 1M
The paper shows that linear probes for indirect prompt injection with 0.91–0.98 AUROC in standard evaluations can be reproduced by statistics such as conversation position and text length, and do not equal detecting injection. The authors propose adding to training data clean twin samples of the same task, paraphrases with the same format but harmless content, and plain-text attacks without formatting; testing six open-source models from four families on AgentDojo, changing only the training data reduced false positives on injection-free conversations from 41–80% to 4–27%, and on harmless paraphrases from 92–98% to 3–16%. When thresholds are set according to normal traffic, the method still blocks a median of 95% of successful attacks that fool agents, compared to 91% with standard training data. False positives remain low in new applications, but whether attacks are detected depends on the model and threshold settings.
Why it was selectedThe paper shows that high scores on standard evaluations often come from shortcuts such as dialogue position, and adding clean twin samples during training can substantially reduce probe false positives.
Paper analysis
What problem does this paper attempt to solve?
Under standard evaluation, prompt-injection hidden-state probes tend to rely on shortcuts such as conversation position and text format, causing many harmless contents to be flagged as false positives and raising defense costs.
Core problem: Linear probes for indirect prompt injection deployed on agent hidden states achieve high scores on standard evaluations mainly by learning shortcuts such as dialogue position and text format, leading to high false-positive rates on content without injection.
- Scenario and importance: In multi-turn tool-calling agents, to balance latency and cost, systems often use layered defenses where a computationally cheap linear probe acts as the first filter, sending only suspicious tool outputs to a slower, more expensive second LLM check; but benign traffic far exceeds attacks, so probe false positives directly increase the burden of expensive second checks.
- Shortcomings of existing methods: The authors note that standard evaluations label the moment an attack occurs as positive and other moments before and after in the same attack run as negative, so positive and negative examples differ not only in injected content but also systematically in dialogue position and length of text read; dialogue-statistics features alone achieve 0.91–0.98 AUROC.
- Core observation and hypothesis: Classifiers learn any shortcut feature that separates positive and negative examples; standard probes produce high false-positive rates on the corresponding moment of the same task without injection (clean twin) and on text with attack format but harmless content (look-alike), which the authors take as evidence that the probe responds to dialogue stage or format packaging rather than the injection request itself.
- Threat model:
- Attacker goal: Embed instructions in content the agent reads, inducing the agent to perform the attacker's task rather than the user's original request.
- Attacker knowledge and capability: The attacker places injected text in application data (e.g., files or emails) using a specific template format; the paper does not study adaptive attacks optimized against probe hidden states.
- Victim system: Multi-turn agent systems based on open-source language models with tool-calling capability and reasoning enabled.
- Proposed approach: The authors propose training probes with matched negatives, adding clean copies at the same position in the training set to remove position shortcuts, same-format harmless content to remove format shortcuts, and plain-text attack positives to remove the binding between format and label.
What related research exists?
Related work covers indirect prompt injection defenses, hidden-state monitoring, and probe shortcut learning; the authors extend comparative evaluation to multi-agent and deployment-overhead metrics.
Indirect prompt injection and layered defenses
- Attacks and benchmark evaluation: Greshake et al. (2023) proposed indirect prompt injection attacks against LLM-integrated applications; AgentDojo (Debenedetti et al., 2024), InjecAgent (Zhan et al., 2024), and ASB (Zhang et al., 2025) provide end-to-end evaluation benchmarks. The authors relay these works as showing that model capability does not equal robustness.
- Layered defense architectures: Real deployments often pair lightweight detectors such as Prompt Guard (Meta, 2025) with a slower LLM second check (Chennabasappa et al., 2025; Wang et al., 2026).
Hidden-state monitoring and safety probes
- Task drift and internal-state detection: TaskTracker (Abdelnabi et al., 2025) detects task drift via activation differences before and after the model reads external data; Attention Tracker (Hung et al., 2025), InstructDetector (Wen et al., 2025), and PIShield (Zou et al., 2025) classify injection via internal attention or states; Ye et al. (2026) and Yu et al. (2026) use role probes to analyze injected text representations.
- Multi-turn agent probes: Dong et al. (2026) trained hidden-state linear probes on multi-turn AgentDojo agents and reported near-perfect detection performance; the standard probe pipeline in this paper is derived from their implementation.
Shortcuts and probe validity
- Probe spurious correlations: Hewitt and Liang (2019) and Belinkov (2022) note that high probe accuracy does not mean the model represents the property; in safety probes, deception probes have been found to track the conversational context rather than deceptive behavior itself (Goldowsky-Dill et al., 2025; Levinstein and Herrmann, 2025).
- Contrast sets and controlled evaluation: Marks and Tegmark (2024), Gardner et al. (2020), and Kaushik et al. (2020) propose training and evaluating with minimal contrast and counterfactual examples; Li et al. (2026) found on a single multimodal web agent that a metadata baseline can reach 1.000 AUC and recommend same-step contrasts as evaluation controls.
Comparison baselines and benchmarks
- Evaluation benchmark: Uses AgentDojo (Debenedetti et al., 2024), which includes four apps: banking, office, Slack, and travel booking.
- Comparison baselines: Includes the standard linear probe from Dong et al. (2026), a logistic regression probe trained on standard data, a dialogue-statistics logistic regression baseline that does not look at the model, and a pure text classifier based on TF-IDF features.
Positioning of this paper: The authors note that, compared with Li et al. (2026), which analyzed a single multimodal agent, this paper extends the analysis to 6 text agents and multi-turn interactions, breaks shortcuts down into position, length, and format, trains probes that remove shortcuts, and measures the real cost of second checks under realistic deployment metrics.
How does the paper address this problem?
The authors propose adding clean copies, harmless forgeries, and plain-text attack samples to the training set to remove probe reliance on position and format shortcuts.
The authors propose a matched-negatives probe training scheme that, while preserving model computation reuse, removes probe dependence on position and format shortcut features by introducing same-position clean-run copies, same-format harmless announcements, and plain-text attack positives into the training set.
Probe setup and feature extraction
- Detection timing and hidden-state extraction: In multi-turn interactions, each node before an agent action is defined as a moment; when the agent has just read a tool output containing injected text, it is labeled positive, and all other moments are negative. During the model's forward pass at each moment, a forward hook extracts hidden states at every layer at the last token where the agent reply begins in the dialogue template.
- Linear classifier form: For the extracted standardized hidden-state vector h, logistic regression with L2 regularization fits a weight vector w and bias b, outputting the injection probability: P(y=1|h) = σ(wT h + b) where σ is the Sigmoid function and y=1 indicates that the current moment is affected by prompt injection.
Matched negatives and data construction
- Clean twins remove position shortcuts: For each formatted-template attack in a training run, the corresponding moment (clean twin) at the same position in the clean run of that task is added; because the two prompts are identical except for the injected text, the classifier cannot rely on dialogue step or position to distinguish labels.
- Look-alikes remove format shortcuts: Using the same format structure as the attack template (e.g., important_instructions blocks) but replacing the attack task with content from a pool of 80 independent harmless announcements, so format markers no longer indicate attack by themselves.
- Plain-text attacks break the format binding: Positives include plain-text attack tasks with the template wrapper stripped, preventing the probe from assuming that only a specific wrapper structure indicates an attack.
- All clean moments retained: Other moments from attacked runs are kept, and all moments from clean runs are added, ensuring the probe still sees the everyday normal traffic distribution.
Layer selection and training hyperparameters
- Layer selection criterion: The probe is evaluated on a held-out 20% of tasks from its own training data; among all layers within 0.005 of the highest AUROC, the authors select the layer closest to the model's middle depth as the final probe.
- Optimization and hyperparameters: Uses scikit-learn logistic regression with regularization C = 0.05, balanced class weights, and standardized features; the standard probe follows Dong et al. (2026) with the AdamW optimizer, learning rate 10^-4, batch size 64, 5 epochs, averaging logits over 5 random seeds.
Deployment threshold strategies
- Default threshold: The probe triggers an alert when output probability exceeds 0.5.
- Training-app threshold: On normal tool outputs from the training app, the false-positive rate is calibrated to a strict 1%, without using any test-set labels.
- Test-app threshold: On normal tool outputs from half of the user tasks in the test app itself, the false-positive rate is calibrated to 1%, and testing is done on the other half, again without attack-sample labels.
What experiments did the paper conduct?
Experiments across six models compare standard probes and matched-negative-sample probes on false positive rate, interception rate, and secondary-check overhead.
Experimental setup
- Models under test: Tested 6 open-source models from 4 families: Qwen3-8B, Qwen3.5-9B, Nemotron-Nano-9B-v2, Nemotron-3-Nano-30B, gpt-oss-20b, and Gemma-4-31B, all with reasoning enabled.
- Evaluation benchmark and scale: Used AgentDojo v1.2.2, covering 4 applications: banking, office, Slack, and travel booking; approximately 23,000 runs collected per model; the test set includes five types of test cases: real attacks, plain-text attacks, clean twins, harmless look-alikes, and harmless instructions.
- Baseline methods: Compared against the standard linear probe from Dong et al. (2026), a logistic regression probe trained on standard data (LR), a 7-feature conversation statistics baseline, and a TF-IDF logistic regression plain-text classifier.
- Main metrics: AUROC of real attacks versus clean twins, standard evaluation AUROC, trigger rates for each sample type at the default threshold (0.5) (Twin, Look, Instr., Plain), attack interception rate at a 5% false positive rate on clean twins (@5%), and interception rate of successfully defended attacks at the training-application threshold (Stop).
- Judgment and review method: Attack success was determined using AgentDojo's native task success check code; probe outputs were binarized by setting a threshold, without LLM judge scoring.
- Sample sizes and repetitions: Probe training was averaged over 5 random seeds; deployment evaluation was based on 48–163 successful attacks on seen applications and 111–318 successful attacks on unseen applications; confidence intervals used 95% bootstrap with 1000 resamples.
Main results
Swipe horizontally to read the table
Model Standard probe AUROC Our probe AUROC Standard probe Twin(%) Our probe Twin(%) Our probe Look(%) Qwen3-8B 0.94 1.00 70 4 6 Qwen3.5-9B 0.80 0.98 87 4 3 Nemotron-Nano-9B-v2 0.82 0.97 77 16 12 Nemotron-3-Nano-30B 0.87 0.98 82 18 12 gpt-oss-20b 0.95 0.99 67 25 16 Gemma-4-31B 0.87 0.96 89 27 9 Note: Data from Table 4 (seen application setting, default threshold 0.5). AUROC is discrimination against clean twins; Twin and Look are false positive rates on clean twins and harmless look-alikes, respectively.
- Clean twin false positive rate changes: The authors note that on all 6 models tested, after training with matched negative samples, the clean twin false positive rate at the default threshold was lower than that of the standard probe (per Table 4).
- Discrimination changes: The authors note that our probe's AUROC against clean twins ranked higher than the standard probe on all 6 models, while the standard evaluation rated both near 1.00, failing to reflect this difference (per Table 4, Figure 3).
- Format false positive changes: The authors report that our probe also had a lower false positive rate on harmless announcements with the same format wrapper than the standard probe (per Table 4).
Conversation statistics and shortcut decomposition
- What was tested: Trained a logistic regression on 7 conversation statistics (4 positional features and 3 length features, without using model internal states), and evaluated its AUROC on the standard evaluation, clean twins, and harmless look-alikes.
- Results: Achieved 0.96–0.98 AUROC on the standard test (seen applications) and 0.91–0.96 (unseen applications); the 4 positional features alone reached 0.80–0.86; but dropped to 0.65–0.75 against clean twins and 0.59–0.65 against harmless look-alikes (per page 5).
- Authors' interpretation: The authors state that the high scores on the standard evaluation do not mean the probe detected injection, but rather that it exploited AgentDojo benchmark generation characteristics of inserting at specific times and usually increasing text length.
Secondary check cost and interception rate from a deployment perspective
- What was tested: Simulated the test application as a real environment with 1% of traffic carrying attacks, assumed a secondary check takes 1 second, and evaluated the proportion of successful attacks intercepted by the probe and the number of secondary checks triggered per million tool outputs at the default threshold, training-application threshold, and test-application threshold.
- Results: On seen applications, at the default threshold the standard probe triggered 315k secondary checks per million tool outputs (about 88 hours), while our probe triggered 74k (about 21 hours) (per Table 6, Table 11); at the training-application threshold, our probe intercepted a median of 95% of successful attacks, while the standard probe intercepted 79% (per Table 1).
- Authors' interpretation: The authors note that the default threshold is too costly in real deployment; at thresholds strictly controlling the false positive rate on normal traffic, our probe intercepts more successful attacks on seen applications with comparable check overhead, but on unseen applications the detection effectiveness of both is affected by threshold and model.
Unseen application transfer and generalization across different templates
- What was tested: Probes were trained on two applications and tested on the remaining two unseen applications, and harmless text was placed into TODO: and ###(system_message) templates to test format generalization.
- Results: On unseen applications, our probe maintained median false positive rates of 6% and 10% on clean twins and harmless look-alikes (standard probe: 70% and 94%), but the plain-text attack interception rate at the default threshold dropped to 58% (standard probe: 95%) (per Table 1); on other template look-alikes, our probe's false positive rates were 49% (seen) and 21% (unseen), lower than the standard data classifier's 92% and 69% (per page 8).
- Authors' interpretation: The authors note that the format shortcut fix only partially transfers to other templates; on unseen applications false positive rates remain low, but attack detection capability is affected by model characteristics and threshold settings.
Other ablations and analyses
- Training set component ablation (Table 2, Table 7): adding clean twins alone reduced the median twin false positive rate on seen applications from 57% to 22%; adding look-alikes alone reduced the median look-alike false positive rate from 96% to 12%.
- Number of training applications (Table 5): increasing training applications from 2 to 3 changed the AUROC against clean twins on unseen applications by no more than 0.04.
- Probe layer depth (Figure 6): except for Qwen3.5 where its own best layer was earlier (difference 0.08) and Nemotron with a difference of 0.04, the chosen middle layer matched the best layer of Qwen3-8B, gpt-oss, and Gemma-4.
- Plain-text classifier comparison (Table 10): after training on our data, the TF-IDF classifier intercepted 38% of successful attacks at the training-application threshold on unseen applications and 87% at the test-application threshold (our probe: 82% and 74%, respectively).
- Projection of harmless instruction share in normal traffic (Table 11): when normal tool outputs contain 10% harmless instructions, at the training-application threshold on seen applications our probe requires 32k secondary checks per million, while the standard probe requires 33k.
Negative results and exception analysis
- On unseen applications, our probe's median detection rate for plain-text attacks at the default threshold dropped to 58%, lower than the standard probe's 95% (per Table 1).
- At the test-application threshold, the standard probe intercepted a median of 87% of successful attacks on unseen applications, higher than our probe's 74% (per Table 10, Table 11); the authors explain that the strict threshold allowing only 1% false positives is already higher than most clean twins, thereby masking the shortcut.
- For harmless look-alikes of other attack templates (such as TODO: and ###(system_message)), our probe's false positive rates were 49% on seen applications and 21% on unseen applications, still higher than the 11% and 10% for the formatted templates used in training (per page 8).
- On Qwen3.5-9B, the layer selected by the middle-layer selection rule had an AUROC 0.08 lower than that model's own best layer, and both probes had low interception rates on unseen applications (per Figure 6, Table 6).
- In the missed-detection analysis on unseen applications, the authors report that for 4 of the 6 models, the attacks missed by our probe were mainly attacks the agent itself did not follow (per Table 9).
What are some points that can be further explored?
The limitations noted by the authors focus mainly on single-benchmark evaluation, limited template and account diversity, and insufficient validation of unseen-app transfer and adaptive-attack defenses.
Limitations and future directions noted by the authors
- Single benchmark and synthetic traffic assumption: The study uses only the AgentDojo benchmark; other agent environments and real traffic containing more instruction-like text may introduce other shortcuts, and cost estimates for such traffic are extrapolations rather than measurements (from Limitations).
- Limited template coverage: The main training and test look-alikes are based only on the formatted template (important_instructions); other templates are used only for testing, and imitation is tested only in some experiments. The authors note that training look-alikes for each template is a future direction (from §6, Limitations).
- No unseen-app transfer and layer-selection heuristics: Detection performance on unseen apps depends on the model and threshold settings, and the heuristic for selecting intermediate layers is not optimal for some models (from Limitations).
- Deployment cost assumptions and fixed system prompt: Cost estimates assume a second check takes about 1 second and a 1% attack rate; all evaluations use a single default system prompt; labels only mark whether injected text was encountered, not whether the agent complied (from Limitations).
- Attacker account reuse effects: Detection on seen apps may partly rely on the fixed attacker bank accounts or email addresses reused in AgentDojo; this was not tested with fresh random accounts (from Limitations).
- No adaptive attacks or mature text classifiers evaluated: The comparison is against a TF-IDF text classifier rather than trained text detectors such as Prompt Guard; adaptive attacks optimized against probe hidden states were not studied (from Limitations).
Experimental coverage
- Models tested: Covers 6 models from 4 open-source families (Qwen3-8B, Qwen3.5-9B, Nemotron-Nano-9B-v2, Nemotron-3-Nano-30B, gpt-oss-20b, Gemma-4-31B), with parameter counts ranging from 8B to 31B, all with reasoning enabled.
- Evaluation environment and tasks: Covers AgentDojo's 4 built-in apps (banking, office, Slack, travel booking), with about 23,000 runs per model.
- Template types: The test set focuses on the important_instructions formatted template; two prefix templates, TODO: and ###(system_message), are also evaluated in ablations.
- Harmless text scale: Look-alikes and harmless instructions each use 80 candidate sentences, split into disjoint training and test sets of 40 sentences each.
- Classifier structure: The probe is a single-layer linear logistic regression; multi-layer nonlinear probes or attention-head probes were not evaluated.
Summarize the main content of the paper
The authors find injection probes rely on positional and format shortcuts, propose a matched negative sample training scheme, reduce false positives across multiple models, and evaluate the cost of secondary review.
- Research positioning: This study examines hidden-state linear probes used for indirect prompt injection monitoring in multi-turn LLM agents, evaluating the validity of their evaluation protocols and proposing improvements.
- Core problem: Existing standard evaluations have systematic differences between positive and negative examples in interaction turn and text length, so dialogue-statistics features alone achieve 0.91–0.98 AUROC; standard probes therefore learn position and format shortcuts, producing high false-positive rates on dialogues without injection and on formatted harmless text, driving up the cost of LLM second checks in layered defenses.
- Method highlights: The authors propose matched-negatives training, introducing into the training set uncontaminated clean twins at the same position in the same task, same-format harmless text (look-alikes), and unformatted plain-text attack positives, forcing the probe to focus on the semantics of the actual malicious instruction.
- Core results:
- On 6 open-source models in AgentDojo, on seen apps, the proposed probe reduces the median false-positive rate on clean twins at the default threshold from 80% for the standard probe to 17%, and on look-alikes from 98% to 11% (per Table 1).
- Deployed on seen apps with the training-app threshold controlling 1% false positives on normal traffic, the proposed probe intercepts a median of 95% of successful attacks, versus 79% for the standard probe (per Table 1).
- At the default threshold, the standard probe triggers 315k second checks per million tool outputs on seen apps, while the proposed probe reduces this to 74k (per Table 6).
- On unseen apps, the proposed probe maintains low harmless false positives (6% on clean twins, 10% on look-alikes), but plain-text attack detection drops to 58% (per Table 1).
- Conclusion and implications: The authors argue that safety-monitoring probes easily capture data-generation artifacts and recommend that future evaluations must report no-model statistical baselines, comparisons against clean twins, and interception rates of real successful attacks under a fixed false-positive budget.