Vaikora › Blog › Product Updates
vaikora-guard-mcp on PyPI: a worked example of inline policy enforcement for MCP tool calls
Ten lines of Python and a policy file are enough to put a deterministic gate in front of every tool call your MCP agent makes. That is what `vaikora-guard-mcp` does, and because it is MIT-licensed and published on PyPI, you can read exactly how it works before you deploy it.
This post walks through the mechanics: what happens at runtime, what a policy decision looks like, and what the audit record contains.
What the proxy intercepts
`vaikora-guard-mcp` sits inline between an MCP client and the LLM or tools it calls. Every tool call passes through the proxy before it reaches its target. The proxy inspects the call, evaluates it against your policy, and returns one of four decisions: allow, block, modify, or require-approval. The underlying tool never sees a blocked call. There is no hook into application logs after the fact.
The package is written in Python and installs with `pip install vaikora-guard-mcp`. Setup is a nine-line configuration that points the proxy at your policy file and your upstream endpoint.
What a policy evaluation looks like
Suppose an agent is running a customer-service workflow. It calls a tool named `fetch_customer_record` with a parameter that includes a raw Social Security Number. Without a gate, that string travels to the LLM context and potentially into a response.
With `vaikora-guard-mcp` enforcing a PCI-DSS preset, the proxy inspects the payload before the call executes. The content inspection module matches the SSN pattern. The policy decision is block. The call stops. The agent receives a structured error it can handle. The LLM never receives the data.
The same logic applies to prompt injection patterns, tool-call sequences that breach a defined scope, or any custom rule you write in the policy file. The proxy applies the same decision to identical input every time, which is what "deterministic" means in practice.
The audit record
Every decision the proxy makes is written to a SHA-256 hash-chained, tamper-evident audit log. The chain means any modification to a past record breaks the hash sequence, which makes the log useful as evidence in a compliance review or incident investigation.
Each entry contains the tool name, the parameters passed (redacted per policy if they include sensitive content), the decision, the rule that triggered it, and a timestamp. If a regulator or internal audit team asks what an agent did with customer data at a specific time, the log answers that question without requiring you to reconstruct events from application traces.
Why open source matters for a security component
A policy gate that you cannot read is a control you are trusting on faith. Publishing the proxy under MIT license means your security team can audit the inspection logic, the policy evaluation path, and the audit-write mechanism before you run it in a regulated environment. It also means you can self-host it with no data leaving your infrastructure.
The Vaikora gateway ships six content inspection modules and supports twelve LLM providers with no SDK migration. `vaikora-guard-mcp` is the open-source layer of that stack, the part that handles the MCP wire protocol and routes calls through policy. The commercial Vaikora Control Plane adds the enterprise control plane, HIPAA, PCI-DSS, GDPR, SOC 2, and ISO 27001 compliance presets, and integrations with Microsoft Sentinel, CrowdStrike Falcon, SentinelOne, and AWS Security Hub.
The proxy enforces at P50 8ms and P99 45ms, with throughput above 10,000 actions per second. Those numbers come from the enforcement layer, not from a background scanner reviewing logs.
What to check next
If you are evaluating `vaikora-guard-mcp` for a production deployment, start with these three things:
- Read the inspection module source before you configure it. Understand which patterns each module checks and in what order.
- Write a policy rule for the most sensitive tool your agent can call, run it against test payloads, and confirm the audit log entry matches what you expect.
- If you are in a regulated environment, map your compliance preset to the specific controls your auditors reference. The preset gives you a starting point; your policy file is where you make it specific.
The package is on PyPI at `vaikora-guard-mcp`. The source is MIT-licensed and available for review before you decide whether it fits 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