Defending Against Prompt Injection with DataFilter
On the map: LLM safety and security → Prompt injection and agent security
Abstract (arXiv)
When large language model (LLM) agents are increasingly deployed to automate tasks and interact with untrusted external data, prompt injection emerges as a significant security threat. By injecting malicious instructions into the data that LLMs access, an attacker can arbitrarily override the original user task and redirect the agent toward unintended, potentially harmful actions. Existing defenses either require access to model weights (fine-tuning), incur substantial utility loss (detection-based), or demand non-trivial system redesign (system-level). Motivated by this, we propose DataFilter, a test-time model-agnostic defense that removes malicious instructions from the data before it reaches the backend LLM. DataFilter is trained with supervised fine-tuning on simulated injections and leverages both the user's instruction and the data to selectively strip adversarial content while preserving benign information. Across multiple benchmarks, DataFilter consistently reduces the prompt injection attack success rates to near zero while maintaining the LLMs' utility. DataFilter delivers strong security, high utility, and plug-and-play deployment, making it a strong practical defense to secure black-box commercial LLMs against prompt injection. Our DataFilter model is released at https://huggingface.co/JoyYizhu/DataFilter for immediate use, with the code to reproduce our results at https://github.com/yizhu-joy/DataFilter.
Key facts. Cited by 30 papers in the map (data through 7 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. First posted on arXiv 22 Oct 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 1; 2026: 29.
30 papers.
Sort:
By area:
- 2026Taming OpenClaw: Security Analysis and Mitigation of Autonomous LLM Agent Threatscited by 25
- 2026From Untrusted Input to Trusted Memory: A Systematic Study of Memory Poisoning Attacks in LLM Agentscited by 23
- 2026CausalArmor: Efficient Indirect Prompt Injection Guardrails via Causal Attributioncited by 13
- 2026PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defensescited by 13
- 2025SoK: Trust-Authorization Mismatch in LLM Agent Interactionscited by 11
- 2026A Systematic Security Evaluation of OpenClaw and Its Variantscited by 11
- 2026PIArena: A Platform for Prompt Injection Evaluationcited by 10
- 2026Assessing Automated Prompt Injection Attacks in Agentic Environmentscited by 5
- 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agentscited by 4
- 2026Agents at Risk: How Users Unwittingly Undermine LLM Safetycited by 3
- 2026Untrusted Content Masking for Web Agents with Security Guaranteescited by 3
- 2026When Agents Remember Too Much: Memory Poisoning Attacks on Large Language Model Agentscited by 3
18 more
- 2026InjecMEM: Memory Injection Attack on LLM Agent Memory Systemscited by 3
- 2026SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillationcited by 2
- 2026RedVisor: Reasoning-Aware Prompt Injection Defense via Zero-Copy KV Cache Reusecited by 1
- 2026Agent Against Agent: An Agentic System for Automatic Prompt Injection Red Teamingcited by 1
- 2026What Guides the Agent? Adjudicating Unauthorized Behavior via Localizing Behavior-Guiding Instructionscited by 1
- 2026Weight space Detection of Backdoors in LoRA Adapterscited by 0
- 2026CLASP: Defending Hybrid Large Language Models Against Hidden State Poisoning Attackscited by 0
- 2026Security Attack and Defense Strategies for Autonomous Agent Frameworks: A Layered Review with OpenClaw as a Case Studycited by 0
- 2026A Low-Latency Fraud Detection Layer for Detecting Adversarial Interaction Patterns in LLM-Powered Agentscited by 0
- 2026Ghost in the Context: Policy-Carriage Integrity in LLM Agentscited by 0
- 2026Rapid Poison: Practical Poisoning Attacks Against the Rapid Response Frameworkcited by 0
- 2026ALIBI: Adaptive Agentic Attacks on LLM-Based Vulnerability Detectors via Adversarial Code Commentscited by 0
- 2026On Understanding, Identifying, and Mitigating Vulnerabilities in Agentic Large Language Modelscited by 0
- 2026PIPES: Securing Agent Perception with Provenance and Priorscited by 0
- 2026Render Before Reading: Visual Rendering as a Prompt Injection Defensecited by 0
- 2026CounterSteer: Suppressing Indirect Prompt Injection with Activation Steeringcited by 0
- 2026ToolFence: Fine-Grained Authorization for Secure Tool-Using LLM Agentscited by 0
- 2026MASCRDM: Multi-Agent System for Compliance Risk Detection and Mitigation in Training Process of Large Language Modelscited by 0
- 2026MASCRDM: Multi-Agent System for Compliance Risk Detection and Mitigation in Training Process of Large Language Models30 Sep 2026
- 2026ToolFence: Fine-Grained Authorization for Secure Tool-Using LLM Agents29 Sep 2026
- 2026CounterSteer: Suppressing Indirect Prompt Injection with Activation Steering29 Sep 2026
- 2026Render Before Reading: Visual Rendering as a Prompt Injection Defense28 Sep 2026
- 2026What Guides the Agent? Adjudicating Unauthorized Behavior via Localizing Behavior-Guiding Instructions25 Aug 2026
- 2026InjecMEM: Memory Injection Attack on LLM Agent Memory Systems24 Aug 2026
- 2026SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillation21 Aug 2026
- 2026PIPES: Securing Agent Perception with Provenance and Priors13 Aug 2026
- 2026On Understanding, Identifying, and Mitigating Vulnerabilities in Agentic Large Language Models11 Aug 2026
- 2026Agent Against Agent: An Agentic System for Automatic Prompt Injection Red Teaming5 Aug 2026
- 2026ALIBI: Adaptive Agentic Attacks on LLM-Based Vulnerability Detectors via Adversarial Code Comments27 Jul 2026
- 2026When Agents Remember Too Much: Memory Poisoning Attacks on Large Language Model Agents6 Jul 2026
18 more
- 2026Untrusted Content Masking for Web Agents with Security Guarantees6 Jul 2026
- 2026Rapid Poison: Practical Poisoning Attacks Against the Rapid Response Framework15 Jun 2026
- 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agents13 Jun 2026
- 2026Assessing Automated Prompt Injection Attacks in Agentic Environments9 Jun 2026
- 2026From Untrusted Input to Trusted Memory: A Systematic Study of Memory Poisoning Attacks in LLM Agents3 Jun 2026
- 2026Ghost in the Context: Policy-Carriage Integrity in LLM Agents2 May 2026
- 2026A Low-Latency Fraud Detection Layer for Detecting Adversarial Interaction Patterns in LLM-Powered Agents1 May 2026
- 2026Security Attack and Defense Strategies for Autonomous Agent Frameworks: A Layered Review with OpenClaw as a Case Study30 Apr 2026
- 2026PIArena: A Platform for Prompt Injection Evaluation9 Apr 2026
- 2026A Systematic Security Evaluation of OpenClaw and Its Variants3 Apr 2026
- 2026PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defenses13 Mar 2026
- 2026CLASP: Defending Hybrid Large Language Models Against Hidden State Poisoning Attacks12 Mar 2026
- 2026Taming OpenClaw: Security Analysis and Mitigation of Autonomous LLM Agent Threats12 Mar 2026
- 2026Weight space Detection of Backdoors in LoRA Adapters16 Feb 2026
- 2026CausalArmor: Efficient Indirect Prompt Injection Guardrails via Causal Attribution8 Feb 2026
- 2026RedVisor: Reasoning-Aware Prompt Injection Defense via Zero-Copy KV Cache Reuse2 Feb 2026
- 2026Agents at Risk: How Users Unwittingly Undermine LLM Safety14 Jan 2026
- 2025SoK: Trust-Authorization Mismatch in LLM Agent Interactions7 Dec 2025
- 2026Taming OpenClaw: Security Analysis and Mitigation of Autonomous LLM Agent Threatscited by 25
- 2026From Untrusted Input to Trusted Memory: A Systematic Study of Memory Poisoning Attacks in LLM Agentscited by 23
- 2026CausalArmor: Efficient Indirect Prompt Injection Guardrails via Causal Attributioncited by 13
- 2025SoK: Trust-Authorization Mismatch in LLM Agent Interactionscited by 11
- 2026Assessing Automated Prompt Injection Attacks in Agentic Environmentscited by 5
- 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agentscited by 4
- 2026Agents at Risk: How Users Unwittingly Undermine LLM Safetycited by 3
- 2026Untrusted Content Masking for Web Agents with Security Guaranteescited by 3
- 2026When Agents Remember Too Much: Memory Poisoning Attacks on Large Language Model Agentscited by 3
- 2026InjecMEM: Memory Injection Attack on LLM Agent Memory Systemscited by 3
- 2026Agent Against Agent: An Agentic System for Automatic Prompt Injection Red Teamingcited by 1
- 2026What Guides the Agent? Adjudicating Unauthorized Behavior via Localizing Behavior-Guiding Instructionscited by 1
12 most cited of 20 All 20 (JSON)
- 2026MASCRDM: Multi-Agent System for Compliance Risk Detection and Mitigation in Training Process of Large Language Models30 Sep 2026
- 2026ToolFence: Fine-Grained Authorization for Secure Tool-Using LLM Agents29 Sep 2026
- 2026CounterSteer: Suppressing Indirect Prompt Injection with Activation Steering29 Sep 2026
- 2026What Guides the Agent? Adjudicating Unauthorized Behavior via Localizing Behavior-Guiding Instructions25 Aug 2026
- 2026InjecMEM: Memory Injection Attack on LLM Agent Memory Systems24 Aug 2026
- 2026On Understanding, Identifying, and Mitigating Vulnerabilities in Agentic Large Language Models11 Aug 2026
- 2026Agent Against Agent: An Agentic System for Automatic Prompt Injection Red Teaming5 Aug 2026
- 2026ALIBI: Adaptive Agentic Attacks on LLM-Based Vulnerability Detectors via Adversarial Code Comments27 Jul 2026
- 2026When Agents Remember Too Much: Memory Poisoning Attacks on Large Language Model Agents6 Jul 2026
- 2026Untrusted Content Masking for Web Agents with Security Guarantees6 Jul 2026
- 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agents13 Jun 2026
- 2026Assessing Automated Prompt Injection Attacks in Agentic Environments9 Jun 2026
12 newest of 20 All 20 (JSON)
- 2026PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defensescited by 13
- 2026PIArena: A Platform for Prompt Injection Evaluationcited by 10
- 2026SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillationcited by 2
- 2026Rapid Poison: Practical Poisoning Attacks Against the Rapid Response Frameworkcited by 0
- 2026Render Before Reading: Visual Rendering as a Prompt Injection Defensecited by 0
- 2026Render Before Reading: Visual Rendering as a Prompt Injection Defense28 Sep 2026
- 2026SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillation21 Aug 2026
- 2026Rapid Poison: Practical Poisoning Attacks Against the Rapid Response Framework15 Jun 2026
- 2026PIArena: A Platform for Prompt Injection Evaluation9 Apr 2026
- 2026PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defenses13 Mar 2026
- 2026A Systematic Security Evaluation of OpenClaw and Its Variantscited by 11
- 2026Weight space Detection of Backdoors in LoRA Adapterscited by 0
- 2026PIPES: Securing Agent Perception with Provenance and Priorscited by 0
- 2026PIPES: Securing Agent Perception with Provenance and Priors13 Aug 2026
- 2026A Systematic Security Evaluation of OpenClaw and Its Variants3 Apr 2026
- 2026Weight space Detection of Backdoors in LoRA Adapters16 Feb 2026