Researchers propose a prompt injection detection framework for email agents based on attack chain modelingPrompt Injection Detection for Email Agents Through Attack Chain Modeling
The authors model email injection detection as an attack chain; on five binary classification benchmarks, the strict policy achieves an average F1 of 0.406.
The attacker induces tool calls and unsafe parameters through untrusted email content retrieved by the email assistant, causing the assistant to perform email operations that deviate from the user's request. The paper does not explicitly use knowledge-setting terms such as black-box or white-box.
- Untrusted emails can affect the assistant's subsequent tool use. The authors argue that judging only whether the text is malicious can obscure the stage at which an attack is interrupted, and can easily overestimate detector performance after distribution shift.
- The authors decompose retrieval, defense bypass, tool invocation, parameter correctness, and full success into attack chain labels, then use logistic regression to fuse text, stage verification, rules, and signals of consistency between user requests and actions.
- Across five binary classification benchmarks, the framework's strict policy averaged F1 of 0.406, with the highest among frozen detectors at 0.216; however, the framework's recall on NVIDIA Agentic IPI was 2.33%, lower than the zero-shot LLM judge.
- The authors propose evaluating in a real email agent pipeline and expanding the scale and diversity of benign hard negatives. The current report covers offline detection and label prediction; the paper does not report inference time, annotation agreement, or the impact of false rejections on task completion.
- Evaluated models
- Proposed framework
- Benchmarks
- LLMail-InjectBIPIA generated binaryNotInjectNVIDIA Agentic IPIPromptShieldShieldLMNeuralchemy
- Metrics
- F1precisionrecallROC-AUCfalse-positive rate
The researchers propose a prompt injection detection framework for LLM email assistants, modeling the attack as a staged chain rather than a simple binary classification of malicious text. The framework combines text detectors, stage-specific validators, explicit rule-based risk signals, user intent and action consistency analysis, and a logistic decision policy, and derives attack chain labels from prompt injection datasets. In experiments with random splits, temporal stage transfer, conditional stage transfer, cross-dataset transfer, and ablations, the results show that random train-test splits significantly overestimate robustness under distribution shift, and that later tool-parameter stages in the framework are more predictable than earlier stages. On five binary classification benchmarks, the framework achieves an average F1 of 0.406 under a strict threshold policy, while the strongest of five pretrained detectors without additional training achieves 0.216. The study also shows that training with benign emails similar to attacks helps reduce false positives while retaining the ability to detect real attacks.
Related events and news
1 events · 1 news mentions
News that mentions this paper
Adversa AI 汇总 10 月 AI Agent 安全资源
- Adversa AIcites the paper's id or linkAdversa AI 汇总 2026 年 10 月 AI Agent 安全资源 49 项
Prompt injection detection for email agents through attack chain modeling
Paper analysis
What problem does this paper attempt to solve?
The authors hope email injection defenses simultaneously identify attack-chain stages, control benign false positives, and handle distribution shifts.
The core problem is how to prevent untrusted emails from inducing unauthorized tool operations while avoiding misclassifying normal emails as attacks.
- Application scenario: The email assistant places retrieved results into the model context and then performs email or calendar operations. The authors believe that malicious content may cause the assistant to deviate from user intent, sending unauthorized emails or leaking information.
- Existing setup: The authors believe that binary text detection obscures the distinctions between retrieval, defense bypass, tool invocation, and parameter correctness; random splits may also retain scenario templates, overestimating transfer performance.
- Threat model: The victim system is an email assistant that uses tools; the attack entry point is retrieved untrusted email content, with the goal of inducing unsafe email actions. The paper does not explicitly name the attacker knowledge setting; it also tests evasion modifications when the detection model is known.
- Core observation: The authors distinguish between "looks like an attack" and "ultimately executes a harmful action," and focus on difficult negative examples that contain suspicious wording but are actually benign.
- Proposed approach: Fuse text detection, stage verification, rule-based risk signals, and analysis of consistency between user intent and actions, outputting a risk score for human review or pre-execution blocking/confirmation.
What related research exists?
Related work is divided into indirect injection benchmarks, text detectors, and tool agent defenses; the authors connect them to stage modeling.
The paper positions its method among three groups of work: indirect injection benchmarks, detection models, and tool-agent defenses.
Indirect prompt injection benchmarks
- BIPIA, Tensor Trust: BIPIA covers external content scenarios such as email Q&A and proposes boundary-aware and explicit reminder defenses; Tensor Trust collects human attacks and defenses from online games, studying prompt extraction and hijacking.
- NVIDIA Agentic IPI, LLMail-Inject: The former provides synthetic indirect injection scenarios in tool outputs; the latter provides adaptive submissions and target flags in an email assistant challenge, and is the source of the paper's attack chain labels.
Prompt injection detection and false positives
- Ji et al. (2026): Concatenates semantic embeddings from pretrained DeBERTa-v3-base with handcrafted heuristic features, then uses a neural classifier to judge injection.
- InjecGuard, NotInject: Study over-defense when benign inputs contain suspicious words; train detectors by constructing benign samples around trigger words. The authors state this inspired the difficult negative evaluation protocol in this paper.
- Baseline methods and data: This paper runs ProtectAI DeBERTa v1/v2, deepset DeBERTa injection, TestSavant tiny, Arkaean DistilBERT, and compares with the framework on the same LLMail, BIPIA, NotInject, NVIDIA Agentic IPI, PromptShield, ShieldLM, and Neuralchemy test data.
Tool-agent evaluation and structural defenses
- AgentDojo, InjecAgent: The former evaluates injection attacks and defenses in tool-agent tasks; the latter covers attacks that directly harm users and steal privacy.
- StruQ, CaMeL: The paper summarizes these as structural defenses emphasizing instruction-data separation and control-flow tracking; the authors state this inspired user-intent consistency and action-risk checks.
The authors position their distinction as: predicting multiple stages of the attack chain and checking whether actions requested by untrusted content exceed the user's request, rather than only outputting a malicious text label.
How does the paper address this problem?
The framework uses logistic regression to fuse text, stage, rule, and action consistency signals, and sets separate review and strict thresholds.
The attack chain detection framework converts email inputs into multiple sets of risk signals, which are then fused by a logistic regression meta-classifier into a single score. Defense decisions are positioned before the execution of potentially unsafe email tool actions, but experiments are offline evaluations.
Attack chain labels
- Six labels: Parsed from LLMail-Inject's target fields: email retrieved, defense bypassed, tool invoked, target address correct, content correct, full success.
- Conditional stage modeling: Only predict the next stage in samples where the preceding stage has already occurred, e.g., predict address or content correctness in samples where the tool has been invoked.
- Binary proxy labels: Cross-dataset experiments additionally use LLMail's attack/benign proxy labels; these are not the same prediction target as the full success label.
Text detection and stage verification
- Text baseline: Uses TF-IDF word unigrams and bigrams with a linear logistic classifier trained by SGD; at most 30,000 features, min_df=3, max_df=0.98, with L2, alpha=1e-5, and balanced class weights.
- Framework text channel: Uses word-level and character-level TF-IDF, with training data including LLMail, BIPIA, NotInject. The paper does not provide the full settings for character n-grams.
- Stage channel: Verifiers predict defense bypass, tool invocation, address correctness, and content correctness; NotInject serves as negative stage samples. The full success verifier is retained, downweighted, or excluded in different variants.
Rules and action consistency
- Explicit risk signals: Checks instruction override, tool action language, and obfuscation, and uses handcrafted features such as length and punctuation.
- Contextual relationships: Compares user requests with retrieved content, identifying send-email requests, new recipients, target address mentions, boundary control markers, and tool actions requested by untrusted content that the user did not request.
- Fusion strategy: The logistic regression stacking strategy is trained on held-out validation scores. The Figure 1 caption describes how these channels feed into the meta-policy, which then selects review or strict decisions.
Two decision thresholds
- Review policy: Selects a threshold to maximize validation F1, used for screening and review; the final configuration uses a selective stage configuration without the full success verifier.
- Strict policy: Sets a low false-positive threshold via the NotInject validation set, used for pre-execution blocking or confirmation; the final configuration uses all stages plus action/context configuration.
- Difficult negative rotation: NotInject is split into three groups, rotated for training, threshold setting, and testing. The paper does not provide a unified numerical threshold or complete low false-positive budget for the framework's strict policy.
What experiments did the paper conduct?
The strict policy outperforms the average F1 of the five frozen detectors, but recall is low on NVIDIA, and the LLM judge is overall better.
Evidence includes offline stage prediction, cross-dataset detection, component ablations, and evasion modification tests; results vary considerably across datasets.
Experimental Setup
- Methods under test: The framework's text/rule, all-stages, selective-stage, action/context, and combined variants; a nonlinear stacker is also compared.
- Model baselines: ProtectAI DeBERTa v1/v2, deepset DeBERTa injection, TestSavant tiny, and Arkaean DistilBERT are all evaluated frozen; Complement Naive Bayes and zero-shot gpt-4.1-mini are also included.
- Data scale: LLMail Phase 1/2 has 370,724/90,916 rows; BIPIA generated binary has 176,200 rows; NotInject has 339 rows, all benign (Tables I, II).
- Other data: NVIDIA Agentic IPI has 1,272 rows, all attacks; PromptShield, ShieldLM, and Neuralchemy have 43,425, 54,162, and 6,274 rows, respectively (Table II).
- Metrics and labels: F1, precision, recall, ROC-AUC, and FPR are reported; stage labels come from the LLMail target field. gpt-4.1-mini outputs attack probability and rationale, with a default threshold of 0.50, and a strict threshold is also set using NotInject.
- Splits and repeats: Includes stratified random splits, Phase 1→2, conditional stage, and cross-dataset transfer. Table VI reports the mean and standard deviation over three NotInject rotations; a fixed first round is also reported over five random seeds.
Main Results
According to Table VII, the strict policy comparison under the same test samples and three NotInject rotations is as follows. Average F1 summarizes five binary classification benchmarks; NVIDIA is attack recall, and NotInject is benign false positives.
Swipe horizontally to read the table
Method Average F1 NotInject FP/339 (FPR) NVIDIA Recall BIPIA F1 ProtectAI v2 0.216 13 (3.83%) 0.00% 0.000 TestSavant tiny 0.130 8 (2.36%) 0.00% 0.000 ProtectAI v1 0.114 3 (0.88%) 0.00% 0.000 Arkaean DistilBERT 0.094 5 (1.47%) 0.00% 0.000 deepset DeBERTa 0.014 6 (1.77%) 0.00% 0.013 Framework: all stages + action/context 0.406 7 (2.06%) 2.33% 0.732 - Comparison scope: The authors report that the framework's average F1 and BIPIA F1 are higher than those of the five frozen detectors; some baselines have fewer benign false positives. This table does not list all results for each of the five benchmarks.
- Policy trade-off: The review policy uses a different configuration, with NVIDIA recall of 100.00% and NotInject FPR of 27.73% (Table VIII); its recall cannot be combined with the strict policy's false positives in a description.
Stage Transfer and Attack Chain Distribution
- Random vs. transfer: Full success prediction F1 changes from 0.167 under random splits to 0.000 under Phase 1→2; with a Phase 2 oracle threshold it is 0.024. Tool invocation F1 is 0.527→0.077 (Table III).
- Conditional stages: In Phase 1→2, address and content correctness F1 after tool invocation is 0.939 and 0.814; bypass→tool invocation is 0.053, and under random splits it is 0.394 (Table IV). The authors argue that early detection should be separated from later parameter validation.
- Figure text: Figure 2 labels the y-axis as submission proportion, with blocked after retrieval at 49.7%, bypassed but no tool invocation at 46.8%, and full success at 0.7%. These are result distributions, not framework defense effectiveness; the figure positions cannot be verified from plain text.
Hard Negatives and Zero-Shot Judge
- Adding benign training: LLMail+BIPIA training gives an FPR of 65.2% on NotInject; adding NotInject gives 0.6%, and BIPIA F1 changes from 0.770 to 0.730 (Table V).
- First-round comparison: The strict selective-stage plus action/context configuration, when trained with NotInject, achieves an average F1 of 0.451 with 0/113 false positives; without it, 0.038 with 6/113 false positives (5.31%) (VI-B).
- LLM judge: Strict gpt-4.1-mini has NVIDIA recall of 75.16%, BIPIA F1 of 0.625, and LLMail F1 of 0.891; the strict framework has 2.33%, 0.732, and 0.665, respectively (Table VIII). The authors report the judge's average F1 is higher but do not list the specific mean.
Evasion Modifications and Error Analysis
- Padding tests: The authors report that padding with random benign emails does not reduce recall, and padding with low-risk emails has little effect; padding with words chosen after understanding the model to lower scores can cause linear detectors to miss attacks. VI-F does not report specific recall numbers for these tests.
- Wording replacement: Features that directly match the target address and message body are removed, and benchmark-specific strings are then replaced; over 500 attacks, selective-stage plus action/context recall is 0.928→0.916, and text/rule is 0.824→0.554 (VI-F). This passage does not specify the decision policy.
- Manual error classification: The authors classify Phase 2 full success prediction errors as high-risk but not fully successful, missing conversation boundary attacks, and so on; NotInject false positives include benign technical instructions, security discussions, and role-playing. VII does not report sample denominators, number of annotators, or agreement.
Other Ablations and Analyses
- Strict policy stage channel: Text/rule average F1 is 0.281±0.149, and all stages is 0.348±0.096 (Table VI).
- Strict policy action channel: Action/context is 0.386±0.024, selective-stage combination is 0.400±0.057, and all-stages combination is 0.406±0.057 (Table VI).
- Nonlinear stacker: Strict average F1 is 0.347±0.034, NVIDIA recall is 21.72%, and BIPIA F1 is 0.785 (Table VI).
- Five-seed check: The fixed first-round strict selective-stage plus action/context average F1 is 0.411±0.067 (VI-C).
- Threshold adjustment: When the NotInject FPR is adjusted to about 5%, the LLMail detector's recall on BIPIA attacks is 36.9% (VI-B).
What are some points that can be further explored?
The authors propose evaluating in a real email agent pipeline and expanding the scale and diversity of benign hard negatives.
The future directions explicitly proposed by the authors focus on real pipeline evaluation and data expansion.
Limitations and future directions noted by the authors
- Real-system evaluation: The authors propose evaluating the framework in a real email agent pipeline in the future (IX Conclusion).
- Hard negative expansion: The authors propose expanding the scale and diversity of benign hard negatives (IX Conclusion).
- Result field collection: The authors propose that future data collection should prioritize recording explicit tool actions, recipients, and content results (VIII Discussion).
- Limitations section: The paper does not include a dedicated limitations discussion section.
Experimental coverage
- Offline prediction targets: Stage prediction uses the LLMail two-stage submission and its target flags; the binary classification comparison uses five binary classification baselines, and additionally tests NotInject false positives and NVIDIA attack recall (IV, VI).
- Comparison scope: Five frozen text detectors and zero-shot gpt-4.1-mini are run; the framework is trained on task data, and the comparison detectors receive no additional training (V, VI-D/E).
- Repetition settings: The main ablation uses three NotInject rotations; the five-seed results target the selective stage plus action/context configuration for a fixed first round (VI-C).
- Evasion evaluation: Benign padding, using model coefficients to select padding words, and baseline-specific string replacement are tested; the paper does not report end-to-end email action blocking rates after redeployment (VI-F, IX).
- Evidence details: The paper does not report inference time, human annotation error agreement, or the impact of false rejections on task completion; the benign test portion of the LLMail binary classification proxy contains only 203 emails (VI-B, VII).
Summarize the main content of the paper
The fusion of attack chain and action consistency improves average F1 for strict detection, but transfer, false positives, and attack recall still need to be examined separately.
This is an offline modeling and evaluation study of prompt injection defense for email agents: the authors treat whether the attack text is malicious, whether the attack advances to tool operations, and whether the final parameters meet the target as separate issues.
- Method positioning: Six attack chain labels are extracted from LLMail-Inject, and risk scores are formed using text classifiers, stage validators, rules, and user request–action consistency signals, with both review and strict policies set.
- Main comparison: Under the same data and strict threshold protocol, the all-stages plus action/context framework achieves an average F1 of 0.406 across five binary classification benchmarks; the highest among five frozen detectors is ProtectAI v2 at 0.216 (Table VII).
- Transfer results: The random F1 for LLMail full success prediction is 0.167, and Phase 1→2 is 0.000; conditional tool invocation→address correctness in stage transfer is 0.939 (Tables III, IV). The authors argue that stage prediction difficulty differs and that random splits may overestimate transfer performance.
- Benign training: When the first-round strict selective-stage plus action/context configuration is trained with NotInject, the average F1 is 0.451 with 0/113 false positives; without it, 0.038 with 6/113 false positives (VI-B).
- Result exceptions: The strict framework achieves an F1 of 0.732 on BIPIA, but NVIDIA recall is 2.33%; strict gpt-4.1-mini on NVIDIA is 75.16%, and the authors report its average F1 is higher (Table VIII).
The authors advocate combining early untrusted instruction detection with later tool-parameter validation, and training and evaluating with benign hard negatives. The effect in real email pipelines, as well as larger and more diverse hard negatives, are directions the authors propose for future work.