mlsanityData to 7 Oct 2026

MELON: Provable Defense Against Indirect Prompt Injection Attacks in AI Agents

arXiv 2502.05174 ↗First posted 7 Feb 2025cs.CR cs.AIcited by 67

On the map: LLM agents and tool use → Agent threats, guardrails and governance

also in 1 more
Abstract (arXiv)

Recent research has explored that LLM agents are vulnerable to indirect prompt injection (IPI) attacks, where malicious tasks embedded in tool-retrieved information can redirect the agent to take unauthorized actions. Existing defenses against IPI have significant limitations: either require essential model training resources, lack effectiveness against sophisticated attacks, or harm the normal utilities. We present MELON (Masked re-Execution and TooL comparisON), a novel IPI defense. Our approach builds on the observation that under a successful attack, the agent's next action becomes less dependent on user tasks and more on malicious tasks. Following this, we design MELON to detect attacks by re-executing the agent's trajectory with a masked user prompt modified through a masking function. We identify an attack if the actions generated in the original and masked executions are similar. We also include three key designs to reduce the potential false positives and false negatives. Extensive evaluation on the IPI benchmark AgentDojo demonstrates that MELON outperforms SOTA defenses in both attack prevention and utility preservation. Moreover, we show that combining MELON with a SOTA prompt augmentation defense (denoted as MELON-Aug) further improves its performance. We also conduct a detailed ablation study to validate our key designs. Code is available at https://github.com/kaijiezhu11/MELON.

