Decoding Guardrails: XAI-Guided Perturbation Analysis of Prompt Injection Detection

📄 arXiv: 2609.24801v1 📥 PDF

作者: Fernando Outeda, Gustavo Betarte, Juan Diego Campo, Fiorella Cravero

分类: cs.CR, cs.AI

发布日期: 2026-09-21


💡 一句话要点

应用可解释人工智能分析提示注入检测中的防护机制

🎯 匹配领域: 支柱一:机器人控制 (Robot Control) 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 提示注入 可解释人工智能 对抗性攻击 分类器防护 显著性分析 文本修改

📋 核心要点

  1. 现有的基于分类器的防护机制在面对提示注入和越狱攻击时,其内部决策逻辑不透明,给防御和攻击双方带来了挑战。
  2. 本文通过可解释人工智能技术,分析Prompt Guard 2的决策过程,揭示其对恶意和良性提示的区分机制。
  3. 实验结果表明,Prompt Guard 2的决策依赖于多个词元的累积贡献,且通过显著性引导的文本修改可以成功绕过该防护机制。

📝 摘要(中文)

随着大型语言模型(LLMs)在生产系统中的广泛应用,提示注入和越狱攻击的风险日益增加。作为防御这些攻击的第一道防线,基于分类器的防护机制(如Prompt Guard 2)被广泛使用,但其内部决策逻辑对防御者和攻击者而言均较为不透明。本文通过可解释人工智能(XAI)技术,探索Prompt Guard 2如何区分恶意与良性提示。通过四个实验,我们发现Prompt Guard 2的决策依赖于多个词元的累积贡献,而非少数主导词元。同时,基于显著性引导的同义词替换和句子级改写可以在仅改变文本的一小部分的情况下翻转其预测,甚至在某些情况下成功越狱。数据集规模的显著性分析进一步表明,未被检测的注入提示系统性地缺乏分类器所依赖的词汇标记。我们讨论了这些发现对基于分类器的防护机制设计和评估的影响,并认为旨在支持透明度的解释方法可能会降低构建成功对抗性绕过的成本。

🔬 方法详解

问题定义:本文旨在解决大型语言模型在生产环境中面临的提示注入和越狱攻击问题。现有的防护机制(如Prompt Guard 2)在决策逻辑上缺乏透明度,导致其防御效果难以评估。

核心思路:通过应用可解释人工智能(XAI)技术,分析Prompt Guard 2的决策过程,揭示其如何区分恶意与良性提示,从而为改进防护机制提供依据。

技术框架:研究采用了四个实验,结合Vanilla Gradient和SHAP归因方法,探讨Prompt Guard 2的决策依据。实验流程包括数据集构建、显著性分析、文本修改实验和结果评估。

关键创新:最重要的创新在于通过显著性引导的同义词替换和句子级改写,成功翻转了Prompt Guard 2的预测,揭示了其决策的脆弱性。这与现有方法的主要区别在于,前者强调了多个词元的累积贡献,而非单一词元的影响。

关键设计:实验中采用了多种文本修改策略,重点关注词汇标记的缺失与显著性分析,确保了对Prompt Guard 2决策逻辑的深入理解。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,Prompt Guard 2的决策依赖于多个词元的累积贡献,而通过显著性引导的文本修改可以成功翻转其预测,部分情况下实现越狱。此研究为防护机制的设计提供了新的视角,强调了透明度与安全性之间的平衡。

🎯 应用场景

该研究的潜在应用领域包括安全性增强的自然语言处理系统、对抗性攻击检测和防护机制的设计。通过深入理解防护机制的决策逻辑,可以为未来的模型开发提供更有效的防护策略,提升系统的安全性和鲁棒性。

📄 摘要(原文)

Large language models (LLMs) are increasingly deployed in production systems, raising concerns about their exposure to adversarial manipulation through prompt injection and jailbreak attacks. Classifier-based guardrails, such as Prompt Guard 2, are widely used as a first line of defense against such attacks, but their internal decision logic is largely opaque to both defenders and attackers. This paper presents an exploratory case study that applies explainable artificial intelligence (XAI) techniques to analyze how Prompt Guard 2 distinguishes malicious from benign prompts. We conduct four experiments to probe this question empirically. Guided by Vanilla Gradient and SHAP attributions, we find that Prompt Guard 2's decisions rely on the cumulative contribution of many tokens rather than a few dominant ones, yet saliency-guided synonym substitution and sentence-level paraphrasing can flip its predictions while altering only a moderate fraction of the text, in some cases yielding a successful jailbreak against the underlying LLM. A dataset-scale saliency analysis further shows that undetected injection prompts systematically lack the lexical markers the classifier relies on. We discuss the implications of these findings for the design and evaluation of classifier-based guardrails, and argue that explanation methods intended to support transparency can simultaneously lower the cost of constructing successful adversarial bypasses.