mlsanityData to 14 Oct 2026

AgentWatcher: A Rule-based Prompt Injection Monitor

arXiv 2604.01194 ↗First posted 1 Apr 2026cs.CRcited by 6

On the map: LLM safety and security → Prompt injection and agent security

Abstract (arXiv)

Large language models (LLMs) and their applications, such as agents, are highly vulnerable to prompt injection attacks. State-of-the-art prompt injection detection methods have the following limitations: (1) their effectiveness degrades significantly as context length increases, and (2) they lack explicit rules that define what constitutes prompt injection, causing detection decisions to be implicit, opaque, and difficult to reason about. In this work, we propose AgentWatcher to address the above two limitations. To address the first limitation, AgentWatcher attributes the LLM's output (e.g., the action of an agent) to a small set of causally influential context segments. By focusing detection on a relatively short text, AgentWatcher can be scalable to long contexts. To address the second limitation, we define a set of rules specifying what does and does not constitute a prompt injection, and use a monitor LLM to reason over these rules based on the attributed text, making the detection decisions more explainable. We conduct a comprehensive evaluation on tool-use agent benchmarks and long-context understanding datasets. The experimental results demonstrate that AgentWatcher can effectively detect prompt injection and maintain utility without attacks. The code is available at https://github.com/wang-yanting/AgentWatcher.

Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 53 of its 81 references that are in the map. First posted on arXiv 1 Apr 2026.

Builds on

53 of 81 references.

Closest ancestors · 23

Same direction, newest first

  1. 2026AgentDoG: A Diagnostic Guardrail Framework for AI Agent Safety and Security26 Jan
  2. 2025PISanitizer: Preventing Prompt Injection to Long-Context LLMs via Prompt Sanitization13 Nov
  3. 2025Defending Against Prompt Injection with DataFilter22 Oct
  4. 2025PIShield: Detecting Prompt Injection Attacks via Intrinsic LLM Features15 Oct
  5. 2025PromptLocate: Localizing Prompt Injection Attacks14 Oct
  6. 2025PromptArmor: Simple yet Effective Prompt Injection Defenses21 Jul
  7. 2025DRIFT: Dynamic Rule-Based Defense with Injection Isolation for Securing LLM Agents13 Jun
  8. 2025A Critical Evaluation of Defenses against Prompt Injection Attacks23 May
  9. 2025WASP: Benchmarking Web Agent Security Against Prompt Injection Attacks22 Apr
  10. 2025Progent: Securing AI Agents with Privilege Control16 Apr
  11. 2025DataSentinel: A Game-Theoretic Detection of Prompt Injection Attacks15 Apr
  12. 2025Defeating Prompt Injections by Design24 Mar
11 more
  1. 2025PromptShield: Deployable Detection for Prompt Injection Attacks25 Jan
  2. 2024Attention Tracker: Detecting Prompt Injection Attacks in LLMs1 Nov
  3. 2024InjecGuard: Benchmarking and Mitigating Over-defense in Prompt Injection Guardrail Models30 Oct
  4. 2024SecAlign: Defending Against Prompt Injection with Preference Optimization7 Oct
  5. 2024System-Level Defense against Indirect Prompt Injection Attacks: An Information Flow Control Perspective27 Sep
  6. 2024AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents19 Jun
  7. 2024Get my drift? Catching LLM Task Drift with Activation Deltas2 Jun
  8. 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions19 Apr
  9. 2024Automatic and Universal Prompt Injection Attacks against Large Language Models7 Mar
  10. 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents5 Mar
  11. 2024StruQ: Defending Against Prompt Injection with Structured Queries9 Feb

Other references · 30

  1. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  2. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
  3. 2025Qwen3 Technical Reportcited by 8,820
  4. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
  5. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,754
  6. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
  7. 2023WebArena: A Realistic Web Environment for Building Autonomous Agentscited by 2,006
  8. 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,420
  9. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
  10. 2025OpenAI GPT-5 System Cardcited by 989
  11. 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 832
  12. 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 672
18 more
  1. 2019Attention is not not Explanationcited by 636
  2. 2023Enabling Large Language Models to Generate Text with Citationscited by 595
  3. 2021A Dataset of Information-Seeking Questions and Answers Anchored in Research Paperscited by 486
  4. 2019Is Attention Interpretable?cited by 389
  5. 2021Efficient Attentions for Long Document Summarizationcited by 345
  6. 2025The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against Llm Jailbreaks and Prompt Injectionscited by 129
  7. 2025Securing AI Agents with Information-Flow Controlcited by 121
  8. 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 112
  9. 2024ContextCite: Attributing Model Generation to Contextcited by 98
  10. 2025Prompt Flow Integrity to Prevent Privilege Escalation in LLM Agentscited by 87
  11. 2026AgentDyn: Are Your Agent Security Defenses Deployable in Real-World Dynamic Environments?cited by 59
  12. 2025RLVR-World: Training World Models with Reinforcement Learningcited by 40
  13. 2026From Assistant to Double Agent: Formalizing and Benchmarking Attacks on OpenClaw for Personalized Local AI Agentcited by 29
  14. 2026Don't Let the Claw Grip Your Hand: A Security Analysis and Defense Framework for OpenClawcited by 29
  15. 2026A Trajectory-Based Safety Audit of Clawdbot (OpenClaw)cited by 16
  16. 2025Learning to Attribute with Attentioncited by 13
  17. 2025TracLLM: A Generic Framework for Attributing Long Context LLMscited by 13
  18. 2026The Why Behind the Action: Unveiling Internal Drivers via Agentic Attributioncited by 11

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 6.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026ARGUS: Defending LLM Agents Against Context-Aware Prompt Injection
  2. 2025PromptSleuth: Detecting Prompt Injection via Semantic Intent Invariance
  3. 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysis
  4. 2025Mitigating Indirect Prompt Injection via Instruction-Following Intent Analysis
  5. 2026AgentSentry: Mitigating Indirect Prompt Injection in LLM Agents via Temporal Causal Diagnostics and Context Purification
  6. 2026PVDetector: Detecting Prompt Injection Attacks on Purpose-Specific LLM Agents through Policy-Violation Concept Analysis
  7. 2025AgentVigil: Generic Black-Box Red-teaming for Indirect Prompt Injection against LLM Agents
  8. 2026Prompted to Discriminate: Generalizing Malicious-Input Probes in the Wild