Home | Blog | vaikora-guard-mcp: How the Policy Check Works Before Your MCP Tool Call Executes

vaikora-guard-mcp: How the Policy Check Works Before Your MCP Tool Call Executes

Most MCP servers do nothing between receiving a tool call and executing it. The request arrives, the tool runs, and whatever happens next is the outcome you live with. If the tool writes to a database, sends a request to an external API, or deletes a file, that action is already done by the time any downstream logging catches it.

vaikora-guard-mcp inserts a policy enforcement step into that gap. It is open source, MIT-licensed, written in Python, and published on PyPI as `vaikora-guard-mcp`. You can read every line before you run it.

What the Proxy Actually Does

vaikora-guard-mcp sits inline between your AI agent and the tools it can call. When the agent issues a tool call, the proxy intercepts the request and evaluates it against a deterministic policy before forwarding it.

The enforcement decision is one of four outcomes: allow, block, modify, or require-approval. The decision is made before execution. If the policy says block, the tool never runs. If the policy says require-approval, the call is held until a human clears it. The agent does not get to race ahead.

Because the policy logic is deterministic, identical inputs always produce identical decisions. There is no probabilistic scoring that might go a different direction on a second evaluation. This matters for auditability: a reviewer can look at a logged decision and know that the same input would produce the same result today.

How to Install and Run It

The install is a single pip command:

“`
pip install vaikora-guard-mcp
“`

From there, you configure your policy rules in a YAML file, point the proxy at your MCP-compatible tool server, and start it. Your agent’s tool calls route through the proxy automatically with no SDK migration required.

A minimal configuration blocks any tool call that attempts to write to a path outside a specified directory, requires human approval for any call that includes credentials or secrets, and allows everything else. You define the rules; the proxy enforces them at runtime.

The Audit Log

Every decision the proxy makes is written to a SHA-256 hash-chained, tamper-evident audit log. Each entry references the previous entry’s hash, so any after-the-fact modification to a log record breaks the chain at that point. A reviewer auditing the log can verify its integrity without trusting the system that produced it.

This matters in regulated environments. If a compliance audit asks what an AI agent did on a specific date and time, the audit log provides an ordered, verifiable record of every tool call attempted, the policy decision applied, and the outcome. The log does not depend on the tool itself reporting back accurately.

Enforcement Latency at Scale

Adding an inline policy check raises the obvious question of overhead. Vaikora Guard MCP enforces at a P50 of 8ms and a P99 of 45ms, and the underlying enforcement layer handles 10,000 or more actions per second. For most agent workflows, the latency is not a practical concern. For high-throughput pipelines, the throughput ceiling is high enough that the policy layer does not become the bottleneck.

A Concrete Scenario

Consider an AI agent connected to a file management tool and a SQL query tool. Without a policy layer, the agent can call either tool with any parameters it constructs. A prompt injection attack that tells the agent to run `DROP TABLE users` reaches the database directly.

With vaikora-guard-mcp in place, that tool call hits the policy check first. A rule that blocks any SQL statement containing DDL operations (CREATE, DROP, ALTER, TRUNCATE) would stop that call before it reaches the database. The block is logged with the full request content and the rule that triggered. The agent receives a rejection response and cannot retry with the same parameters.

This is not detection after the fact. The database never saw the query.

Connecting to the Enterprise Control Plane

The open-source proxy runs standalone with file-based policy configuration. Teams that need centralized policy management across multiple agents, SIEM integration, or compliance presets for HIPAA, PCI-DSS, GDPR, SOC 2, or ISO 27001 can connect it to the Vaikora Control Plane, the commercial product hosted by Data443. The proxy and the control plane use the same policy format, so the transition does not require rearchitecting the deployment.

The proxy also integrates with Microsoft Sentinel, Microsoft Defender, SentinelOne, CrowdStrike Falcon, and AWS Security Hub, pushing AI agent threats into those systems as native signals with severity mapping already applied.

What to Check Next

Pull the source from PyPI or the GitHub repository. Read the policy enforcement logic in the proxy before you deploy it. Configure a minimal rule set against your most sensitive tools first, specifically any tool that writes data, calls external APIs, or touches credentials. Verify that the audit log chain validates correctly after a test run. That sequence tells you more than any documentation about whether the control actually works in your environment.