LongPIBench: A Long-Context Benchmark for Prompt Injection

📄 arXiv: 2608.28411v1 📥 PDF

作者: Yupei Liu, Yuqi Jia, Neil Zhenqiang Gong, Jinyuan Jia

分类: cs.CR, cs.AI

发布日期: 2026-08-28

备注: To appear in Findings of EMNLP'26


💡 一句话要点

提出LongPIBench以解决长上下文中的提示注入攻击问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 提示注入 长上下文 安全性评估 自然语言处理 基准测试

📋 核心要点

  1. 现有的提示注入基准主要集中在短上下文,导致长上下文中的攻击和防御研究不足。
  2. 本文提出LongPIBench,构建长上下文基准以评估提示注入攻击在实际应用中的效果。
  3. 评估结果显示,简单的提示注入攻击在长上下文中成功率高,现有防御措施效果有限。

📝 摘要(中文)

提示注入攻击对大型语言模型在实际应用中构成严重安全风险。然而,现有的提示注入基准主要集中在短上下文输入,长上下文设置下的攻击和防御尚未得到充分探索。为此,本文提出了LongPIBench,一个涵盖论文同行评审、简历筛选、代码审查和电子邮件摘要四个实际应用场景的长上下文基准。我们构建了合成数据集和真实数据集,文本长度从数千到数万标记不等。评估结果显示,在长上下文设置下,提示注入防御存在显著漏洞,简单的启发式提示注入攻击成功率高,且经常绕过最先进的防御。我们希望LongPIBench能作为系统评估长上下文场景中提示注入防御的实用基准。

🔬 方法详解

问题定义:本文旨在解决长上下文中提示注入攻击的评估问题。现有方法主要关注短上下文,导致对防御效果的高估。

核心思路:通过构建LongPIBench基准,涵盖多种实际应用场景,系统评估长上下文中的提示注入攻击及其防御效果。

技术框架:LongPIBench包括合成数据集和真实数据集,涵盖四个场景,文本长度从数千到数万标记,评估防御的有效性。

关键创新:LongPIBench是首个专注于长上下文的提示注入基准,填补了现有研究的空白,提供了更真实的评估环境。

关键设计:数据集设计考虑了多种应用场景,确保了上下文长度的多样性,评估方法采用了简单的启发式攻击,以验证防御的有效性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,简单的启发式提示注入攻击在长上下文设置下的成功率显著高于现有防御措施,且频繁绕过最先进的防御,显示出当前防御策略的不足。这一发现强调了在长上下文中重新评估提示注入防御的重要性。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理中的安全性评估,尤其是在需要长上下文理解的任务中,如学术评审和简历筛选。LongPIBench的引入将有助于开发更强大的防御机制,提升大型语言模型在实际应用中的安全性和可靠性。

📄 摘要(原文)

Prompt injection attacks pose a serious security risk to large language models in real-world applications. However, existing prompt injection benchmarks primarily focus on short-context inputs, leaving the attacks and defenses in long-context settings largely unexplored. This gap leads to a substantial overestimation of the effectiveness of current defenses. In this paper, we bridge the gap by introducing LongPIBench, a long-context benchmark for prompt injection covering 4 realistic application scenarios: paper peer review, resume screening, code review, and email summary. For each scenario, we construct a synthetic dataset and a real-world dataset, with context lengths ranging from thousands to tens of thousands of tokens. The evaluation results on LongPIBench reveal significant vulnerabilities of prompt injection defenses under long-context settings: even simple heuristic prompt injection attacks achieve high success rates and frequently bypass state-of-the-art defenses. We hope LongPIBench can serve as a practical benchmark for systematically evaluating prompt injection defenses in realistic long-context scenarios.