VaikoraVaikora

Vaikora › Blog › Product Updates

Building a policy gate for MCP tool calls: what the vaikora-guard-mcp source code actually does

Product Updates · Nov 22, 2026 · 4 min read

When an MCP-connected agent decides to call a tool, that decision is already made before your security team can see it. The question is whether something sits inline to evaluate that call against policy before execution begins, or whether you find out about the problem in a log afterward.

vaikora-guard-mcp is an open-source, MIT-licensed MCP proxy written in Python and published on PyPI. It places a policy check on every tool call in the execution path. If the call passes, it proceeds. If it does not, it is blocked, modified, or held for approval before anything runs.

What "inline" means here, and why it matters

Most agent observability approaches record what happened. An inline proxy intercepts the call in transit and returns an enforcement decision before the tool function executes. The difference is not subtle: a block after execution is not a block.

vaikora-guard-mcp sits between the agent's MCP client and the tool server. The agent calls the proxy endpoint. The proxy evaluates the request against policy. The tool server only receives the call if policy allows it.

That evaluation happens at P50 8ms and P99 45ms. At that latency, the enforcement is transparent to the user and negligible to the agent's execution time.

What the policy check actually inspects

The proxy runs the incoming tool call through content inspection before making a decision. The check looks at:

The decision is deterministic. Identical input produces the same output every time. There is no probabilistic scoring that behaves differently on the second run.

Writing a rule and reading what it produces

Say you have an agent that is allowed to read from a database but should never execute a DELETE. A policy rule in vaikora-guard-mcp targeting the `run_query` tool can inspect the `query` parameter and block any call where the normalized SQL contains a DELETE statement.

When that rule fires, the proxy returns a block decision to the agent and writes an entry to the audit log. The log entry contains the tool name, the parameters, the policy rule that matched, the decision, and a timestamp. Every entry is signed into a SHA-256 hash chain, so the record is tamper-evident and ordered. You can produce that chain in a compliance review and demonstrate that no entry has been altered or removed.

That matters for SOC 2, HIPAA, PCI-DSS, GDPR, and ISO 27001 workloads. Vaikora ships compliance presets for all five, so you are not writing policy from scratch for regulated environments.

Installing and running it

The package is on PyPI as `vaikora-guard-mcp`. Install it with pip, point it at your existing MCP tool server, and configure a policy file. No SDK migration is required. Vaikora supports 12 LLM providers in this configuration, so you are not locked to a specific model API to get enforcement.

The source is on GitHub under the MIT license. Reading the proxy module directly shows you the inspection pipeline, the decision logic, and the audit write path. If you want to audit what runs in your environment before trusting it, that transparency is the point.

Where the control plane fits

The open-source proxy handles enforcement at the agent level. When you need centralized policy management across many agents, enforcement reporting into a SIEM, or integration with SentinelOne, CrowdStrike Falcon, Microsoft Sentinel, or AWS Security Hub, that is what the Vaikora enterprise control plane adds. The proxy and the control plane share the same policy model, so rules you write locally transfer without rewriting.

What to check next

Pull the package from PyPI, run it against one tool server in a non-production environment, and write one rule that blocks a call you would never want an agent to make in production. Inspect the audit log entry that comes back. That single test tells you whether the enforcement model fits your agent architecture before you commit to deploying it more broadly.

The vaikora-guard-mcp source is on GitHub if you want to read the inspection pipeline before installing anything.

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