arXiv:2508.10991cs.CRcs.AI2025-08ACL被引 21

针对智能体AI中模型上下文协议的漏洞,提出三层防御框架,有效识别恶意指令。

MCP-Guard: A Multi-Stage Defense-in-Depth Framework for Securing Model Context Protocol in Agentic AI

  • 分三阶段检测:静态扫描、神经网络分析、E5模型精准识别
  • 使用自研基准测试集,96.01%准确率识别对抗性提示
  • 适合关注AI安全、工具化大模型防护的研究者与开发者

尽管大语言模型(LLM)表现优异,仍易受越狱攻击。将大语言模型与外部工具通过模型上下文协议(MCP)结合,引入了提示注入、数据外泄等关键安全风险。为此,我们提出MCP-GUARD,一种用于LLM-工具交互的鲁棒、分层防御架构。该框架采用三阶段检测流程,在效率与准确性间取得平衡:首先进行轻量级静态扫描以发现明显威胁,其次使用深度神经检测器识别语义攻击,最后由微调的E5模型实现96.01%的对抗提示识别准确率。最终,一个LLM仲裁器整合所有信号并做出最终判断。为支持严格训练与评估,我们构建了MCP-ATTACKBENCH,包含70,448个样本,由GPT-4增强生成,模拟多种真实世界攻击向量,可绕过传统防御机制,为未来保障LLM-工具生态安全研究奠定基础。

原文摘要 · Abstract (English)

While Large Language Models (LLMs) have achieved remarkable performance, they remain vulnerable to jailbreak. The integration of Large Language Models (LLMs) with external tools via protocols such as the Model Context Protocol (MCP) introduces critical security vulnerabilities, including prompt injection, data exfiltration, and other threats. To counter these challenges, we propose MCP-GUARD, a robust, layered defense architecture designed for LLM-tool interactions. MCP-GUARD employs a three-stage detection pipeline that balances efficiency with accuracy: it progresses from lightweight static scanning for overt threats and a deep neural detector for semantic attacks, to our fine-tuned E5-based model which achieves 96.01\% accuracy in identifying adversarial prompts. Finally, an LLM arbitrator synthesizes these signals to deliver the final decision. To enable rigorous training and evaluation, we introduce MCP-ATTACKBENCH, a comprehensive benchmark comprising 70,448 samples augmented by GPT-4. This benchmark simulates diverse real-world attack vectors that circumvent conventional defenses in the MCP paradigm, thereby laying a solid foundation for future research on securing LLM-tool ecosystems.

AI安全模型防护大模型

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