A Critical Evaluation of Defenses against Prompt Injection Attacks

Yuqi Jia, Zedian Shao, Yupei Liu, Jinyuan Jia, Dawn Song, Neil Zhenqiang Gong · DOI

Introduction

As Large Language Models (LLMs) are increasingly integrated into applications handling untrusted data—such as web browsers or email assistants—they become vulnerable to prompt injection attacks. These attacks involve embedding malicious instructions within data to hijack the model's behavior. While numerous defenses have been proposed, this research provides a necessary reality check, demonstrating that many state-of-the-art defenses are less effective and more detrimental to model performance than previously reported.

The Problem: Unrigorous Evaluation Standards

The authors argue that current evaluation standards for LLM security are often "unrigorous." Many studies claim success by testing against simple, static injected prompts (e.g., "Print exactly Hacked!") or by using misleading metrics like relative "win rates." This creates a false sense of security. To address this, the paper establishes a principled methodology to evaluate defenses across two critical dimensions: effectiveness (resistance to diverse and adaptive attacks) and utility (the ability to perform normal tasks without degradation).

Methodology: Absolute Utility and Adaptive Attacks

The study introduces a comprehensive evaluation framework applied to prominent defenses, including StruQ, SecAlign, Instruction Hierarchy (GPT-4o mini), PromptGuard, and Attention Tracker.

Key methodological shifts include:

  • Absolute Utility Metrics: Moving beyond "relative utility," the authors measure performance on standard NLP tasks using metrics like Accuracy, ROUGE, and GLEU.
  • Attack Success Value (ASV): A granular metric tailored to task-specific outputs rather than binary success/failure.
  • Adaptive Attack Framework: The development of "best-effort" attacks designed to bypass specific defenses. For example, for defenses using delimiters, adaptive attacks find tokens with the closest embedding distance to "spoof" the structure.

Key Insights: The Security-Utility Trade-off

A central finding of the research is that the "security-utility trade-off" is significant and often understated. Fine-tuning models for security (like StruQ and SecAlign) frequently results in a "tax" on general intelligence.

Figure 3: Comparison of absolute utility scores and relative win rates for defended vs. undefended Llama-3-8B models.

As shown in the data above, defended versions of Llama-3-8B-Instruct suffer absolute utility losses of up to 17% compared to the base model. Furthermore, the "Win Rate" metric—often used to justify these defenses—shows that the defended models rarely outperform the base model on standard tasks, with win rates as low as 21.60%.

Performance Against Adaptive Attacks

The research highlights that defenses appearing successful against "toy" prompts often crumble under adaptive testing:

  • StruQ & SecAlign: While original papers claimed near-zero attack success, the authors' adaptive GCG (Greedy Coordinate Gradient) attacks achieved ASVs exceeding 0.80.
  • Instruction Hierarchy: Even production-level defenses like those in GPT-4o mini remained vulnerable to "Combined Attacks," showing ASVs between 0.68 and 0.75.
  • Detection-at-Runtime: Tools like PromptGuard exhibited massive False Positive Rates (0.89), effectively flagging almost all legitimate data as malicious. Meanwhile, Attention Tracker saw its False Negative Rate jump to nearly 100% when faced with adaptive bypasses.

Conclusion

The results suggest that current "secure-by-design" fine-tuning and runtime detection approaches are still in their infancy. The authors conclude that future defense development must prioritize maintaining high general-purpose utility while remaining robust against optimization-based adaptive attacks. To facilitate this, they have released their code and the new MMLU-PI benchmark to serve as a foundation for more rigorous security research.

Summary updated

BibTeX
@inproceedings{jia2026critical,
  author = {Yuqi Jia and Zedian Shao and Yupei Liu and Jinyuan Jia and Dawn Song and Neil Zhenqiang Gong},
  title = {{A Critical Evaluation of Defenses against Prompt Injection Attacks}},
  booktitle = {SACMAT},
  year = {2026},
  doi = {10.1145/3750555.3811884},
}
Figure