Home | Blog | How to Add a Policy Gate to Every MCP Tool Call Using vaikora-guard-mcp

How to Add a Policy Gate to Every MCP Tool Call Using vaikora-guard-mcp

Wrapping an MCP server around your AI agent is not the same as controlling it. The question worth asking before you deploy an agent into production is: what happens if the tool call is wrong? Not wrong in a way that throws an exception, but wrong in a policy sense. The agent calls a tool it should not, passes data that should never leave a certain boundary, or takes an action that requires human sign-off. Without a gate sitting inline, that action runs.

vaikora-guard-mcp is an open-source, MIT-licensed MCP-compatible proxy that answers that question. It sits between an agent and the tools the agent can call, checks every tool invocation against a policy, and either allows, blocks, modifies, or routes the call to a human for approval before execution.

What the Proxy Actually Does

When an MCP tool call arrives, vaikora-guard-mcp runs it through a set of content inspection modules before the underlying tool ever fires. The policy decision is deterministic: identical input always produces identical output. There is no probabilistic scoring that lets a borderline call through one time and blocks it the next.

The proxy is written in Python and published on PyPI as `vaikora-guard-mcp`, so installation is a single pip command. It works as a drop-in layer over your existing MCP server, which means you do not need to rewrite tool definitions or change agent code.

The four enforcement outcomes are concrete:

  • Allow: the call proceeds unchanged.
  • Block: the call is stopped and the agent receives an error it can handle.
  • Modify: specific fields (a file path, a query string, a payload) are rewritten before the call reaches the tool.
  • Require approval: the call is held in queue until a human accepts or rejects it.

Every decision, regardless of outcome, is written to a SHA-256 hash-chained audit log. The chain is tamper-evident, so you have an ordered record you can produce to auditors or use in an incident investigation.

A Concrete Scenario

Suppose an agent is tasked with reading customer records from a database and summarizing them. The agent constructs a query that happens to include a column containing payment card numbers. Without a policy gate, that data flows into the LLM context. With vaikora-guard-mcp running inline, the content inspection module that checks for PCI-scoped data intercepts the call before execution, either blocks it or strips the sensitive column, and logs the decision with a timestamp and the hash of the policy rule that fired.

The agent sees a modified response or an error. The card data never enters the LLM context. The audit log shows exactly what was attempted, what rule applied, and what happened.

That is not monitoring after the fact. The data never moved.

Compliance Presets and Integration

The open-source proxy includes configuration presets for SOC 2, HIPAA, GDPR, PCI-DSS, and ISO 27001. These are starting points, not complete compliance programs, but they give you a sensible baseline without writing policy from scratch.

For teams that want centralized policy management across multiple agents, the enterprise control plane (hosted by Data443) connects to the same proxy. Policy changes push to all running instances from one place, and the audit chain is aggregated centrally. The control plane also ships prebuilt integrations with Microsoft Sentinel, CrowdStrike Falcon, SentinelOne, and AWS Security Hub, so agent-level enforcement signals flow into the same tooling your SOC already uses.

The proxy also connects to 12 LLM providers with no SDK migration required, so the enforcement layer is not tied to a specific model API.

Getting Started

The practical starting point is the PyPI package. Run `pip install vaikora-guard-mcp`, point it at your existing MCP server, define your first policy (the preset files give you a template), and run a tool call through it in a test environment. Check the audit log entry for that call. That single entry tells you whether the enforcement path is working before you go anywhere near production.

If you want to inspect the internals before installing anything, the source is on GitHub under the MIT licence. The six content inspection modules are readable Python, and the policy schema is documented in the repo.

After that first working gate, the useful next step is mapping which tools your agent can call and deciding which enforcement outcome applies to each one. That list usually turns up tool permissions that should never have been granted in the first place.