arXiv:2508.15310cs.CRcs.AI2025-08EMNLP被引 51

通过工具依赖图防范大模型代理的间接提示注入攻击

IPIGuard: A Novel Tool Dependency Graph-Based Defense Against Indirect Prompt Injection in LLM Agents

  • 构建任务执行的工具依赖图,分离计划与外部数据交互
  • 在AgentDojo上使攻击成功率从78%降至12%,防御效果显著
  • 适合关注大模型代理安全、尤其是工具调用风险的研究者

大型语言模型(LLM)代理广泛应用于真实场景,借助工具获取和操作外部数据完成复杂任务。然而,当与不可信数据源(如公开网站)交互时,工具响应可能包含被注入的指令,隐蔽地影响代理行为,导致恶意结果,这一威胁称为间接提示注入(IPI)。现有防御多依赖高级提示策略或辅助检测模型,但其本质依赖模型内在安全性假设,缺乏对代理行为的结构化约束,导致代理仍可无限制调用工具,易受更强攻击绕过。为此,我们提出一种新型防御范式IPIGuard,将代理的任务执行过程建模为预规划的工具依赖图(TDG)上的遍历。通过显式解耦行动规划与外部数据交互,IPIGuard大幅减少由注入指令触发的意外工具调用,显著提升对IPI攻击的鲁棒性。在AgentDojo基准上的实验表明,IPIGuard在有效性与鲁棒性之间取得更优平衡,为动态环境中更安全的智能体系统发展提供新路径。

原文摘要 · Abstract (English)

Large language model (LLM) agents are widely deployed in real-world applications, where they leverage tools to retrieve and manipulate external data for complex tasks. However, when interacting with untrusted data sources (e.g., fetching information from public websites), tool responses may contain injected instructions that covertly influence agent behaviors and lead to malicious outcomes, a threat referred to as Indirect Prompt Injection (IPI). Existing defenses typically rely on advanced prompting strategies or auxiliary detection models. While these methods have demonstrated some effectiveness, they fundamentally rely on assumptions about the model's inherent security, which lacks structural constraints on agent behaviors. As a result, agents still retain unrestricted access to tool invocations, leaving them vulnerable to stronger attack vectors that can bypass the security guardrails of the model. To prevent malicious tool invocations at the source, we propose a novel defensive task execution paradigm, called IPIGuard, which models the agents' task execution process as a traversal over a planned Tool Dependency Graph (TDG). By explicitly decoupling action planning from interaction with external data, IPIGuard significantly reduces unintended tool invocations triggered by injected instructions, thereby enhancing robustness against IPI attacks. Experiments on the AgentDojo benchmark show that IPIGuard achieves a superior balance between effectiveness and robustness, paving the way for the development of safer agentic systems in dynamic environments.

大模型安全提示注入工具调用智能体防御

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