Vaikora › Blog › Product Updates
How vaikora-guard-mcp works: policy enforcement baked into every MCP tool call, before execution
Publishing a library as open source is not interesting on its own. What matters is what the library does and where it sits. vaikora-guard-mcp sits at the point where an AI agent invokes a tool, and it makes a policy decision before that invocation completes. That position is the right one for enforcement, and this post explains the mechanics.
The problem with checking after the fact
An AI agent using the Model Context Protocol (MCP) can call tools: read a file, query a database, POST to an API, delete a record. Each of those calls happens when the agent decides to make it. If your policy check runs after the call, you are auditing damage, not preventing it.
Most agent frameworks give you hooks for logging. Some give you callbacks that fire post-execution. Neither of those stops the action. vaikora-guard-mcp inserts into the call path before the tool executes, so the enforcement decision determines whether execution happens at all.
What the proxy actually does
vaikora-guard-mcp runs as a local proxy between your agent and any MCP-compatible tool server. Every tool invocation passes through it. For each call, the proxy evaluates the request against your configured policy and returns one of four decisions: allow, block, modify, or require-approval.
- Allow: the call proceeds unchanged.
- Block: the proxy returns an error to the agent. The tool never receives the request.
- Modify: the proxy rewrites the request (stripping a field, redacting a value) and forwards the sanitized version.
- Require-approval: the call is held and routed to a human reviewer before proceeding.
Identical input always produces an identical decision. The enforcement logic is deterministic, not probabilistic. That matters for auditability: you can explain every outcome.
The package is MIT-licensed, written in Python, and published on PyPI as `vaikora-guard-mcp`. Self-hosted, no telemetry sent anywhere by default, no dependency on the Vaikora Control Plane to operate.
A concrete scenario
Say your agent is connected to a filesystem tool and a Slack tool. A prompt-injection attack in a document causes the agent to attempt to exfiltrate content by posting it to an external Slack channel.
Without a policy gate, the Slack tool call executes. With vaikora-guard-mcp sitting inline:
- The agent generates the tool call targeting the Slack tool.
- The proxy intercepts it before the Slack server receives it.
- The policy rule evaluating outbound channel destinations fires. The destination is not on the approved list.
- The proxy returns a block decision. The Slack server never sees the request.
- The decision is written to the audit log.
The agent sees a tool error and can handle it however your orchestration layer dictates. The sensitive content did not leave.
The audit log and what it gives you
Every decision vaikora-guard-mcp records goes into a SHA-256 hash-chained, tamper-evident log. Each entry references the tool called, the parameters, the policy rule that fired, the decision, and a timestamp. The chain means you cannot alter or delete an earlier entry without breaking the chain's integrity.
For compliance purposes, this gives you an ordered, verifiable record of what your agent attempted and what policy did with each attempt. That is the kind of auditability that SOC 2 and ISO 27001 controls actually require: not just logs, but logs you can defend.
Connecting the proxy to the control plane
vaikora-guard-mcp works standalone. If you want centralized policy management across multiple agents or teams, the Vaikora Control Plane (the commercial, Data443-hosted product) connects to it. That layer adds policy versioning, approval workflow routing, SIEM integration with Microsoft Sentinel, CrowdStrike Falcon, SentinelOne, and AWS Security Hub, plus compliance presets for HIPAA, PCI-DSS, GDPR, SOC 2, and ISO 27001.
The open-source proxy and the commercial control plane are designed to work together, but neither requires the other to function at a basic level.
What to check next
If you are running any MCP-based agent workflow, start with the package:
```
pip install vaikora-guard-mcp
```
Review the default policy configuration before deploying. The default blocks nothing, so it will not break your existing workflows. Add your first rule against a tool you want to restrict, run a test call, and verify the audit log entry. That sequence tells you whether the enforcement path is wired correctly before you rely on it for anything sensitive.
The source is on GitHub. Read the policy schema before writing custom rules so you understand what fields are available for matching. Tool name, parameter keys, parameter values, and destination endpoints are all matchable surfaces.
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