arXiv:2506.12104cs.CRcs.AI2025-06NeurIPS被引 57

动态防御框架提升LLM代理抗提示注入攻击能力

DRIFT: Dynamic Rule-Based Defense with Injection Isolation for Securing LLM Agents

  • 基于动态规则与隔离机制构建安全防护体系
  • 在多个基准测试中实现高安全性与高可用性
  • 适合需要安全交互的智能代理系统开发者

大型语言模型(LLMs)因其强大的推理与规划能力,正成为智能体系统的核心。通过调用外部工具与环境交互,这些代理可完成复杂用户任务。然而,这种交互也带来了提示注入攻击风险——恶意输入可能误导代理行为,导致经济损失、隐私泄露或系统被攻破。现有系统级防御虽有效,但仍面临规则难以动态更新、内存流缺乏隔离两大挑战。为此,我们提出动态规则隔离框架DRIFT,通过安全规划器生成最小功能轨迹与参数检查清单,动态验证器监控计划偏差并评估权限合规性,注射隔离器则从内存流中检测并屏蔽冲突指令,降低长期风险。我们在AgentDojo、ASB和AgentDyn基准上实证验证了DRIFT的有效性,结果表明其在多种模型上兼具强安全性能与高实用性,展现良好鲁棒性与适应性。

原文摘要 · Abstract (English)

Large Language Models (LLMs) are increasingly central to agentic systems due to their strong reasoning and planning capabilities. By interacting with external environments through predefined tools, these agents can carry out complex user tasks. Nonetheless, this interaction also introduces the risk of prompt injection attacks, where malicious inputs from external sources can mislead the agent's behavior, potentially resulting in economic loss, privacy leakage, or system compromise. System-level defenses have recently shown promise by enforcing static or predefined policies, but they still face two key challenges: the ability to dynamically update security rules and the need for memory stream isolation. To address these challenges, we propose Dynamic Rule-based Isolation Framework for Trustworthy agentic systems (DRIFT), which enforces the dynamic security policy and injection isolation for securing LLM agents against prompt injection attacks. A Secure Planner first constructs a minimal function trajectory and a JSON-schema-style parameter checklist for each function node based on the user query. A Dynamic Validator then monitors deviations from the original plan, assessing whether changes comply with privilege limitations and the user's intent. Finally, an Injection Isolator detects and masks any instructions that may conflict with the user query from the memory stream to mitigate long-term risks. We empirically validate the effectiveness of DRIFT on the AgentDojo, ASB, and AgentDyn benchmark, demonstrating its strong security performance while maintaining high utility across diverse models, showcasing both its robustness and adaptability. The project website is available at https://safo-lab.github.io/DRIFT.

LLM安全智能代理提示注入

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