Key facts. Cited by 67 papers in the map (data through 7 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 21 of its 32 references that are in the map. First posted on arXiv 7 Feb 2025.

Builds on

21 of 32 references.

Closest ancestors · 8

Same direction, newest first

  1. 2024The Task Shield: Enforcing Task Alignment to Defend Against Indirect Prompt Injection in LLM Agents21 Dec
  2. 2024Attacking Vision-Language Computer Agents via Pop-ups4 Nov
  3. 2024Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agents3 Oct
  4. 2024EIA: Environmental Injection Attack on Generalist Web Agents for Privacy Leakage17 Sep
  5. 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents5 Mar
  6. 2024R-Judge: Benchmarking Safety Risk Awareness for LLM Agents18 Jan
  7. 2023Testing Language Model Agents Safely in the Wild17 Nov
  8. 2023Identifying the Risks of LM Agents with an LM-Emulated Sandbox25 Sep

Other references · 13

  1. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  2. 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,124
  3. 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
  4. 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructionscited by 441
  5. 2024StruQ: Defending Against Prompt Injection with Structured Queriescited by 325
  6. 2024Defending Against Indirect Prompt Injection Attacks With Spotlightingcited by 233
  7. 2023Poisoning Retrieval Corpora by Injecting Adversarial Passagescited by 153
  8. 2023Tensor Trust: Interpretable Prompt Injection Attacks from an Online Gamecited by 135
  9. 2024System-Level Defense against Indirect Prompt Injection Attacks: An Information Flow Control Perspectivecited by 91
  10. 2024Attention Tracker: Detecting Prompt Injection Attacks in LLMscited by 82
  11. 2024A New Era in LLM Security: Exploring Security Concerns in Real-World LLM-based Systemscited by 74
  12. 2023Assessing Prompt Injection Risks in 200+ Custom GPTscited by 49
1 more
  1. 2024GoEX: Perspectives and Designs Towards a Runtime for Autonomous LLM Applicationscited by 22

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 8; 2026: 59.

67 papers.

Sort:

By area:

  1. 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 125
  2. 2025The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against Llm Jailbreaks and Prompt Injectionscited by 108
  3. 2026AttriGuard: Defeating Indirect Prompt Injection in LLM Agents via Causal Attribution of Tool Invocationscited by 33
  4. 2026Prompt Injection Attacks on Agentic Coding Assistants: A Systematic Analysis of Vulnerabilities in Skills, Tools, and Protocol Ecosystemscited by 30
  5. 2026AgentSentry: Mitigating Indirect Prompt Injection in LLM Agents via Temporal Causal Diagnostics and Context Purificationcited by 28
  6. 2025Agentic AI Security: Threats, Defenses, Evaluation, and Open Challengescited by 26
  7. 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysiscited by 25
  8. 2026ClawGuard: A Runtime Security Framework for Tool-Augmented LLM Agents Against Indirect Prompt Injectioncited by 25
  9. 2025A Survey on the Safety and Security Threats of Computer-Using Agents: JARVIS or Ultron?cited by 23
  10. 2026MUZZLE: Adaptive Agentic Red-Teaming of Web Agents Against Indirect Prompt Injection Attackscited by 18
  11. 2026MalSkillBench: A Runtime-Verified Benchmark of Malicious Agent Skillscited by 14
  12. 2026VIGIL: Defending LLM Agents Against Tool Stream Injection via Verify-Before-Commitcited by 13
38 more
  1. 2026CausalArmor: Efficient Indirect Prompt Injection Guardrails via Causal Attributioncited by 13
  2. 2026PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defensescited by 13
  3. 2026ARGUS: Defending LLM Agents Against Context-Aware Prompt Injectioncited by 13
  4. 2025CommandSans: Securing AI Agents with Surgical Precision Prompt Sanitizationcited by 12
  5. 2026AdapTools: Adaptive Tool-based Indirect Prompt Injection Attacks on Agentic LLMscited by 12
  6. 2025SoK: Trust-Authorization Mismatch in LLM Agent Interactionscited by 11
  7. 2026Prompt Injection as Role Confusioncited by 11
  8. 2026Detecting Safety Violations Across Many Agent Tracescited by 11
  9. 2025MindGuard: Intrinsic Decision Inspection for Securing LLM Agents Against Metadata Poisoningcited by 10
  10. 2026AgentSys: Secure and Dynamic LLM Agents Through Explicit Hierarchical Memory Managementcited by 10
  11. 2026AgenTRIM: Tool Risk Mitigation for Agentic AIcited by 9
  12. 2026ICON: Indirect Prompt Injection Defense for Agents based on Inference-Time Correctioncited by 8
  13. 2026The Granularity Mismatch in Agent Security: Argument-Level Provenance Solves Enforcement and Isolates the LLM Reasoning Bottleneckcited by 8
  14. 2026Safeguarding LLM Agents against Long-Horizon Threats via Shadow Memorycited by 6
  15. 2026Toward Secure LLM Agents: Threat Surfaces, Attacks, Defenses, and Evaluationcited by 5
  16. 2026Beyond Single-Use Tokens: Durable Authorization State for Replay-Resistant LLM Agent Actionscited by 5
  17. 2025Trusted AI Agents in the Cloudcited by 4
  18. 2026Whispers of Wealth: Red-Teaming Google's Agent Payments Protocol via Prompt Injectioncited by 3
  19. 2026LivePI: More Realistic Benchmarking of Agents Against Indirect Prompt Injectioncited by 3
  20. 2026Think Twice Before You Act: Protecting LLM Agents Against Tool Description Poisoning via Isolated Planningcited by 3
  21. 2026Your Agentic LLMs Secretly Encode Indirect Prompt-Injection Exposure in Hidden Statescited by 3
  22. 2026AgentDrift: A Step-Labeled Benchmark of Injection-Hijacked LLM Agent Trajectoriescited by 2
  23. 2026Are GUI Agents Focused Enough? Automated Distraction via Semantic-level UI Element Injectioncited by 1
  24. 2026CapSeal: Capability-Sealed Secret Mediation for Secure Agent Executioncited by 1
  25. 2026AgentShield: Deception-based Compromise Detection for Tool-using LLM Agentscited by 1
  26. 2026PI-Hunter: Automated Red-Teaming for Exposing and Localizing Prompt Injectionscited by 1
  27. 2026From Shield to Target: Denial-of-Service Attacks on LLM-Based Agent Guardrailscited by 1
  28. 2026An Experimental Evaluation of Multimodal Prompt Injection Attacks on Agentic AI Frameworkscited by 1
  29. 2026Silent Failures in Agentic Security Evaluation: A Validated Harness for Tool-Call Mediation Under Indirect Prompt Injectioncited by 1
  30. 2026Beyond Pattern Matching: Seven Cross-Domain Techniques for Prompt Injection Detectioncited by 0
  31. 2026Depth-Dependent Indirect Prompt Injection in Tool-Calling ReAct Agents: Injection Depth, Payload Framing, and Turn-Budget Sensitivitycited by 0
  32. 2026Caught in the Act(ivation): Toward Pre-Output and Multi-Turn Detection of Credential Exfiltration by LLM Agentscited by 0
  33. 2026DualView: Preventing Indirect Prompt Injection in Personal AI Agentscited by 0
  34. 2026The Balkanization of Execution-Security Research for AI Coding Agents: Isolation, Access Control, and Time-of-Check-to-Time-of-Use Vulnerabilitiescited by 0
  35. 2026Governing Execution Risk in Agentic AI Systems: A Trajectory-Guided Framework for Red Teamingcited by 0
  36. 2026AgentAntibody: An Adaptive Immune System for Defending LLM Agents against Prompt Injectioncited by 0
  37. 2026Robust Context-Aware Detection of Malicious Instructions in Textcited by 0
  38. 2026Beyond Handcrafted Security: Towards Self-Evolving Defense for LLM Agentscited by 0

50 most cited of 67 All 67 (JSON)

Similar, not cited

Close in wording, no citation either way

  1. 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agents
  2. 2025IPIGuard: A Novel Tool Dependency Graph-Based Defense Against Indirect Prompt Injection in LLM Agents
  3. 2026Defense Against Indirect Prompt Injection via Tool Result Parsing
  4. 2026Your Agent is More Brittle Than You Think: Uncovering Indirect Injection Vulnerabilities in Agentic LLMs
  5. 2026Architecting Secure AI Agents: Perspectives on System-Level Defenses Against Indirect Prompt Injection Attacks
  6. 2026Assessing Automated Prompt Injection Attacks in Agentic Environments
  7. 2024AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents
  8. 2026Defusing Explosive Prompts: Understanding and Preventing Trigger-Based Prompt Injections in LLM Agents