ClawGuard在工具调用边界强制用户确认规则,防住间接提示注入攻击。
ClawGuard: A Runtime Security Framework for Tool-Augmented LLM Agents Against Indirect Prompt Injection

- 在每次工具调用前自动推导任务约束,拦截恶意指令。
- 在6个基准上对5个大模型实现0%攻击成功率,无额外令牌开销。
- 无需修改模型或基础设施,适合高安全需求的智能体系统。
工具增强型大语言模型(LLM)代理在自动化复杂多步任务中表现出色,但易受间接提示注入攻击。攻击者通过在工具返回内容中嵌入恶意指令,使代理将这些内容作为可信观察纳入对话历史。为此,我们提出 extsc{ClawGuard},一种新型运行时安全框架,在每个工具调用边界强制执行用户确认规则集,将依赖对齐的防御转变为确定性、可审计的机制,能在造成实际影响前拦截攻击性工具调用。通过在外部工具调用前自动推导与任务目标相关的访问约束, extsc{ClawGuard} 无需模型修改或基础设施变更,即可阻断所有三种注入路径。在五个主流语言模型上,针对涵盖网络、本地、MCP 和技能通道的六个注入基准,以及覆盖操作系统、网络和代码任务的三个实用性基准的实验表明, extsc{ClawGuard} 在不降低代理效用且无显著令牌开销的前提下,实现了对间接提示注入的稳健防护。本工作确立了确定性工具调用边界控制作为安全智能体系统有效防御机制。
原文摘要 · Abstract (English)
Tool-augmented Large Language Model (LLM) agents have demonstrated impressive capabilities in automating complex, multi-step real-world tasks, yet remain vulnerable to indirect prompt injection. Adversaries exploit this weakness by embedding malicious instructions within tool-returned content, which agents directly incorporate into their conversation history as trusted observations. To address these vulnerabilities, we introduce \textsc{ClawGuard}, a novel runtime security framework that enforces a user-confirmed rule set at every tool-call boundary, transforming unreliable alignment-dependent defense into a deterministic, auditable mechanism that intercepts adversarial tool calls before any real-world effect is produced. By automatically deriving task-specific access constraints from the user's stated objective prior to any external tool invocation, \textsc{ClawGuard} blocks all three injection pathways without model modification or infrastructure change. Experiments across five state-of-the-art language models on six injection benchmarks covering web, local, MCP, and skill channels, as well as three utility benchmarks covering OS, web, and code tasks, demonstrate that \textsc{ClawGuard} achieves robust protection against indirect prompt injection without compromising agent utility or introducing significant token overhead. This work establishes deterministic tool-call boundary enforcement as an effective defense mechanism for secure agentic AI systems. Code is publicly available at github.com/Claw-Guard/ClawGuard/.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。