VaikoraVaikora

Vaikora › Blog › Product Updates

How to put a policy gate in front of every MCP tool call without writing custom enforcement code

Product Updates · Nov 21, 2026 · 4 min read

Every MCP tool call your AI agent makes runs with whatever permissions the agent was given at startup. Without a gate between the agent and the tool, there is no point in the execution path where policy can say "stop, this action is not allowed." By the time you detect a problem, the action has already run.

That is the problem vaikora-guard-mcp is built to solve.

What the proxy does, mechanically

vaikora-guard-mcp sits inline between an AI agent and any MCP-compatible tool server. When the agent issues a tool call, the request hits the proxy first. The proxy evaluates the call against a policy definition and returns one of four decisions: allow, block, modify, or require-approval. Only after an allow decision does the call proceed to the tool.

The enforcement happens before execution. If the policy blocks a call, the tool never receives the request. No side effects, no rollback needed.

Every decision, including allowed calls, is written to a SHA-256 hash-chained, tamper-evident audit log. That means you get an ordered, verifiable record of what your agents tried to do and what policy decided, not just what failed.

What "open source" means here, practically

The package is MIT-licensed, written in Python, and published on PyPI as `vaikora-guard-mcp`. You can install it, read the source, modify it, and self-host it without a commercial agreement. The license places no restrictions on use.

```
pip install vaikora-guard-mcp
```

That installs the proxy and its six content inspection modules. You point your agent at the proxy instead of directly at the tool server and define your policy in a configuration file. No SDK migration is required.

The commercial product is the Vaikora Control Plane, hosted by Data443, which adds centralized policy management, the SIEM integrations, and compliance presets for HIPAA, PCI-DSS, GDPR, SOC 2, and ISO 27001. The open-source proxy is a fully functional enforcement layer on its own.

A concrete example: blocking file writes outside an allowed path

Suppose you have an agent with access to a filesystem tool. The agent is supposed to read configuration files, but nothing in the tool's own API prevents it from writing to arbitrary paths. You define a policy rule:

```
- tool: filesystem
action: write
condition: path_outside("/app/config")
decision: block
```

When the agent issues a `filesystem.write` call to `/etc/cron.d/agent-task`, the proxy evaluates the path against the condition, matches the rule, and returns a block decision with a reason string. The tool server never sees the request. The decision is logged with the full call payload, the matched rule, the timestamp, and the hash linking it to the previous log entry.

That audit entry is what a security team or compliance reviewer needs: not just "a block happened" but which rule matched, what the agent sent, and when.

Enforcement latency at this layer

Adding an inline enforcement proxy raises an obvious question about latency. The proxy enforces at P50 8ms and P99 45ms, which is below the threshold that most orchestration frameworks treat as meaningful overhead. At scale, the proxy handles 10,000 or more actions per second.

Who this is for

If you are building or operating an MCP-based agent and you have no enforcement point between the agent and its tools, the proxy gives you one without requiring you to instrument every tool individually. The policy lives in one place, applies to all tool calls, and produces an audit trail.

If you are on a security or compliance team and developers in your organization are deploying agents, requiring them to route tool calls through a proxy with centralized policy is a practical control. You write the policy, they run the agents, and enforcement happens regardless of what the agent code does.

What to check next

Install the package from PyPI and review the default policy schema. Look at which of your existing AI agent workflows make tool calls today without any gate. For each tool type, identify the calls that would cause irreversible effects if they ran without authorization (writes, deletes, external API posts, credential reads) and define block or require-approval rules for those first. That gives you an immediate, auditable enforcement baseline before you expand coverage.

The source is on PyPI under `vaikora-guard-mcp`. Read the inspection module code before you decide how much of the policy logic you want to extend or customize.

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