Vaikora › Blog › Product Updates
Publishing an MCP-compatible policy gate as open source: what vaikora-guard-mcp checks before any tool call runs
Most agent frameworks let tool calls execute and then ask questions afterward. The problem with that order is obvious once an agent deletes a record, posts to an external endpoint, or reads a file it had no business touching. The action is already done.
vaikora-guard-mcp flips that. It sits inline between an agent and the tools it calls, checks each call against policy before execution, and returns allow, block, modify, or require-approval. The tool either runs or it does not. There is no after-the-fact review for the actions it blocks.
The code is MIT-licensed, written in Python, and published on PyPI as `vaikora-guard-mcp`. You can read it, fork it, run it on your own infrastructure, and modify it without restriction.
What the proxy actually does
When an agent sends a tool call, the request hits vaikora-guard-mcp first. The proxy extracts the tool name and parameters, runs them through the configured policy, and either forwards the call or stops it.
The gateway ships six content inspection modules. These cover things like prompt injection patterns in parameters, data leaving a permitted scope, and calls to tools that policy marks as off-limits for a given agent identity or session context.
Every decision is written to a SHA-256 hash-chained, tamper-evident audit log. That log is ordered and signed, so you can prove after the fact what the agent attempted and what the policy answered.
Enforcement speed at this gate is P50 8ms and P99 45ms. At that latency the check is not a bottleneck in any realistic agent workflow.
A concrete scenario
Say you have an agent connected to three MCP tools: a SQL query tool, an S3 file writer, and an external webhook. Policy says the agent can query the database and read files, but it cannot write to S3 and cannot call the webhook without a human approval step.
Without a policy gate, the agent calls whatever its reasoning says to call. With vaikora-guard-mcp in the path:
- The SQL query tool call goes through immediately.
- An S3 write call is blocked outright and logged.
- A webhook call is held and surfaced for a human to approve before it runs.
The agent sees a blocked or pending response rather than a success. The behavior is deterministic: identical input always produces the same decision, so the policy is auditable and testable.
How to run it
Install from PyPI:
```
pip install vaikora-guard-mcp
```
Point your agent's MCP configuration at the proxy instead of directly at the tools. The proxy handles the routing. You define policy in configuration, mapping tool names and parameter patterns to decisions.
The self-hosted version is the open-source gateway. The Vaikora Control Plane, which Data443 hosts, adds centralized policy management, team-level controls, and the integrations with Microsoft Sentinel, CrowdStrike Falcon, SentinelOne, and AWS Security Hub. The gateway runs fine standalone if you just need the inline check.
What to check before you deploy
A few things worth verifying in your environment before you put the proxy in front of production tool calls:
- Policy coverage. Write at least one explicit rule per tool. A missing rule defaults to whatever the gateway's fallback is; know what that fallback is before you rely on it.
- Approval routing. If you use the require-approval decision, decide where that approval surfaces and who receives it. The gate will hold the call, but something has to pick it up.
- Log retention. The hash-chained audit log is only as useful as the retention you configure. Set a retention policy that matches what your incident response process needs.
- Throughput. The gateway supports 10,000-plus actions per second, so single-agent workloads will not strain it, but confirm your infrastructure can handle the proxy as an additional network hop.
The repository and the PyPI package are the starting point. Read the policy configuration documentation before writing your first rule set, particularly around parameter-level matching, which is where most misconfigurations show up.
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
Vaikora