Governed MCP: Kernel-Level Tool Governance for AI Agents via Logit-Based Safety Primitives

Daeyeon Son · 2026

Read Governed MCP: Kernel-Level Tool Governance for AI Agents via Logit-Based Safety Primitives by Daeyeon Son (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-16870.txt.

Introduction

Son proposes Governed MCP, a kernel-resident gateway governing agent tool calls through a logit-based safety primitive. Tool calls are privileged operations with side effects, yet current safety enforcement lives in userspace. The gateway interposes a six-layer pipeline: validation, trust tier, rate limit, pre-filter, a semantic gate, and policy match. Five layers plus audit cost eleven point three microseconds per call, while the semantic gate costs 332 to 556 milliseconds. Removing the semantic gate collapses F1 from zero point seven eight nine to zero point three five seven.

Catalog record

CREATORDaeyeon Son
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE53524
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2604.16870

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Governed MCP: Kernel-Level Tool Governance for AI Agents via Logit-Based Safety Primitives Daeyeon Son Abstract AI agents increasingly call external tools (file system, network, APIs) through the Model Context Protocol (MCP) [ 1 ] . 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, companion paper). The gateway interposes on every MCP tool call in a 6-layer pipeline: schema validation, trust tier check, rate limit, adversarial pre-filter, ProbeLogits gate (the load-bearing semantic check), and constitutional policy match, with a Blake3-hashed audit chain. I implement Governed MCP in Anima OS , a bare-metal x86_64 OS in ∼ \sim 86,000 lines of Rust. The five non-inference layers add 65.3 μ \mu s of overhead per call; ProbeLogits adds 65 ms (per-token-class semantic decision) on 7B Q4_0. A 4-config ablation on a 101-prompt MCP-domain benchmark shows that removing the ProbeLogits layer collapses F1 from 0.773 to 0.327 ( Δ \Delta F1 = − - 0.446)—hand-rule firewalling alone is insufficient. All 15 WASM-to-system host functions in the runtime route through the gateway (complete mediation of the WASM ABI surface; the scope and caveats of this claim are stated in § 4.6 ); a 10-LoC userspace bypass that defeats existing guardrail libraries is structurally impossible against the kernel-resident gate. To my knowledge, no prior system places semantic safety enforcement below the agent’s privilege boundary in an operating system. Governed MCP demonstrates that tool-call governance is feasible as an OS primitive, not just an application-layer concern. 1 Introduction AI agents are increasingly autonomous, executing multi-step plans via tool calls (file reads, web fetches, code execution, shell commands). The Model Context Protocol (MCP), introduced by Anthropic [ 1 ] , has become the de facto standard for tool calling: a JSON-RPC interface where the agent proposes a tool name and arguments, and a server executes them. Tool calls are syscalls. Like syscalls, they cross the privilege boundary between agent (less trusted) and host (more trusted), and they carry the same risks: argument exfiltration, side effects on shared state, escalation. Unlike syscalls, they have no kernel mediation. Existing safety infrastructure—NeMo Guardrails [ 7 ] , AGT schemas [ 8 ] , AutoGPT-style [ 9 ] wrappers—all operate as Python libraries imported by the agent process, in the same address space and with the same privilege as the agent itself. The agent decides whether to call them. The structural problem is not that these libraries are weak, but that they are libraries: they cannot be the privilege boundary between the agent and the host. Listing 1 shows three increasingly subtle ways an agent (or compromised tool that exfiltrated credentials) can bypass them, none of which require a vulnerability in the safety library: Listing 1: Three bypass paths for in-process safety libraries. None exploit a library bug; all rely on the agent process having the same privilege as the safety library. ⬇ 1 # (1) Skip the import. The library only runs if the 2 # agent code chooses to call it. 3 from openai import OpenAI ; from os import system 4 # no ‘from nemo_guardrails import LLMRails‘ 5 client = OpenAI () 6 plan = client . chat . completions . create (...) 7 system ( plan . choices [0]. message . content ) # unguarded 8 9 # (2) Replace the function. Same address space => same write 10 # permission to the library’s symbols. 11 import nemoguardrails 12 nemoguardrails . LLMRails . generate = lambda self , p : p 13 # now every "guarded" call returns the prompt unfiltered 14 15 # (3) Inject the safety verdict. Many libraries return a 16 # dict; mutate it before the caller checks it. 17 result = guardrails . check ( prompt ) 18 result [ "allowed" ] = True 19 # downstream gate sees allowed=True These bypasses succeed because Python imports, attribute writes, and dict mutations all run with the agent’s own privilege. No amount of library-level hardening (input validation, signed checks, etc.) closes the gap, because the gap is at the privilege boundary : there is no boundary. Any defense the library implements, the agent’s process can also undo. The same critique applies to JavaScript wrappers, Go middleware, and any other in-process safety layer. Kernel-grade governance requires that the safety check live in a privilege domain the agent cannot enter. This paper proposes Governed MCP , a kernel-resident governance gateway that interposes on every MCP tool call. The gateway runs in the OS kernel of Anima OS—a bare-metal x86_64 operating system written in Rust whose inference engine and safety primitives are described in a companion paper [ 6 ] . Agents execute as WASM [ 2 ] bytecode in a sandbox above the gateway; the only path from the sandbox to a tool call is through host functions that the kernel exposes, every one of which routes through the gateway. Because the agent’s WASM context cannot address the gateway’s memory and cannot invoke kernel code except through the WASM ABI, the agent cannot skip the check by design : there is no userspace shim to monkey-patch because the check is not in userspace. The gateway is structured as a six-layer pipeline. The first four layers are syntactic and policy checks: JSON-RPC schema validation, trust-tier whitelist (which tools may be invoked by which trust class of agent), token-bucket rate limit, and an O( n ) regex pre-filter for prompt-injection patterns. The fifth layer is the load-bearing semantic check: a single forward pass through the loaded inference model that reads “Safe” vs. “Dangerous” logits at the verbalizer position (the ProbeLogits primitive). The sixth applies a 12-principle constitutional policy match. Each tool call appends a Blake3-hashed audit record. End-to-end overhead on a 7B Q4_0 model is 65 ms per call (dominated by the inference layer); the five non-inference layers add only 65.3 \mu s in total. Why this matters now. The Model Context Protocol entered widespread deployment in 2024–2025, and major frameworks (Anthropic’s Claude clients, OpenAI’s Tool API, Microsoft’s Copilot tools) now ship MCP support by default. This means tool-call governance is no longer a research concern but a deployment one—and the governance layer that ships in current production stacks is exactly the in-process Python-library design that Listing 1 defeats. The window to define what a proper kernel-grade MCP gateway should look like is open now , before deployment patterns harden around the current weak architecture. Contributions. 1. A 6-layer kernel-resident MCP governance pipeline (schema, trust, rate, adversarial pre-filter, ProbeLogits, constitutional) with 65.3 \mu s non-inference overhead and FAIL-CLOSED semantics: if the inference engine is unavailable, all tool calls are denied. To my knowledge, this is the first kernel-resident MCP gateway with semantic intent classification. 2. Demonstration that the ProbeLogits semantic layer is load-bearing : a 4-configuration ablation on a 101-prompt MCP-domain benchmark shows \Delta F1 = - 0.446 when the ProbeLogits gate is removed (full pipeline F1 = 0.773, no-ProbeLogits F1 = 0.327). Hand-rule firewalling without semantic understanding is insufficient. 3. Complete mediation of the WASM ABI surface (structural argument + empirical

Read the complete text