VaikoraVaikora

Vaikora › Blog › Product Updates

Write a policy rule, run it against an MCP tool call, see the decision in 8ms: a walkthrough of vaikora-guard-mcp

Product Updates · Nov 22, 2026 · 3 min read

Most AI agent security discussions stop at "add guardrails." This one starts at the specific moment a tool call is requested and walks through what actually happens when a policy gate sits inline before execution.

What the problem looks like without a gate

An MCP-connected agent gets a task. It decides to call `write_file` with a path the developer never intended to expose. Nothing in the agent loop checks whether that action is allowed. The tool runs. The write happens.

The failure is not in the model. The model did exactly what it was asked. The failure is architectural: there is no enforcement point between "agent decides to act" and "tool executes."

What vaikora-guard-mcp does

`vaikora-guard-mcp` is a Python proxy, MIT-licensed, published on PyPI, that sits inline between an MCP client and the tools it calls. Before any tool executes, the proxy evaluates the call against a policy file and returns one of four decisions: allow, block, modify, or require-approval.

The same input always produces the same decision. That is deterministic policy enforcement. It is not probabilistic filtering, not an LLM judging the call, not a classifier with confidence thresholds. The policy file defines the rule; the proxy applies it.

Install it:

```
pip install vaikora-guard-mcp
```

It is self-hosted. Your tool calls do not leave your environment to be evaluated.

Writing a policy rule

The policy file is where you define what is allowed. A rule has a tool name, a condition, and a decision. Here is a minimal example:

```yaml
rules:
- tool: write_file
condition:
path:
starts_with: "/etc"
decision: block
reason: "writes to /etc are not permitted"
```

When the agent calls `write_file` with `path=/etc/hosts`, the proxy matches the rule, returns `block` with the reason string, and the tool never runs. The agent receives the block decision and can handle it in its loop.

You can also require approval for sensitive operations. Set `decision: require-approval` on a rule, and the call pauses until a human approves or denies it. That is useful for destructive operations where you want a human in the loop without shutting the agent down entirely.

What gets written to the audit log

Every decision, allow or block, is written to a SHA-256 hash-chained audit log. Each entry is signed into the chain, so the log is tamper-evident. If someone modifies an entry after the fact, the chain breaks.

The log entry includes the tool name, the input, the matched rule, the decision, the reason, and a timestamp. For a compliance investigation, that record answers the question "did the agent attempt this action and what was the outcome" without relying on application-layer logs that can be cleared.

Latency at the enforcement point

The proxy adds a P50 of 8ms and a P99 of 45ms to each tool call decision. For most agent workflows, that is not perceptible. For high-frequency pipelines, 10,000 or more actions per second is the supported throughput.

The latency comes from policy evaluation and audit write. It does not include a network round-trip to an external service, because evaluation happens locally.

Where this fits in a broader control architecture

`vaikora-guard-mcp` is the open-source gateway component. It enforces the policy you write. The Vaikora Control Plane adds centralized policy management, SIEM integrations (Microsoft Sentinel, CrowdStrike Falcon, SentinelOne, AWS Security Hub), compliance presets for HIPAA, PCI-DSS, GDPR, SOC 2, and ISO 27001, and the enterprise audit infrastructure.

For teams that want to start with the open-source proxy and add centralized governance later, that path is straightforward. The gateway component does not require the control plane to enforce policy.

What to check next

If you have an MCP-connected agent in any environment, check whether tool calls are evaluated before execution or only logged after. If the answer is "logged after," you have a window where policy violations run before you can act on them.

The package is on PyPI. The source is MIT-licensed. Write one rule, run it against a tool call, and read the audit log entry. That tells you more about your actual enforcement posture than any threat model document will.

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

More from the Vaikora blog