CAPTURE: Context-Aware Prompt Injection Testing and Robustness Enhancement

Gauri Kholkar, Ratinder Ahuja


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.
Anthology ID:
2025.llmsec-1.13
Volume:
Proceedings of the The First Workshop on LLM Security (LLMSEC)
Month:
August
Year:
2025
Address:
Vienna, Austria
Editor:
Jekaterina Novikova
Venues:
LLMSEC | WS
SIG:
SIGSEC
Publisher:
Association for Computational Linguistics
Note:
Pages:
176–188
Language:
URL:
https://preview.aclanthology.org/corrections-2025-08/2025.llmsec-1.13/
DOI:
Bibkey:
Cite (ACL):
Gauri Kholkar and Ratinder Ahuja. 2025. CAPTURE: Context-Aware Prompt Injection Testing and Robustness Enhancement. In Proceedings of the The First Workshop on LLM Security (LLMSEC), pages 176–188, Vienna, Austria. Association for Computational Linguistics.
Cite (Informal):
CAPTURE: Context-Aware Prompt Injection Testing and Robustness Enhancement (Kholkar & Ahuja, LLMSEC 2025)
Copy Citation:
PDF:
https://preview.aclanthology.org/corrections-2025-08/2025.llmsec-1.13.pdf
Supplementarymaterial:
 2025.llmsec-1.13.SupplementaryMaterial.zip
Supplementarymaterial:
 2025.llmsec-1.13.SupplementaryMaterial.txt