黑客通过工具调用链悄悄放大大模型成本,658倍耗能且难被发现。
Beyond Max Tokens: Stealthy Resource Amplification via Tool Calling Chains in LLM Agents
- 伪装成正常接口,用文本编辑诱导模型陷入无限工具调用
- 单次请求成本飙升658倍,能耗增100至560倍,显存占用达35%-74%
- 专攻智能体工作流,适合研究安全防御与资源管控的开发者
智能体-工具交互环是现代大语言模型智能体的关键攻击面。现有拒绝服务攻击多作用于用户输入或检索增强生成(RAG)上下文层,本质上为单轮操作,限制了成本放大并降低了隐蔽性。为此,我们提出一种基于模型上下文协议(MCP)的隐蔽、多轮经济型拒绝服务攻击,位于工具层。通过仅修改可见文本字段并实现模板驱动的返回策略,恶意服务器保持函数签名和终端良性负载不变,同时引导智能体进入冗长、详细的工具调用链。我们利用蒙特卡洛树搜索(MCTS)优化这些纯文本修改,在保证任务成功率的前提下最大化成本。在ToolBench和BFCL基准上,六种大模型的攻击轨迹超过6万令牌,单次查询成本最高提升658倍,能耗增加100至560倍,GPU键值缓存占用率达35%至74%。标准提示过滤器和输出轨迹监控几乎无法检测此类攻击,凸显出需加强针对智能体过程的防护,而非仅关注最终结果。代码即将开源。
原文摘要 · Abstract (English)
The agent--tool interaction loop is a critical attack surface for modern Large Language Model (LLM) agents. Existing denial-of-service (DoS) attacks typically function at the user-prompt or retrieval-augmented generation (RAG) context layer and are inherently single-turn in nature. This limitation restricts cost amplification and diminishes stealth in goal-oriented workflows. To address these issues, we proposed a stealthy, multi-turn economic DoS attack at the tool layer under the Model Context Protocol (MCP). By simply editing text-visible fields and implementing a template-driven return policy, our malicious server preserves function signatures and the terminal benign payload while steering agents into prolonged, verbose tool-calling chains. We optimize these text-only edits with Monte Carlo Tree Search (MCTS) to maximize cost under a task-success constraint. Across six LLMs on ToolBench and BFCL benchmarks, our attack yields trajectories over 60K tokens, increases per-query cost by up to 658 times, raises energy by 100 to 560 times, and pushes GPU key-value (KV) cache occupancy to 35--74%. Standard prompt filters and output trajectory monitors seldom detect these attacks, highlighting the need for defenses that safeguard agentic processes rather than focusing solely on final outcomes. We will release the code soon.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。