Home | Blog | Building Policy Enforcement Into an MCP Server: What vaikora-guard-mcp Does and How to Run It

Building Policy Enforcement Into an MCP Server: What vaikora-guard-mcp Does and How to Run It

Tool calls in agentic AI systems run with whatever permissions the hosting process holds. Without a gate between the agent and the tool, there is no practical way to enforce policy, produce an audit record, or block a bad action before it causes harm. That is the specific problem vaikora-guard-mcp is built to solve.

What the project actually is

vaikora-guard-mcp is an open-source, MIT-licensed Python package published on PyPI. It runs as a self-hosted Model Context Protocol proxy and sits inline between an AI agent and the LLM or external tools it calls. Before any tool call executes, the proxy checks the action against a configured policy and returns one of four decisions: allow, block, modify, or require-approval.

The word "before" matters here. This is not a logging wrapper that records what happened. The enforcement decision runs prior to execution, so a blocked call never reaches the target tool.

You can install it directly:

“`
pip install vaikora-guard-mcp
“`

The source is on GitHub. The MIT license means you can modify it, embed it in internal tooling, or redistribute it without restriction.

How policy enforcement works at runtime

The gateway ships six content inspection modules. When an agent issues a tool call, the proxy intercepts the request and runs it through whichever inspection modules are active for that policy configuration. The inspection result maps to a decision. Identical input always produces an identical decision. That deterministic behavior is what makes the system auditable: you can replay any request against the same policy and get the same outcome.

Enforcement latency runs at P50 8ms and P99 45ms. At that latency, the gate is invisible to the user in any interactive workflow and adds negligible overhead to automated pipelines running thousands of calls.

A concrete example: an agent is configured to query a database and write results to a file. A policy rule blocks any tool call that includes a `DROP` or `TRUNCATE` statement in the query parameter. The agent constructs a call with `TRUNCATE users;` embedded in the query. The proxy intercepts the call, the content inspection module matches the pattern, and the decision is `block`. The tool never receives the request. The agent receives a structured rejection it can handle in code.

The audit log

Every decision the proxy makes gets written to a SHA-256 hash-chained, tamper-evident audit log. Each entry is signed into the chain so that any deletion or modification of a prior record breaks the chain and is detectable.

This is what compliance reviewers actually need. A log that shows "no violations were recorded" is easy to produce after the fact. A hash-chained log where any tampering is structurally visible is a different kind of evidence. Vaikora compliance presets ship for SOC 2, HIPAA, GDPR, PCI DSS, and ISO 27001, so the relevant policy rules for each regime are already defined rather than requiring teams to build them from scratch.

What the open-source package includes versus the control plane

The open-source gateway handles enforcement and audit locally. It works as a standalone proxy without any external dependency.

The Vaikora Control Plane, hosted by Data443, adds centralized policy management, cross-agent visibility, alert routing to SIEM and EDR platforms (Microsoft Sentinel, SentinelOne, CrowdStrike Falcon, AWS Security Hub), and the approval workflow for actions flagged as require-approval. The gateway and control plane are independent. Teams that want to start with local enforcement only can do that, then connect to the control plane when centralized governance becomes a requirement.

Vaikora is also available on AWS Marketplace as a SaaS subscription, which matters for teams that need EDP draw-down or private offer purchasing.

Where to add this in an existing stack

The proxy is MCP-compatible and supports 12 LLM providers with no SDK migration. If your agents already use MCP to communicate with tools, adding the proxy is a routing change, not a code rewrite.

The proxy adds a runtime gate on top of existing access controls (Azure RBAC, AWS IAM, Snowflake roles) rather than replacing them. The IAM policy still applies. The MCP proxy applies its own check first, before the request reaches the layer where IAM would be evaluated.

For teams running agents that call external APIs, write to databases, execute shell commands, or manage cloud resources, any one of those surfaces represents a path to unintended action. Adding a policy gate that runs in single-digit milliseconds and produces a signed audit record for every decision is a concrete, testable control, not a configuration suggestion.

What to check next

Pull the package, configure a basic policy, and run a tool call that should be blocked. Verify the audit log entry and confirm the tool never received the request. That single test tells you more about how the enforcement actually works than any documentation will.

If you want to evaluate centralized policy management or SIEM integration, the Vaikora Control Plane documentation covers the connection from the open-source gateway to the enterprise features.