arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2502.16580cs.CR
收藏

间接提示注入攻击能否被检测和移除?

Can Indirect Prompt Injection Attacks Be Detected and Removed?

National University of Singapore(新加坡国立大学);HKUST(香港科技大学)

Yulin Chen, Haoran Li, Yuan Sui, Yufei He, Yue Liu, Yangqiu Song, Bryan Hooi

AI总结:

针对外部工具引入的间接提示注入,本文构建基准数据集,评估并训练检测模型,同时比较分段移除与提取移除两种后处理方法。

摘要:

提示注入攻击通过误导大语言模型(LLM)偏离原始输入指令并执行恶意注入的指令来操纵它们,这是因为 LLM 具备遵循指令的能力,却无法区分原始输入指令与恶意注入指令。为防御此类攻击,近期研究已开发出多种检测机制。如果我们将范围严格限定在执行检测而非直接防御的工作上,其中大多数聚焦于直接提示注入攻击,而针对间接场景的研究很少;在间接场景中,被注入的指令间接来自搜索引擎等外部工具。此外,当前工作主要研究注入检测方法,对旨在检测后缓解注入的后处理方法关注较少。本文研究检测并移除间接提示注入攻击的可行性,并构建了一个用于评估的基准数据集。在检测方面,我们评估现有 LLM 和开源检测模型的性能,并进一步使用精心构建的训练数据集训练检测模型。在移除方面,我们评估两种直观方法:(1)分段移除法,对被注入的文档进行分段,并移除包含注入指令的部分;(2)提取移除法,训练一个提取模型来识别并移除注入指令。

英文摘要:

Prompt injection attacks manipulate large language models (LLMs) by misleading them to deviate from the original input instructions and execute maliciously injected instructions, because of their instruction-following capabilities and inability to distinguish between the original input instructions and maliciously injected instructions. To defend against such attacks, recent studies have developed various detection mechanisms. If we restrict ourselves specifically to works which perform detection rather than direct defense, most of them focus on direct prompt injection attacks, while there are few works for the indirect scenario, where injected instructions are indirectly from external tools, such as a search engine. Moreover, current works mainly investigate injection detection methods and pay less attention to the post-processing method that aims to mitigate the injection after detection. In this paper, we investigate the feasibility of detecting and removing indirect prompt injection attacks, and we construct a benchmark dataset for evaluation. For detection, we assess the performance of existing LLMs and open-source detection models, and we further train detection models using our crafted training datasets. For removal, we evaluate two intuitive methods: (1) the segmentation removal method, which segments the injected document and removes parts containing injected instructions, and (2) the extraction removal method, which trains an extraction model to identify and remove injected instructions.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