Vaikora › Blog › Product Updates
Eight milliseconds to a policy decision: how vaikora-guard-mcp intercepts tool calls before they execute
The gap between an AI agent deciding to call a tool and the tool actually executing is where policy enforcement has to live. By the time you detect a bad action in a log, the write has already happened, the secret has already been read, the external request has already gone out.
vaikora-guard-mcp closes that gap by sitting inline between the agent and every tool it calls. It is MIT-licensed, written in Python, published on PyPI, and self-hostable. The source is public so you can read exactly what happens to each request before you deploy it anywhere near production data.
What the proxy actually does
When an agent sends a tool call, vaikora-guard-mcp receives it before the tool sees it. The proxy runs the call through a policy evaluation engine and returns one of four decisions: allow, block, modify, or require-approval. Only after an allow decision does the call continue to the tool. Block and require-approval decisions stop execution at that point.
The evaluation is deterministic. Identical input always produces an identical decision, which matters for auditability: you can replay any request and confirm the policy logic would reach the same conclusion. Every decision is written to a SHA-256 hash-chained audit log, so the record is tamper-evident and ordered.
Enforcement latency at P50 is 8ms. At P99 it is 45ms. At 10,000+ actions per second, the proxy is not the bottleneck in any realistic agent workflow.
A concrete scenario
Say an agent has access to a file-read tool and a network-request tool. Policy says: file reads are allowed within a defined path prefix, and no outbound network calls to external domains are permitted during this workflow.
The agent calls `file_read("/data/reports/q2.csv")`. The proxy checks the path against the allow rule, confirms it falls within the permitted prefix, and passes the call through. Elapsed time: single-digit milliseconds.
The agent then calls `http_get("https://external-api.example.com/upload%22?utm_source=vaikora&utm_medium=social&utm_campaign=content_agent&utm_content=draft_8290)`. The proxy evaluates the destination against the network policy, finds no matching allow rule, and returns a block decision. The tool never executes. The agent receives the block response and can be instructed to handle it, halt, or escalate. The attempted call and the block decision are both recorded in the audit chain.
No custom engineering is required to produce that audit record. It happens on every decision by default.
How to run it
Install from PyPI:
```
pip install vaikora-guard-mcp
```
Point your MCP-compatible agent at the proxy endpoint instead of directly at the tool server. Define your policy in the configuration file: each rule specifies a tool name or pattern, a condition, and a decision. The proxy connects to your existing tools with no changes to the tool implementations themselves.
For teams already using the Vaikora Control Plane, the open-source proxy forwards telemetry to the control plane automatically. For teams running fully self-hosted, the proxy operates standalone with local policy files and local audit logs.
What the six content inspection modules cover
The proxy ships with six built-in inspection modules. These evaluate the content of tool call arguments, not just the tool name and destination. That means a policy can block `file_read` calls where the path argument matches a sensitive-data pattern, or flag `sql_query` calls that contain `DROP` or `DELETE` statements for require-approval rather than silent execution.
Inspection happens on the argument payload, before execution. This is different from logging what an agent did after the fact: the content check is part of the allow/block decision itself.
Why open source for a security control
Security controls that run inline between an agent and its tools need to be auditable by the people deploying them. Closed-source enforcement proxies require trust that the vendor's implementation matches what is documented. With vaikora-guard-mcp, the policy evaluation logic, the inspection modules, and the audit chain implementation are all readable. You can verify that a block decision on a given input is the result of your configured rule, not an opaque model judgment.
Data443's Vaikora also ships compliance presets for HIPAA, PCI-DSS, GDPR, SOC 2, and ISO 27001, so teams with specific regulatory requirements can start from a tested policy baseline rather than writing rules from scratch.
What to check next
Pull the source from PyPI or the repository and read the policy evaluation logic before you configure anything. Write one rule for a tool your agents use in a test environment, run a call that should be blocked, and verify the audit log entry. That sequence tells you whether the enforcement behavior matches your expectation before the proxy is anywhere near production.
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