Evaluation of Prompt Injection Defenses in Large Language Models

Priyal Deep, Shane Emmons, Amy Fox, Kyle Bacon, Kelley McAllister +2 more
4/26/2026
cs.CRcs.AI

No confident code implementation found for this paper.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{deep2026evaluation,
  title  = {Evaluation of Prompt Injection Defenses in Large Language Models},
  author = {Priyal Deep and Shane Emmons and Amy Fox and Kyle Bacon and Kelley McAllister and Peter Ortiz and Krisztian Flautner},
  year   = {2026},
  eprint = {2604.23887},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.23887v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.23887.svg)](https://codeofpaper.com/paper/2604.23887)

Discussion