Reproduce “Defending Against Prompt Injection with DataFilter” on OpenResearch
Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Yizhu Wang, Sizhe Chen, Raghad Alkhudair, Basel Alomair, David Wagner
DataFilter proposes a test-time, model-agnostic defense mechanism that filters malicious instructions from untrusted external data before it reaches a large language model (LLM) agent. This approach achieves near-zero attack success rates against prompt injection while preserving LLM utility within 1-2 percentage points across various benchmarks and both proprietary and open-weight models.
Key insights
- A fine-tuned filter LLM can effectively discern and remove malicious imperative sentences from untrusted data by jointly considering the user's original trusted instruction and the external data.
- Strategic dataset construction, including truncation strategies and varied injection placements, enables the filter to achieve strong security with minimal impact on legitimate task performance.
- Operating as a test-time, model-agnostic filter provides a practical and deployable solution for securing any backend LLM, including proprietary black-box models, without requiring architectural modifications or weight access.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.