Vaikora › Blog › Product Updates
How vaikora-guard-mcp intercepts an MCP tool call before execution, and what you can do with the source
Every MCP-connected agent produces a stream of tool calls. Each one is a concrete action: read a file, query a database, POST to an API, delete a record. The question is whether anything checks that action against policy before it executes, or whether the agent just runs.
vaikora-guard-mcp answers that question with a small, inspectable Python proxy you can read in an afternoon, install from PyPI, and run in your own environment. The MIT licence means you can modify it, fork it, or embed it without asking permission.
What the proxy actually is
vaikora-guard-mcp sits inline between an MCP client (your agent or orchestrator) and the MCP server that exposes tools. When the agent issues a `tools/call` request, the proxy intercepts it before the upstream server ever sees it.
At that interception point, the proxy evaluates the call against a policy definition. The result is one of four outcomes: allow, block, modify, or require-approval. If the decision is block, the upstream server never receives the request. The agent gets back a structured refusal, and the proxy writes a signed record to the audit log.
Nothing in that path is probabilistic. The same input always produces the same decision. That matters for auditability: when a compliance reviewer asks why an agent was blocked from accessing a particular resource at a particular time, there is a deterministic answer.
Installing it and writing a first rule
```
pip install vaikora-guard-mcp
```
The proxy is configured with a policy file. A minimal rule looks like this:
```yaml
rules:
- id: block-delete-prod
match:
tool: ".delete."
argument.environment: "production"
action: block
reason: "Delete operations on production require out-of-band approval"
```
When an agent calls any tool whose name matches `.delete.` with `environment` set to `production`, the proxy blocks it, returns the reason string to the agent, and writes the decision to the audit chain.
The rule file supports regex matching on tool names and argument values. You can stack multiple rules, and the first match wins. For teams that want to start permissive and tighten over time, a default-allow posture with explicit block rules on sensitive operations is the practical starting point.
What the audit record contains
Every decision, allow or block, produces an audit entry. The entry captures the tool name, the full argument payload, the matched rule identifier, the action taken, and a timestamp. Each entry is signed into a SHA-256 hash chain, so the sequence is tamper-evident. You can verify that no entries were deleted or reordered after the fact.
That property is what makes the log useful in an investigation. If an agent ran an unexpected sequence of tool calls before a block fired, the ordered, signed record shows exactly what happened and in what order.
The gap this closes in a typical MCP deployment
Most MCP deployments have authentication at the transport layer and, if the team is careful, authorization at the tool level on the server. What they usually lack is a policy layer that spans multiple tools and evaluates argument content.
Consider an agent with legitimate access to both a `read_file` tool and an `upload_to_external` tool. Each tool, evaluated in isolation, might be authorized. But a rule that blocks `upload_to_external` when the argument path matches a sensitive directory pattern catches a data movement risk that per-tool authorization cannot see. That kind of cross-tool, argument-aware policy is what the proxy's rule engine is designed for.
Connecting to the enterprise control plane
Running the open-source proxy gives you local enforcement and a local audit log. If your environment has multiple agents across multiple systems, managing policy files individually does not scale.
Vaikora's enterprise control plane centralizes policy management, aggregates audit logs across all proxy instances, and pushes those logs into your existing security tooling. Vaikora integrates natively with Microsoft Sentinel, CrowdStrike Falcon, SentinelOne, and AWS Security Hub, so AI agent decisions appear in the same place as the rest of your security telemetry.
The open-source proxy and the control plane use the same policy schema, so a rule you test locally deploys to the enterprise plane without rewriting.
What to check next
Start by installing `vaikora-guard-mcp` from PyPI and routing one agent through it. Write a single block rule against your most sensitive tool category, something you would not want an agent calling without review. Run the agent, trigger the block, and read the audit entry it produces.
The source is on GitHub. Reading the interception logic and the audit chain implementation takes less time than a design meeting, and it tells you more about what the proxy actually does.
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