Home | Blog | How vaikora-guard-mcp Works: MIT-Licensed Policy Enforcement for Every MCP Tool Call

How vaikora-guard-mcp Works: MIT-Licensed Policy Enforcement for Every MCP Tool Call

An AI agent that can call tools without a policy gate is running with no guardrail between intent and execution. That gap is not theoretical. When an agent calls a file-write, database-query, or external API tool, it does so before any human can review the action, and most LLM frameworks have no built-in mechanism to intercept that call and apply a deterministic rule against it.

vaikora-guard-mcp is an open-source, MIT-licensed MCP-compatible proxy that sits inline between an AI agent and the tools it calls. It enforces an allow, block, modify, or require-approval decision before the tool call executes.

What "inline" actually means here

The proxy intercepts each tool call at the MCP layer. Before the call reaches the target tool, vaikora-guard-mcp evaluates it against the configured policy set and returns one of four outcomes:

  • Allow: the call proceeds unchanged
  • Block: the call is rejected and the agent receives an error response
  • Modify: the call proceeds with specific parameters stripped or rewritten according to policy
  • Require approval: the call is held until a human approves or rejects it out-of-band

This is enforcement before execution, not detection after the fact. A monitoring approach tells you what an agent did. A proxy gate controls what it can do.

Every decision is written to a SHA-256 hash-chained, tamper-evident audit log. The chain ordering means any attempt to delete or alter a past record breaks the hash sequence and is detectable.

Installing and running it

vaikora-guard-mcp is published on PyPI as `vaikora-guard-mcp`. Install with:

“`
pip install vaikora-guard-mcp
“`

The package is written in Python and self-hosted. You run it in your own environment. No data leaves your infrastructure to reach the proxy layer, which matters for environments handling regulated data.

A minimal startup looks like this:

“`
vaikora-guard-mcp –config policy.yaml –port 8080
“`

The `policy.yaml` file is where you define which tool calls are allowed, which require approval, and what parameter patterns trigger a block or modification. The proxy then accepts MCP connections on that port and applies policy to every call it receives.

A concrete scenario

Consider an agent built to query a customer database and generate a report. Without a policy gate, nothing stops that agent from issuing a query that returns a full table of PII, writing the result to a local file, and posting it to an external endpoint.

With vaikora-guard-mcp in front of that agent:

  • A policy rule can block any query that matches a pattern for bulk-read operations above a defined row threshold
  • A modify rule can strip fields matching a PII pattern before the query result is returned to the agent
  • A require-approval rule can hold any file-write operation until a human reviews the destination and content

The agent never reaches the tool for blocked or held calls. The audit log records each decision with the full call context, the policy rule that matched, and the outcome.

This is a meaningful change in how AI agent risk is managed. The control is applied at the moment of action, not discovered in a log review the next morning.

What the audit log gives you

Every enforcement decision produces a signed, chained record. For compliance purposes, this means you have an ordered, tamper-evident history of every tool call an agent attempted and every policy outcome applied to it.

Vaikora ships compliance presets for HIPAA, PCI-DSS, GDPR, SOC 2, and ISO 27001. For teams operating under any of these frameworks, the audit chain is evidence that policy was applied consistently, not just configured.

Identical input always produces an identical decision. That determinism matters when an auditor asks whether the same action would have been treated the same way at 2 a.m. on a Sunday as it was during a monitored test.

How it connects to the enterprise control plane

The open-source proxy handles enforcement and audit locally. For teams that need centralized policy management across multiple agents, enforcement telemetry aggregation, and integration with security platforms like Microsoft Sentinel, SentinelOne, CrowdStrike Falcon, or AWS Security Hub, the Vaikora control plane connects to the proxy layer without requiring a migration or code change.

The proxy and the control plane share the same policy model. Rules authored centrally push down to each proxy instance.

What to do next

If you are running agents that call tools in any production or near-production environment, the starting point is straightforward. Install the package, write a policy file that covers the tool categories your agents use, and run the proxy for one agent in a test configuration. Review the audit log after a session and check whether the actual call patterns match your assumptions.

The source is on PyPI and the license is MIT, so there is no procurement step to get started.