CAPTURE: Context-Aware Prompt Injection Testing and Robustness Enhancement

Gauri Kholkar, Ratinder Ahuja
5/18/2025
cs.CLcs.AI

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Prompt injection remains a major security risk for large language models. However, the efficacy of existing guardrail models in context-aware settings remains underexplored, as they often rely on static attack benchmarks. Additionally, they have over-defense tendencies. We introduce CAPTURE, a novel context-aware benchmark assessing both attack detection and over-defense tendencies with minimal in-domain examples. Our experiments reveal that current prompt injection guardrail models suffer from high false negatives in adversarial cases and excessive false positives in benign scenarios, highlighting critical limitations. To demonstrate our framework's utility, we train CaptureGuard on our generated data. This new model drastically reduces both false negative and false positive rates on our context-aware datasets while also generalizing effectively to external benchmarks, establishing a path toward more robust and practical prompt injection defenses.

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. 1 weaker match is hidden by default — 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{kholkar2025capture,
  title  = {CAPTURE: Context-Aware Prompt Injection Testing and Robustness Enhancement},
  author = {Gauri Kholkar and Ratinder Ahuja},
  year   = {2025},
  eprint = {2505.12368},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.12368v2}
}

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/2505.12368.svg)](https://codeofpaper.com/paper/2505.12368)

Discussion