arXiv:2602.00750cs.CRcs.AI2026-02

攻击者用自适应后缀绕过检测,让大模型漏洞百出。

Bypassing Prompt Injection Detectors through Evasive Injections

  • 设计通用后缀同时骗过多个隐藏层检测器。
  • 在Phi-3和Llama-3上成功率分别达93.91%和99.63%。
  • 适合研究安全防御或对抗样本的开发者参考。

大型语言模型(LLMs)在交互式和检索增强系统中日益普及,但仍易受提示注入攻击:攻击者通过注入次级提示,迫使模型偏离用户指令,执行恶意任务。近期研究提出利用模型隐藏层激活偏移训练的机器学习检测器来识别此类漂移。本文证明这些检测器对自适应攻击不具鲁棒性。我们提出一种多探针逃避攻击,为污染输入添加经对抗优化的后缀,联合优化一个通用后缀,以同时欺骗所有层级漂移检测器,同时保持原始注入的有效性。采用改进的贪婪坐标梯度(GCG)方法生成通用后缀,使提示注入在多个探测器下持续逃避。在Phi-3 3.8B和Llama-3 8B上,单一后缀实现93.91%和99.63%的攻击成功率,成功同时绕过全部检测器。结果表明基于激活的漂移检测器极易受到自适应提示注入攻击,亟需更强防御。我们还提出一种基于对抗后缀增强的防御策略:在前向传播中随机附加多个后缀并训练检测器,该方法被验证能有效抵御此类逃避攻击。

原文摘要 · Abstract (English)

Large language models (LLMs) are increasingly used in interactive and retrieval-augmented systems, but they remain vulnerable to prompt injection attacks, where injected secondary prompts force the model to deviate from the user's instructions to execute a potentially malicious task defined by the adversary. Recent work shows that ML models trained on activation shifts from LLMs' hidden layers can detect such drift. In this paper, we demonstrate that these detectors are not robust to adaptive adversaries. We propose a multi-probe evasion attack that appends an adversarially optimised suffix to poisoned inputs, jointly optimising a universal suffix to simultaneously fool all layer-wise drift detectors while preserving the effectiveness of the underlying injection. Using a modified Greedy Coordinate Gradient (GCG) approach, we generate universal suffixes that make prompt injections consistently evasive across multiple probes simultaneously. On Phi-3 3.8B and Llama-3 8B, a single suffix achieves attack success rates of 93.91% and 99.63% in successfully evading all detectors simultaneously. These results show that activation-based task drift detectors are highly vulnerable to adaptive prompt injection attacks, motivating stronger defences against such threats. We also propose a defence based on adversarial suffix augmentation: we generate multiple suffixes, append one at random during forward passes, and train detectors on the resulting activations. This approach is found to be effective against evasive attacks.

提示攻击对抗样本安全检测

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。