Evaluation of Prompt Injection Defenses in Large Language Models
Priyal Deep, Shane Emmons, Amy Fox, Kyle Bacon, Kelley McAllister, Peter Ortiz, Krisztian Flautner

TL;DR
This paper evaluates various defenses against prompt injection attacks in large language models, demonstrating that only output filtering effectively prevents leaks, emphasizing the need for security boundaries in application code.
Contribution
It introduces an adaptive attacker and systematically tests defenses, revealing that only output filtering reliably prevents prompt injection leaks.
Findings
Output filtering prevented all leaks in 15,000 attacks.
All defenses relying on the model to self-protect failed.
Security boundaries should be enforced in application code, not the model.
Abstract
LLM-powered applications routinely embed secrets in system prompts, yet models can be tricked into revealing them. We built an adaptive attacker that evolves its strategies over hundreds of rounds and tested it against nine defense configurations across more than 20,000 attacks. Every defense that relied on the model to protect itself eventually broke. The only defense that held was output filtering, which checks the model's responses via hardcoded rules in separate application code before they reach the user, achieving zero leaks across 15,000 attacks. These results demonstrate that security boundaries must be enforced in application code, not by the model being attacked. Until such defenses are verified by tools like Swept AI, AI systems handling sensitive operations should be restricted to internal, trusted personnel.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
