Vaikora › Blog › Product Updates
How vaikora-guard-mcp intercepts a tool call and returns allow, block or modify before execution
An AI agent writing to a database or calling an external API does not pause to ask permission. The call either goes through or it does not, depending on what sits between the agent and the tool. vaikora-guard-mcp is a small, open-source MCP proxy, MIT-licensed and published on PyPI, that makes that decision deterministically before execution.
This post explains what the proxy actually does at the code level, so you can read the source and decide whether it fits your environment.
What the proxy is
vaikora-guard-mcp sits inline between an MCP client (your AI agent) and the MCP server (the tool). Every tool call passes through it. The proxy evaluates the call against a policy, returns one of four verdicts (allow, block, modify, require-approval), and only forwards the call if the verdict is allow or modify. Block stops execution immediately. Require-approval holds the call until a human responds.
The policy check is deterministic: identical input always produces identical output. There is no probabilistic scoring that shifts between requests.
Latency at P50 is 8ms and at P99 is 45ms. For most agent workflows that is below the noise threshold of a tool call itself.
Installing and wiring it in
```
pip install vaikora-guard-mcp
```
Configuration is a YAML policy file. A minimal rule looks like this:
```yaml
rules:
- name: block-delete-on-production
match:
tool: database_execute
input_contains: "DROP"
action: block
reason: "DDL on production blocked by policy"
```
You point your MCP client at the guard proxy instead of the upstream server. The proxy handles the MCP protocol layer, so there is no SDK migration and no changes to the agent code.
What happens on a blocked call
When the proxy matches the rule above, it returns a structured error to the agent before the tool executes. The agent receives a machine-readable reason. The call never reaches the upstream MCP server.
Every decision, allow or block, gets written to a SHA-256 hash-chained audit log. Each entry includes the tool name, the input, the matched rule, the verdict, and a timestamp. Entries are chained, so any post-hoc modification of the log breaks the chain and is detectable. That audit chain is what makes the proxy useful for compliance review, not just runtime protection.
The enforcement throughput cap in testing is 10,000+ actions per second, so the proxy does not become a bottleneck in high-volume agent pipelines.
Connecting to the control plane
The open-source proxy enforces local policy files. For teams that need centralized policy management, real-time updates across multiple agents, and SIEM integration, Vaikora's commercial control plane connects to the same proxy without replacing it.
That means you can run the open-source proxy now, inspect every decision in the local audit log, and promote to centralized governance later if the volume or compliance requirements justify it.
The compliance presets in the control plane (HIPAA, PCI-DSS, GDPR, SOC 2, ISO 27001) ship as named policy bundles. Selecting one activates the relevant rules without writing them by hand.
A scenario worth testing
Take an agent configured to manage cloud storage. Without a policy gate, a prompt injection in a document could instruct the agent to call a file-delete tool across a directory. With the proxy in place, you write one rule matching the delete tool against paths outside an approved prefix, and the action blocks before execution. The agent receives the rejection. The files are untouched. The audit log records the attempted call.
That is the pattern to verify before you go to production: write a rule, trigger the matching call in a test environment, confirm the block verdict appears in the audit log, and check that the upstream tool received nothing.
What to check next
The source is on PyPI as `vaikora-guard-mcp`. Read the rule evaluation logic in the source before writing production policy. Pay particular attention to how `input_contains` matching works on structured JSON inputs, since tool call arguments are often nested objects, not flat strings, and your match patterns need to account for that.
If you are running agents against sensitive data stores, the first rules worth writing are blocks on destructive operations (DELETE, DROP, TRUNCATE) and rules that require approval before any write to a schema or bucket outside a named allowlist.
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