MELON: Provable Defense Against Indirect Prompt Injection Attacks in AI Agents
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
- 2024The Task Shield: Enforcing Task Alignment to Defend Against Indirect Prompt Injection in LLM Agents21 Dec
- 2024Attacking Vision-Language Computer Agents via Pop-ups4 Nov
- 2024Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agents3 Oct
- 2024EIA: Environmental Injection Attack on Generalist Web Agents for Privacy Leakage17 Sep
- 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents5 Mar
- 2024R-Judge: Benchmarking Safety Risk Awareness for LLM Agents18 Jan
- 2023Testing Language Model Agents Safely in the Wild17 Nov
- 2023Identifying the Risks of LM Agents with an LM-Emulated Sandbox25 Sep
Other references · 13
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,124
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
- 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructionscited by 441
- 2024StruQ: Defending Against Prompt Injection with Structured Queriescited by 325
- 2024Defending Against Indirect Prompt Injection Attacks With Spotlightingcited by 233
- 2023Poisoning Retrieval Corpora by Injecting Adversarial Passagescited by 153
- 2023Tensor Trust: Interpretable Prompt Injection Attacks from an Online Gamecited by 135
- 2024System-Level Defense against Indirect Prompt Injection Attacks: An Information Flow Control Perspectivecited by 91
- 2024Attention Tracker: Detecting Prompt Injection Attacks in LLMscited by 82
- 2024A New Era in LLM Security: Exploring Security Concerns in Real-World LLM-based Systemscited by 74
- 2023Assessing Prompt Injection Risks in 200+ Custom GPTscited by 49
1 more
Built on by
Citing papers per year: 2025: 8; 2026: 59.
67 papers.
Sort:
By area:
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 125
- 2025The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against Llm Jailbreaks and Prompt Injectionscited by 108
- 2026AttriGuard: Defeating Indirect Prompt Injection in LLM Agents via Causal Attribution of Tool Invocationscited by 33
- 2026Prompt Injection Attacks on Agentic Coding Assistants: A Systematic Analysis of Vulnerabilities in Skills, Tools, and Protocol Ecosystemscited by 30
- 2026AgentSentry: Mitigating Indirect Prompt Injection in LLM Agents via Temporal Causal Diagnostics and Context Purificationcited by 28
- 2025Agentic AI Security: Threats, Defenses, Evaluation, and Open Challengescited by 26
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysiscited by 25
- 2026ClawGuard: A Runtime Security Framework for Tool-Augmented LLM Agents Against Indirect Prompt Injectioncited by 25
- 2025A Survey on the Safety and Security Threats of Computer-Using Agents: JARVIS or Ultron?cited by 23
- 2026MUZZLE: Adaptive Agentic Red-Teaming of Web Agents Against Indirect Prompt Injection Attackscited by 18
- 2026MalSkillBench: A Runtime-Verified Benchmark of Malicious Agent Skillscited by 14
- 2026VIGIL: Defending LLM Agents Against Tool Stream Injection via Verify-Before-Commitcited by 13
38 more
- 2026CausalArmor: Efficient Indirect Prompt Injection Guardrails via Causal Attributioncited by 13
- 2026PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defensescited by 13
- 2026ARGUS: Defending LLM Agents Against Context-Aware Prompt Injectioncited by 13
- 2025CommandSans: Securing AI Agents with Surgical Precision Prompt Sanitizationcited by 12
- 2026AdapTools: Adaptive Tool-based Indirect Prompt Injection Attacks on Agentic LLMscited by 12
- 2025SoK: Trust-Authorization Mismatch in LLM Agent Interactionscited by 11
- 2026Prompt Injection as Role Confusioncited by 11
- 2026Detecting Safety Violations Across Many Agent Tracescited by 11
- 2025MindGuard: Intrinsic Decision Inspection for Securing LLM Agents Against Metadata Poisoningcited by 10
- 2026AgentSys: Secure and Dynamic LLM Agents Through Explicit Hierarchical Memory Managementcited by 10
- 2026AgenTRIM: Tool Risk Mitigation for Agentic AIcited by 9
- 2026ICON: Indirect Prompt Injection Defense for Agents based on Inference-Time Correctioncited by 8
- 2026The Granularity Mismatch in Agent Security: Argument-Level Provenance Solves Enforcement and Isolates the LLM Reasoning Bottleneckcited by 8
- 2026Safeguarding LLM Agents against Long-Horizon Threats via Shadow Memorycited by 6
- 2026Toward Secure LLM Agents: Threat Surfaces, Attacks, Defenses, and Evaluationcited by 5
- 2026Beyond Single-Use Tokens: Durable Authorization State for Replay-Resistant LLM Agent Actionscited by 5
- 2025Trusted AI Agents in the Cloudcited by 4
- 2026Whispers of Wealth: Red-Teaming Google's Agent Payments Protocol via Prompt Injectioncited by 3
- 2026LivePI: More Realistic Benchmarking of Agents Against Indirect Prompt Injectioncited by 3
- 2026Think Twice Before You Act: Protecting LLM Agents Against Tool Description Poisoning via Isolated Planningcited by 3
- 2026Your Agentic LLMs Secretly Encode Indirect Prompt-Injection Exposure in Hidden Statescited by 3
- 2026AgentDrift: A Step-Labeled Benchmark of Injection-Hijacked LLM Agent Trajectoriescited by 2
- 2026Are GUI Agents Focused Enough? Automated Distraction via Semantic-level UI Element Injectioncited by 1
- 2026CapSeal: Capability-Sealed Secret Mediation for Secure Agent Executioncited by 1
- 2026AgentShield: Deception-based Compromise Detection for Tool-using LLM Agentscited by 1
- 2026PI-Hunter: Automated Red-Teaming for Exposing and Localizing Prompt Injectionscited by 1
- 2026From Shield to Target: Denial-of-Service Attacks on LLM-Based Agent Guardrailscited by 1
- 2026An Experimental Evaluation of Multimodal Prompt Injection Attacks on Agentic AI Frameworkscited by 1
- 2026Silent Failures in Agentic Security Evaluation: A Validated Harness for Tool-Call Mediation Under Indirect Prompt Injectioncited by 1
- 2026Beyond Pattern Matching: Seven Cross-Domain Techniques for Prompt Injection Detectioncited by 0
- 2026Depth-Dependent Indirect Prompt Injection in Tool-Calling ReAct Agents: Injection Depth, Payload Framing, and Turn-Budget Sensitivitycited by 0
- 2026Caught in the Act(ivation): Toward Pre-Output and Multi-Turn Detection of Credential Exfiltration by LLM Agentscited by 0
- 2026DualView: Preventing Indirect Prompt Injection in Personal AI Agentscited by 0
- 2026The Balkanization of Execution-Security Research for AI Coding Agents: Isolation, Access Control, and Time-of-Check-to-Time-of-Use Vulnerabilitiescited by 0
- 2026Governing Execution Risk in Agentic AI Systems: A Trajectory-Guided Framework for Red Teamingcited by 0
- 2026AgentAntibody: An Adaptive Immune System for Defending LLM Agents against Prompt Injectioncited by 0
- 2026Robust Context-Aware Detection of Malicious Instructions in Textcited by 0
- 2026Beyond Handcrafted Security: Towards Self-Evolving Defense for LLM Agentscited by 0
50 most cited of 67 All 67 (JSON)
- 2026PACE: Provenance-Aware Capability Enforcement for Tool-Using LLM Agents1 Oct 2026
- 2026Speculative Safety Honeypot: Toward Proactive Defense Against Multi-turn Agent Attacks30 Sep 2026
- 2026Divide and Inject: Can Agents Reconstruct an Indirect Prompt Injection from Fragments?29 Sep 2026
- 2026CounterSteer: Suppressing Indirect Prompt Injection with Activation Steering29 Sep 2026
- 2026CoDeL: Co-Evolutionary Defense against Indirect Prompt Injection in LLM-based Agents28 Sep 2026
- 2026Certified Multi-Source Integrity for Structured Agent Actions28 Sep 2026
- 2026Silent Failures in Agentic Security Evaluation: A Validated Harness for Tool-Call Mediation Under Indirect Prompt Injection26 Sep 2026
- 2026Control-Token Injection Suppresses Chain-of-Thought and Defeats Reasoning-Based Oversight in Tool-Using Agents23 Sep 2026
- 2026ActGuard: Pre-execution Action Auditing against Indirect Prompt Injection in LLM Agents14 Sep 2026
- 2026DriftNet: A Dual-Head Trajectory Transformer for Detecting and Localizing Prompt Injection in LLM Agents9 Sep 2026
- 2026No-Box Vulnerability Analysis: Description-only Detection of Indirect Prompt Injection Vulnerabilities in MCP Servers9 Sep 2026
- 2026An Experimental Evaluation of Multimodal Prompt Injection Attacks on Agentic AI Frameworks8 Sep 2026
38 more
- 2026AgentDrift: A Step-Labeled Benchmark of Injection-Hijacked LLM Agent Trajectories7 Sep 2026
- 2026Rethinking Indirect Prompt Injection as a Test-Time Search Problem3 Sep 2026
- 2026Understanding and Exploiting Initialization Anchoring Weakness in Feedback-Based Agent Planning31 Aug 2026
- 2026Influence Is Not Authority: When Causal Guardrail Signals Make Legitimate Tool Use Look Like an Attack in Tool-Using LLM Agents30 Aug 2026
- 2026When Tool Outputs Become Commands: Separating Action Induction from Runtime Authorization in Tool-Augmented LLM Agents27 Aug 2026
- 2026Reassembling Distributed Risk: Trajectory-Conditioned Action Generation for Multi-Turn Agent Safety26 Aug 2026
- 2026WebMCP-Phalanx: Enforcing and Characterizing Trust Boundaries for Browser-Integrated LLM Agents25 Aug 2026
- 2026Beyond Handcrafted Security: Towards Self-Evolving Defense for LLM Agents13 Aug 2026
- 2026Robust Context-Aware Detection of Malicious Instructions in Text5 Aug 2026
- 2026AgentAntibody: An Adaptive Immune System for Defending LLM Agents against Prompt Injection4 Aug 2026
- 2026Beyond Single-Use Tokens: Durable Authorization State for Replay-Resistant LLM Agent Actions3 Aug 2026
- 2026Policy-Backed Selective Regeneration under Tainted Inter-Agent Communication2 Aug 2026
- 2026Your Agentic LLMs Secretly Encode Indirect Prompt-Injection Exposure in Hidden States1 Aug 2026
- 2026The Balkanization of Execution-Security Research for AI Coding Agents: Isolation, Access Control, and Time-of-Check-to-Time-of-Use Vulnerabilities7 Jul 2026
- 2026DualView: Preventing Indirect Prompt Injection in Personal AI Agents4 Jul 2026
- 2026Governing Execution Risk in Agentic AI Systems: A Trajectory-Guided Framework for Red Teaming23 Jun 2026
- 2026Think Twice Before You Act: Protecting LLM Agents Against Tool Description Poisoning via Isolated Planning18 Jun 2026
- 2026From Shield to Target: Denial-of-Service Attacks on LLM-Based Agent Guardrails12 Jun 2026
- 2026PI-Hunter: Automated Red-Teaming for Exposing and Localizing Prompt Injections10 Jun 2026
- 2026Toward Secure LLM Agents: Threat Surfaces, Attacks, Defenses, and Evaluation9 Jun 2026
- 2026MalSkillBench: A Runtime-Verified Benchmark of Malicious Agent Skills5 Jun 2026
- 2026Caught in the Act(ivation): Toward Pre-Output and Multi-Turn Detection of Credential Exfiltration by LLM Agents2 Jun 2026
- 2026Depth-Dependent Indirect Prompt Injection in Tool-Calling ReAct Agents: Injection Depth, Payload Framing, and Turn-Budget Sensitivity29 May 2026
- 2026LivePI: More Realistic Benchmarking of Agents Against Indirect Prompt Injection18 May 2026
- 2026The Granularity Mismatch in Agent Security: Argument-Level Provenance Solves Enforcement and Isolates the LLM Reasoning Bottleneck11 May 2026
- 2026AgentShield: Deception-based Compromise Detection for Tool-using LLM Agents10 May 2026
- 2026ARGUS: Defending LLM Agents Against Context-Aware Prompt Injection5 May 2026
- 2026Safeguarding LLM Agents against Long-Horizon Threats via Shadow Memory4 May 2026
- 2026Beyond Pattern Matching: Seven Cross-Domain Techniques for Prompt Injection Detection20 Apr 2026
- 2026CapSeal: Capability-Sealed Secret Mediation for Secure Agent Execution18 Apr 2026
- 2026Detecting Safety Violations Across Many Agent Traces13 Apr 2026
- 2026ClawGuard: A Runtime Security Framework for Tool-Augmented LLM Agents Against Indirect Prompt Injection13 Apr 2026
- 2026Are GUI Agents Focused Enough? Automated Distraction via Semantic-level UI Element Injection9 Apr 2026
- 2026PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defenses13 Mar 2026
- 2026AttriGuard: Defeating Indirect Prompt Injection in LLM Agents via Causal Attribution of Tool Invocations11 Mar 2026
- 2026AgentSentry: Mitigating Indirect Prompt Injection in LLM Agents via Temporal Causal Diagnostics and Context Purification26 Feb 2026
- 2026AdapTools: Adaptive Tool-based Indirect Prompt Injection Attacks on Agentic LLMs24 Feb 2026
- 2026ICON: Indirect Prompt Injection Defense for Agents based on Inference-Time Correction24 Feb 2026
50 newest of 67 All 67 (JSON)
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 125
- 2026AttriGuard: Defeating Indirect Prompt Injection in LLM Agents via Causal Attribution of Tool Invocationscited by 33
- 2026Prompt Injection Attacks on Agentic Coding Assistants: A Systematic Analysis of Vulnerabilities in Skills, Tools, and Protocol Ecosystemscited by 30
- 2026AgentSentry: Mitigating Indirect Prompt Injection in LLM Agents via Temporal Causal Diagnostics and Context Purificationcited by 28
- 2025Agentic AI Security: Threats, Defenses, Evaluation, and Open Challengescited by 26
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysiscited by 25
- 2026ClawGuard: A Runtime Security Framework for Tool-Augmented LLM Agents Against Indirect Prompt Injectioncited by 25
- 2025A Survey on the Safety and Security Threats of Computer-Using Agents: JARVIS or Ultron?cited by 23
- 2026MUZZLE: Adaptive Agentic Red-Teaming of Web Agents Against Indirect Prompt Injection Attackscited by 18
- 2026MalSkillBench: A Runtime-Verified Benchmark of Malicious Agent Skillscited by 14
- 2026VIGIL: Defending LLM Agents Against Tool Stream Injection via Verify-Before-Commitcited by 13
- 2026CausalArmor: Efficient Indirect Prompt Injection Guardrails via Causal Attributioncited by 13
12 most cited of 55 All 55 (JSON)
- 2026PACE: Provenance-Aware Capability Enforcement for Tool-Using LLM Agents1 Oct 2026
- 2026Speculative Safety Honeypot: Toward Proactive Defense Against Multi-turn Agent Attacks30 Sep 2026
- 2026Divide and Inject: Can Agents Reconstruct an Indirect Prompt Injection from Fragments?29 Sep 2026
- 2026CounterSteer: Suppressing Indirect Prompt Injection with Activation Steering29 Sep 2026
- 2026CoDeL: Co-Evolutionary Defense against Indirect Prompt Injection in LLM-based Agents28 Sep 2026
- 2026Certified Multi-Source Integrity for Structured Agent Actions28 Sep 2026
- 2026Silent Failures in Agentic Security Evaluation: A Validated Harness for Tool-Call Mediation Under Indirect Prompt Injection26 Sep 2026
- 2026Control-Token Injection Suppresses Chain-of-Thought and Defeats Reasoning-Based Oversight in Tool-Using Agents23 Sep 2026
- 2026ActGuard: Pre-execution Action Auditing against Indirect Prompt Injection in LLM Agents14 Sep 2026
- 2026DriftNet: A Dual-Head Trajectory Transformer for Detecting and Localizing Prompt Injection in LLM Agents9 Sep 2026
- 2026An Experimental Evaluation of Multimodal Prompt Injection Attacks on Agentic AI Frameworks8 Sep 2026
- 2026AgentDrift: A Step-Labeled Benchmark of Injection-Hijacked LLM Agent Trajectories7 Sep 2026
12 newest of 55 All 55 (JSON)
- 2025The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against Llm Jailbreaks and Prompt Injectionscited by 108
- 2026PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defensescited by 13
- 2026Prompt Injection as Role Confusioncited by 11
- 2026Beyond Pattern Matching: Seven Cross-Domain Techniques for Prompt Injection Detectioncited by 0
- 2026Robust Context-Aware Detection of Malicious Instructions in Textcited by 0
- 2026Rethinking Indirect Prompt Injection as a Test-Time Search Problemcited by 0
- 2026No-Box Vulnerability Analysis: Description-only Detection of Indirect Prompt Injection Vulnerabilities in MCP Serverscited by 0
- 2026No-Box Vulnerability Analysis: Description-only Detection of Indirect Prompt Injection Vulnerabilities in MCP Servers9 Sep 2026
- 2026Rethinking Indirect Prompt Injection as a Test-Time Search Problem3 Sep 2026
- 2026Robust Context-Aware Detection of Malicious Instructions in Text5 Aug 2026
- 2026Beyond Pattern Matching: Seven Cross-Domain Techniques for Prompt Injection Detection20 Apr 2026
- 2026PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defenses13 Mar 2026
- 2026Prompt Injection as Role Confusion22 Feb 2026
- 2025The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against Llm Jailbreaks and Prompt Injections10 Oct 2025
Similar, not cited
Close in wording, no citation either way
- 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agents
- 2025IPIGuard: A Novel Tool Dependency Graph-Based Defense Against Indirect Prompt Injection in LLM Agents
- 2026Defense Against Indirect Prompt Injection via Tool Result Parsing
- 2026Your Agent is More Brittle Than You Think: Uncovering Indirect Injection Vulnerabilities in Agentic LLMs
- 2026Architecting Secure AI Agents: Perspectives on System-Level Defenses Against Indirect Prompt Injection Attacks
- 2026Assessing Automated Prompt Injection Attacks in Agentic Environments
- 2024AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents
- 2026Defusing Explosive Prompts: Understanding and Preventing Trigger-Based Prompt Injections in LLM Agents