受控MCP:通过基于logit的安全原语实现AI代理的内核级工具治理
Governed MCP: Kernel-Level Tool Governance for AI Agents via Logit-Based Safety Primitives
AI总结:
本文提出 Governed MCP,一种基于logit的安全原语的内核级工具治理网关,通过六层管道对MCP工具调用进行安全检查,提升AI代理的安全性。
摘要:
AI代理越来越多地通过模型上下文协议(MCP)调用外部工具(文件系统、网络、API)。这些工具调用是代理的系统调用--具有共享状态的特权操作--但目前的安全检查完全位于用户空间,一个10行脚本即可绕过。我提出 Governed MCP,一种基于logit的安全原语(ProbeLogits,配套论文:arXiv:2604.11943)的内核级工具治理网关。该网关在MCP工具调用的六层管道中进行干预:模式验证、信任层级检查、速率限制、对抗性预过滤、ProbeLogits门(承载语义检查)、宪法政策匹配,配有Blake3哈希审计链。我将 Governed MCP 实现于Anima OS,一个大约86,000行Rust编写的裸金属x86_64操作系统。五个非推理层每个调用增加65.3微秒的开销;ProbeLogits每个token类语义决策增加65毫秒。在101提示的MCP领域基准测试中,移除ProbeLogits层导致F1从0.773降至0.327(F1变化量为-0.446)--仅靠人工规则防火墙是不够的。所有15个WASM到系统主机函数在运行时都通过该网关(完全调解WASM ABI表面;该声明的范围和注意事项在第4.6节中说明);一个10行用户空间绕过方案在内核级网关面前结构上是不可能的。
英文摘要:
AI agents increasingly call external tools (file system, network, APIs) through the Model Context Protocol (MCP). These tool calls are the agent's syscalls: privileged operations with side effects on shared state, yet today's safety enforcement lives entirely in userspace, where a 10-line script can bypass it. I propose Governed MCP, a kernel-resident tool governance gateway built on a logit-based safety primitive (ProbeLogits). The gateway interposes on every MCP tool call in a 6-layer pipeline: schema validation, trust tier, rate limit, adversarial pre-filter, a ProbeLogits semantic gate (the load-bearing check), and constitutional policy match, with a Blake3-hashed audit chain. I implement Governed MCP in Anima OS, a bare-metal x86-64 kernel in ~286,000 lines of Rust. The five non-inference layers plus the audit append cost a measured 11.3 us per call; the ProbeLogits gate (one probe-prompt prefill plus a single logit read) costs 332-556 ms per classification across Qwen2.5-7B, Llama-3-8B, and Mistral-7B, 2.4-3.4x faster than a Llama Guard 3 pass on the same hardware. A silicon-measured ablation shows that removing the ProbeLogits layer collapses F1 from 0.789 to 0.357 (delta-F1 = -0.432): hand-rule firewalling alone is insufficient. Every WASM-to-system host function and every registered MCP tool is mediated by the kernel gateway, so the 10-line userspace bypass that defeats existing guardrail libraries is structurally impossible; a disclosed set of ring-3 syscall paths remains ungated pending future work. Multi-model validation across three architectures (HarmBench 98-99% non-copyright block, XSTest 98.5-100% unsafe recall, ToxicChat parity with Llama Guard 3) shows the underlying primitive is architecture-agnostic. Governed MCP demonstrates that tool-call governance is feasible as an OS primitive, not just an application-layer concern.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。