Prompt injection defenses fail in long-context settings
prompt injection defenses are ineffective when inputs span thousands of tokens
AI/ML arXiv 28 Aug 2026 Benchmark Prototype evidence
Published as “LongPIBench: A Long-Context Benchmark for Prompt Injection”
Why it matters
Deployments that rely on long documents-such as peer-review assistants, resume screeners, code reviewers, and email summarizers-cannot rely on many existing prompt-injection defenses and must redesign security measures for long-context inputs.
Summary
Prompt injection attacks remain highly effective on long-context inputs, achieving near-perfect success rates (up to 1.00 ASR) and causing most existing detection and prevention defenses to fail, often with high false-positive or false-negative rates. The evidence comes from synthetic and real-world datasets spanning thousands to tens of thousands of tokens, evaluated on eight LLMs across four realistic tasks.
What they found 3
- Authority spoof attack achieves perfect success on several tasks in long-context settings.
“Authority spoof reaches ASR of 1.00 on paper review, email summary, and code review, as shown in Table 7 in the Appendix.”
- Detection-based defenses either flag almost everything or miss almost all attacks.
“Detection-based defenses exhibit either high FPR or FNR: Table 3 reports the FPR and FNR of detection-based defenses on our benchmark.”
- Prevention-based defenses provide little reduction in attack success, often matching the no-defense baseline.
“Table 4 shows the ASR of prevention-based defenses under Authority spoof attacks. Overall, existing prevention techniques fail to reduce ASR in long-context settings. Across all four tasks, these defenses exhibit ASR comparable to the no-defense baseline, frequently reaching 1.00 under most attacks.”
Caveats 6
- PromptLocate and MetaSecAlign 8B achieve the lowest ASR among prevention defenses, reducing ASR for some tasks but still remaining above 0.4.
- DataSentinel and DistilBert achieve low FNR at the cost of near-perfect FPR, indicating a trade-off rather than true detection capability.
- The benchmark focuses on document-centric long-context tasks and does not consider agentic workflows with multi-step reasoning or tool use.
- All evaluations are performed on static single-pass inputs; dynamic iterative or tool-calling pipelines are not modeled.
- The study does not identify the internal mechanism behind the effect of added benign context, leaving context dilution vs. positional effects unresolved.
- Optimization-based attacks are limited to GCG and its universal variant, omitting newer automated attack methods.
What’s new here 4
- A benchmark (LongPIBench) specifically targeting long-context prompt injection scenarios.
- Includes both synthetic and real-world datasets with context lengths of thousands to tens of thousands of tokens.
- Evaluates a wide range of detection-based and prevention-based defenses under these long-context conditions.
- Systematic comparison against prior short-context benchmarks to reveal overestimation of defense effectiveness.