Vaikora › Blog › Product Updates
Building policy into an MCP proxy: a technical walkthrough of vaikora-guard-mcp
Most MCP servers pass tool calls straight through to the underlying function. The call arrives, the server routes it, the tool runs. Policy lives somewhere else, applied after the fact if it is applied at all. vaikora-guard-mcp puts a policy gate at exactly that point, before the function executes, and it is now available on PyPI under the MIT license.
This post explains how it works mechanically, what you configure, and when it is worth adding to an agent deployment.
What the proxy actually does
vaikora-guard-mcp sits inline between your AI agent and the tools it calls. Every tool call passes through a policy evaluation step before execution. The evaluation produces one of four decisions: allow, block, modify, or require-approval. If the decision is block, the tool never runs. If it is require-approval, execution waits for a human signal before proceeding.
The enforcement is deterministic. Identical input always produces an identical decision. That matters for auditability: you can reason about what happened and why without reconstructing intent after the fact.
Every decision is written to a SHA-256 hash-chained audit log. Each entry is signed into the chain, so the record is tamper-evident and ordered. If a decision is disputed, the log shows exactly what input was evaluated, what policy matched, and what the outcome was.
Enforcement latency is P50 8ms, P99 45ms. At scale the gateway handles 10,000 or more actions per second.
Installing and connecting it
The package is published on PyPI as `vaikora-guard-mcp`. Install it with pip:
```
pip install vaikora-guard-mcp
```
It is written in Python and self-hosted. You run it in your own environment, which means the tool call payload never leaves your infrastructure during the policy check. The Vaikora Control Plane, the commercial product hosted by Data443, is a separate layer for teams that want centralized policy management, SIEM integration, and cross-agent visibility. The open-source proxy works standalone.
Because it is MCP-compatible, it plugs into existing agent frameworks without an SDK migration. It supports 12 LLM providers in that configuration.
Configuring policy rules
Policy is defined as rules that match against tool call attributes: tool name, parameter values, calling agent identity, session context, or any combination. A rule specifies a condition and an action.
A concrete example: an agent has access to a file-write tool and a database-query tool. You want to allow read operations freely, block any write to paths outside a defined workspace, and require approval for any query that includes a `DROP` or `DELETE` keyword.
You write three rules. The first matches all read calls and allows them. The second matches write calls where the path parameter falls outside your allowed prefix and blocks them. The third matches query calls where the statement contains a destructive keyword and routes them to the approval queue.
When the agent calls the database-query tool with `DELETE FROM audit_log WHERE ...`, the proxy evaluates the statement against rule three, holds the call, and surfaces it for a human decision. The database never receives the query until approval arrives, or the call is rejected.
Compliance presets
For teams that need to meet a specific regulatory requirement quickly, vaikora-guard-mcp ships presets for HIPAA, PCI-DSS, GDPR, SOC 2, and ISO 27001. Each preset is a baseline rule set covering the tool call behaviors most likely to create a compliance gap in that context. You can extend or override any preset rule.
Using a preset does not replace your legal review, but it gives you a defensible starting configuration faster than writing rules from scratch.
When to add this to an agent deployment
The proxy is worth adding any time an agent has access to tools with side effects: writes, deletes, external API calls, queries against sensitive data stores, or anything that sends data outside your environment.
Read-only agents with access to non-sensitive sources are lower priority. But the moment an agent can take an action that is difficult to reverse, enforcement before execution is cheaper than investigation and remediation after.
The require-approval path is useful during early deployment. You can run the proxy in a mode where high-risk tool classes always require approval, review the queue for a few days, and use that data to refine which calls you are comfortable allowing automatically and which genuinely need a human in the loop.
What to check next
Review which tools your agents can currently call and whether any of them have irreversible side effects. Install `vaikora-guard-mcp` from PyPI, wire it in front of one agent, and configure a block rule for a call type you would never want to run automatically. Verify the audit log captures the decision. That sequence takes less than an hour and tells you concretely what policy enforcement at the tool-call layer looks like in your environment.
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