arXiv:2510.02554cs.CRcs.AI2025-10被引 26

攻击大模型工具选择机制,让特定工具被优先调用

ToolTweak: An Attack on Tool Selection in LLM-based Agents

  • 通过改写工具名和描述,诱导代理选择指定工具
  • 攻击使目标工具选择率从20%升至81%,效果显著
  • 揭示工具生态中的公平性与安全风险,适合关注AI安全的研究者

随着大语言模型驱动的智能体越来越多地调用外部工具,工具使用已成为扩展其能力的关键机制。这些智能体通常从不断增长的数据库或市场中选择工具来完成用户任务,导致工具提供方之间产生隐性竞争。本文揭示这一选择过程存在严重漏洞:通过迭代修改工具名称和描述,攻击者可系统性地引导智能体偏向选择特定工具,从而获得不公平优势。我们提出ToolTweak,一种轻量级自动化攻击方法,在开源与闭源模型间均表现出强迁移性,将目标工具的选择率从约20%提升至最高81%。此外,此类攻击还引发工具使用分布的系统性偏移,暴露了新兴工具生态在公平性、竞争性和安全性方面的风险。为缓解该问题,我们评估了重写与困惑度过滤两种防御策略,能有效降低偏差,促使智能体更平等地选择功能相似的工具。所有代码将在论文接收后开源。

原文摘要 · Abstract (English)

As LLMs increasingly power agents that interact with external tools, tool use has become an essential mechanism for extending their capabilities. These agents typically select tools from growing databases or marketplaces to solve user tasks, creating implicit competition among tool providers and developers for visibility and usage. In this paper, we show that this selection process harbors a critical vulnerability: by iteratively manipulating tool names and descriptions, adversaries can systematically bias agents toward selecting specific tools, gaining unfair advantage over equally capable alternatives. We present ToolTweak, a lightweight automatic attack that increases selection rates from a baseline of around 20% to as high as 81%, with strong transferability between open-source and closed-source models. Beyond individual tools, we show that such attacks cause distributional shifts in tool usage, revealing risks to fairness, competition, and security in emerging tool ecosystems. To mitigate these risks, we evaluate two defenses: paraphrasing and perplexity filtering, which reduce bias and lead agents to select functionally similar tools more equally. All code will be open-sourced upon acceptance.

AI安全工具选择大模型攻击

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