MCPShield: 一种用于模型上下文协议代理自适应信任校准的安全认知层
MCPShield: A Security Cognition Layer for Adaptive Trust Calibration in Model Context Protocol Agents
AI总结:
MCPShield通过元数据引导探测和历史轨迹推理,提升代理在调用MCP工具时的安全性,有效防御MCP攻击。
摘要:
模型上下文协议(MCP)标准化了基于大语言模型(LLM)的代理工具使用,并使第三方服务器能够参与其中。这种开放性引入了安全不一致的问题:代理会隐式信任由可能不可信的MCP服务器暴露的工具。然而,尽管其具有极高的实用性,现有代理通常对第三方MCP服务器提供有限的验证。因此,代理在工具调用生命周期中仍容易受到利用代理与服务器之间不一致性的MCP攻击。在本文中,我们提出MCPShield作为一种插件安全认知层,以缓解这种不一致并确保在调用基于MCP的工具时代理的安全性。受人类经验驱动的工具验证启发,MCPShield在调用前协助代理通过元数据引导的探测进行安全认知。我们的方法在受控边界内限制执行,同时认知运行时事件,并在调用后通过推理历史轨迹更新安全认知,基于人类对工具行为的后使用反思。实验表明,MCPShield在六个广泛使用的代理LLM上,对六个新的MCP攻击场景表现出强大的泛化能力,同时避免了对良性服务器的误报,并具有低的部署开销。总体而言,我们的工作为开放代理生态系统中的基于MCP的工具调用提供了实用且稳健的安全保障。
英文摘要:
The Model Context Protocol (MCP) standardizes tool use for LLM-based agents and enable third-party servers. This openness introduces a security misalignment: agents implicitly trust tools exposed by potentially untrusted MCP servers. However, despite its excellent utility, existing agents typically offer limited validation for third-party MCP servers. As a result, agents remain vulnerable to MCP-based attacks that exploit the misalignment between agents and servers throughout the tool invocation lifecycle. In this paper, we propose MCPShield as a plug-in security cognition layer that mitigates this misalignment and ensures agent security when invoking MCP-based tools. Drawing inspiration from human experience-driven tool validation, MCPShield assists agent forms security cognition with metadata-guided probing before invocation. Our method constrains execution within controlled boundaries while cognizing runtime events, and subsequently updates security cognition by reasoning over historical traces after invocation, building on human post-use reflection on tool behavior. Experiments demonstrate that MCPShield exhibits strong generalization in defending against six novel MCP-based attack scenarios across six widely used agentic LLMs, while avoiding false positives on benign servers and incurring low deployment overhead. Overall, our work provides a practical and robust security safeguard for MCP-based tool invocation in open agent ecosystems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。