发现工具描述符可被操控,导致大模型调用危险工具,提出三层防御方案。
Semantic Attacks on Tool-Augmented LLMs: Securing the Model Context Protocol Against Descriptor-Level Manipulation
- 通过分析工具描述符的语义攻击,识别三类操纵手段。
- 未加固时36%情况下会误调危险工具,全栈防护后降至15%。
- 适用于需安全调用外部工具的大模型系统研发与部署者。
模型上下文协议(MCP)使大语言模型(LLMs)通过工具描述符与外部工具交互,拓展其任务执行、自主决策和多智能体协作能力。现有MCP部署将工具描述符视为可信元数据,尽管它们直接嵌入模型推理上下文,这引入了此前未充分研究的语义攻击面。当前防御主要针对提示注入,忽视描述符级操纵可能导致工具选择偏差及下游推理错误。为此,我们形式化三类描述符驱动攻击:工具投毒、影子攻击和地毯拉扯。提出分层防御方案,包含描述符完整性验证、辅助模型预上下文语义审查,以及轻量级运行时防护,无需模型重训练。在控制的对抗性MCP场景中,评估GPT-5.3、DeepSeek-V3和LLaMA-3.5在八种提示策略下的表现,工具元数据被操纵以模拟真实攻击。结果表明,描述符操纵可显著改变工具选择行为,在基线配置下导致高达36%的试验出现不安全工具调用。所提全栈缓解方案将不安全调用降至15%,同时拦截率提升至74%,显著增强对描述符驱动攻击的抵抗能力。跨模型分析进一步揭示不同模型架构与提示策略在鲁棒性、延迟和敏感性上的显著差异。本研究为工具调用型大模型系统的描述符级威胁与缓解策略提供了受控的跨模型评估,建立了部署安全可靠工具增强型大模型的实证基础。
原文摘要 · Abstract (English)
The Model Context Protocol (MCP) enables Large Language Models (LLMs) to interact with external tools via tool descriptors, thereby extending their capabilities for task execution, autonomous decision-making, and multi-agent coordination. Existing MCP deployments treat tool descriptors as trusted metadata, despite their direct integration into the LLM reasoning context. This introduces a previously underexplored semantic attack surface. Current defenses primarily target prompt injection, neglecting descriptor-level manipulation that can bias tool selection and downstream reasoning. To address this gap, we formalize three descriptor-driven attack classes: Tool Poisoning, Shadowing, and Rug Pull. We propose a layered defense solution that integrates descriptor integrity verification, pre-context semantic vetting with an auxiliary LLM, and lightweight runtime guardrails, without requiring model retraining. We evaluate GPT-5.3, DeepSeek-V3, and LLaMA-3.5 across eight prompting strategies in controlled, adversarial MCP scenarios in which tool metadata is manipulated to simulate realistic attacks. Results demonstrate that descriptor manipulation can substantially alter tool-selection behavior, producing unsafe tool invocations in up to 36% of trials under baseline configurations. The proposed full-stack mitigation reduces unsafe invocations to 15% while increasing the block rate to 74%, demonstrating substantial improvement in resistance to descriptor-driven attacks. Cross-model analysis further reveals significant differences in robustness, latency, and sensitivity to descriptor-level manipulation across LLM architectures and prompting strategies. This study provides a controlled cross-model evaluation of descriptor-level threats and mitigation strategies in tool-calling LLM systems, establishing an empirical foundation for deploying secure and resilient tool-augmented LLMs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。