CommandSans:以手术级精度提示净化保障AI智能体安全
CommandSans: Securing AI Agents with Surgical Precision Prompt Sanitization
AI总结:
针对LLM智能体面临的间接提示注入威胁,提出基于令牌级净化的提示消毒方法,将数据与指令分离,在多种基准上大幅降低攻击成功率且不影响智能体效用。
摘要:
随着能够访问众多工具和敏感数据的LLM智能体的日益普及,间接提示注入的攻击面显著扩大。然而,由于攻击具有上下文依赖性,现有防御措施往往校准不当,无法可靠地区分恶意指令和良性指令,导致高误报率,阻碍了其在实际中的应用。为解决这一问题,我们提出了一种受计算机安全基本原则启发的新方法:数据不应包含可执行指令。与样本级分类不同,我们提出了一种令牌级净化过程,从工具输出中外科手术式地移除任何针对AI系统的指令,并作为副产品捕获恶意指令。与现有的安全分类器相比,该方法非阻塞、无需校准,且与工具输出的上下文无关。此外,我们仅使用现成的指令微调数据即可训练此类令牌级预测器,无需依赖来自挑战赛或其他合成来源的不切实际的提示注入示例。在实验中,我们发现该方法在AgentDojo、BIPIA、InjecAgent、ASB和SEP等广泛攻击和基准测试中具有良好的泛化能力,攻击成功率(ASR)降低了7-10倍(在AgentDojo上从34%降至3%),且在良性及恶意场景中均不影响智能体的效用。
英文摘要:
The increasing adoption of LLM agents with access to numerous tools and sensitive data significantly widens the attack surface for indirect prompt injections. Due to the context-dependent nature of attacks, however, current defenses are often ill-calibrated as they cannot reliably differentiate malicious and benign instructions, leading to high false positive rates that prevent their real-world adoption. To address this, we present a novel approach inspired by the fundamental principle of computer security: data should not contain executable instructions. Instead of sample-level classification, we propose a token-level sanitization process, which surgically removes any instructions directed at AI systems from tool outputs, capturing malicious instructions as a byproduct. In contrast to existing safety classifiers, this approach is non-blocking, does not require calibration, and is agnostic to the context of tool outputs. Further, we can train such token-level predictors with readily available instruction-tuning data only, and don't have to rely on unrealistic prompt injection examples from challenges or of other synthetic origin. In our experiments, we find that this approach generalizes well across a wide range of attacks and benchmarks like AgentDojo, BIPIA, InjecAgent, ASB and SEP, achieving a 7-10x reduction of attack success rate (ASR) (34% to 3% on AgentDojo), without impairing agent utility in both benign and malicious settings.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。