DriftNet: A Dual-Head Trajectory Transformer for Detecting and Localizing Prompt Injection in LLM Agents
On the map: LLM agents and tool use → Agent threats, guardrails and governance
also in 1 more
Abstract (arXiv)
When an indirect prompt injection succeeds against an LLM agent, the compromise is visible in the agent's own behavior: a benign prefix of tool calls, a poisoned observation, and a suffix of actions that serve the attacker. An operator needs three facts: where the attack entered, which steps it corrupted, and whether apparent poison was resisted. Existing systems return either a whole-trace verdict or a single unsafe index. We present DriftNet, a dual-head trajectory Transformer that reads a logged tool-call trajectory and answers all three questions in one forward pass: one head classifies the trajectory as compromised or not, and a second assigns every step one of four labels (benign, injection point, hijacked, failed injection). To our knowledge it is the first supervised detector to produce this joint output. A frozen sentence encoder and four identity-free world features embed each step; the trained trunk, under two million parameters and optimized with a class-weighted joint objective over both heads, needs no access to the agent's model. On the task-disjoint split of the AgentDrift benchmark (12,536 trajectories, 71,024 labeled steps), with a 20-configuration sweep bounding hyperparameter sensitivity to 0.011 F1 and the test part evaluated exactly once, DriftNet reaches trajectory-level F1 of 0.983, exact injection-point recovery on 98.7% of attacked trajectories, hijacked-span IoU of 0.979, zero flags on 218 resisted attacks, and 2.9% flags on hard negatives. A surface baseline retrained on the identical split recovers 11.1% of partial hijacks and 17.1% of delayed executions; DriftNet reaches 98.6% and 93.2% while lowering every false-alarm rate. Reading all 26 residual errors shows that most misses trace to trajectories whose labeled injection observation carries no legible instruction, and we report the benchmark's measured world-identity regularity alongside the results.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 40 of its 45 references that are in the map. First posted on arXiv 9 Sep 2026.
Builds on
40 of 45 references.
Closest ancestors · 24
Same direction, newest first
- 2026AgentDrift: A Step-Labeled Benchmark of Injection-Hijacked LLM Agent Trajectories7 Sep
- 2026StepGuard: Learning Step-Level Guardrails with Scalable Supervision and Safety-Utility Balancing25 Aug
- 2026What Guides the Agent? Adjudicating Unauthorized Behavior via Localizing Behavior-Guiding Instructions25 Aug
- 2026Long-Horizon Agent Trajectory Attribution: A Unified Benchmark and Fine-Grained Annotation Framework7 Aug
- 2026DreamGuard: Efficient Runtime Guardrail for LLM Agents via Risk-Aware World Model6 Aug
- 2026Your Agentic LLMs Secretly Encode Indirect Prompt-Injection Exposure in Hidden States1 Aug
- 2026GuardianAgentBench: Where Agents Fail and How to Guard Them23 Jul
- 2026When AUC 0.998 Is Not Enough: A Candidate Evaluation Protocol for Hidden-State Probes of Indirect Prompt Injection in Multimodal Computer-Use Agents22 Jun
- 2026TraceSafe: A Systematic Assessment of LLM Guardrails on Multi-Step Tool-Calling Trajectories8 Apr
- 2026ATBench: A Diverse and Realistic Agent Trajectory Benchmark for Safety Evaluation and Diagnosis2 Apr
- 2026AttriGuard: Defeating Indirect Prompt Injection in LLM Agents via Causal Attribution of Tool Invocations11 Mar
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysis11 Feb
12 more
- 2026TrajAD: Trajectory Anomaly Detection for Trustworthy LLM Agents6 Feb
- 2026WebSentinel: Detecting and Localizing Prompt Injection Attacks for Web Agents3 Feb
- 2026Trajectory Guard -- A Lightweight, Sequence-Aware Model for Real-Time Anomaly Detection in Agentic AI2 Jan
- 2025TraceAegis: Securing LLM-Based Agents via Hierarchical and Behavioral Anomaly Detection13 Oct
- 2025IPIGuard: A Novel Tool Dependency Graph-Based Defense Against Indirect Prompt Injection in LLM Agents21 Aug
- 2025LlamaFirewall: An open source guardrail system for building secure AI agents6 May
- 2025Defeating Prompt Injections by Design24 Mar
- 2025MELON: Provable Defense Against Indirect Prompt Injection Attacks in AI Agents7 Feb
- 2024Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agents3 Oct
- 2024GuardAgent: Safeguard LLM Agents by a Guard Agent via Knowledge-Enabled Reasoning13 Jun
- 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents5 Mar
- 2024R-Judge: Benchmarking Safety Risk Awareness for LLM Agents18 Jan
Other references · 16
- 2017Attention Is All You Needcited by 59,932
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
- 2020MPNet: Masked and Permuted Pre-training for Language Understandingcited by 973
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
- 2023Formalizing and Benchmarking Prompt Injection Attacks and Defensescited by 328
- 2025Which Agent Causes Task Failures and When? On Automated Failure Attribution of LLM Multi-Agent Systemscited by 170
- 2025AgenTracer: Who Is Inducing Failure in the LLM Agentic Systems?cited by 105
- 2024Get my drift? Catching LLM Task Drift with Activation Deltascited by 61
- 2026AgentDyn: Are Your Agent Security Defenses Deployable in Real-World Dynamic Environments?cited by 45
- 2025PromptShield: Deployable Detection for Prompt Injection Attackscited by 43
4 more
- 2026Agent Drift: Quantifying Behavioral Degradation in Multi-Agent LLM Systems Over Extended Interactionscited by 26
- 2025AI-VERDE: A Gateway for Egalitarian Access to Large Language Model-Based Resources For Educational Institutionscited by 5
- 2026StepShield: When, Not Whether to Intervene on Rogue Agentscited by 5
- 2026BASIS: Breach-Aware Selective Prompt Injection Shielding with Prefill Attention Probescited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Defense Against Indirect Prompt Injection via Tool Result Parsing
- 2026RouteGuard: Internal-Signal Detection of Skill Poisoning in LLM Agents
- 2026Assessing Automated Prompt Injection Attacks in Agentic Environments
- 2026Detecting Malicious Agent Skills in the Wild using Attention
- 2026Passing the Test You Trained On: Re-evaluating Prompt-Injection Detectors for LLM Agents
- 2026AgentShield: Deception-based Compromise Detection for Tool-using LLM Agents
- 2026AgentSentry: Mitigating Indirect Prompt Injection in LLM Agents via Temporal Causal Diagnostics and Context Purification
- 2026Silent Failures in Agentic Security Evaluation: A Validated Harness for Tool-Call Mediation Under Indirect Prompt Injection