Home | Blog | Deterministic Policy Enforcement for AI Agents: Inside the Vaikora Guard MCP Open-Source Release

Deterministic Policy Enforcement for AI Agents: Inside the Vaikora Guard MCP Open-Source Release

A single unguarded tool call is enough to exfiltrate a file, write to a production database, or POST credentials to an external endpoint. Vaikora Guard MCP is the open-source layer that sits between your AI agent and those tool calls, enforcing a deterministic allow, block, modify, or require-approval decision before any action runs.

What "inline enforcement before execution" actually means

Most approaches to AI agent security work by logging what happened and alerting afterward. Vaikora Guard MCP is a proxy. It intercepts the tool call, evaluates it against policy, and either permits the call, drops it, rewrites it, or routes it to a human approver. The model never receives a successful tool response for a blocked call. The action does not execute.

This is not a monitoring layer you add to get visibility after the fact. The gate sits in the request path.

How the proxy is structured

The package is published on PyPI as `vaikora-guard-mcp`, written in Python, MIT licensed, and self-hostable. It supports the Model Context Protocol (MCP) natively, so it works with any MCP-compatible agent or orchestrator without touching your SDK or migrating LLM providers. Vaikora supports 12 LLM providers in this configuration.

The gateway ships six content inspection modules. These cover things like prompt injection patterns, data-in-transit sensitivity, action scope, and destination validation. Each module runs synchronously in the request path so a decision is complete before the upstream tool receives the call.

Policy is deterministic: identical input always produces identical output. There is no probabilistic scoring that lets a policy be bypassed by rephrasing. If a rule says block, it blocks.

Worked example: an agent trying to read a file outside its declared scope

Say an agent is authorized to read files in `/data/reports/`. A prompt injection in a retrieved document tells the agent to call the filesystem tool with path `/etc/passwd`.

Without a policy gate, the tool executes and the agent gets the file content.

With Vaikora Guard MCP in the path:

  • The incoming tool call carries the path argument `/etc/passwd`
  • The scope inspection module compares the path against the declared allowed prefix
  • The call does not match; the enforcement decision is `block`
  • The decision is written to the audit log before any upstream request is made
  • The agent receives a blocked-action response, not file content

The whole sequence runs at P50 8ms, P99 45ms, so the agent loop does not stall waiting for a policy decision.

Audit chain and tamper evidence

Every decision, whether allow, block, modify, or require-approval, is written to a SHA-256 hash-chained audit log. Each entry references the hash of the previous entry, so any post-hoc deletion or modification of a record breaks the chain. This matters for compliance investigations and for SOC workflows where you need an ordered, trustworthy record of what an agent did and when.

Compliance presets for HIPAA, PCI-DSS, GDPR, SOC 2, and ISO 27001 ship in the enterprise control plane. For teams self-hosting the open-source gateway, the same policy structure applies; the control plane adds centralized management and the signed audit chain at scale.

Where this fits in an existing security stack

Vaikora Guard MCP does not replace your existing access controls. It adds a runtime gate on top of Azure RBAC, AWS IAM, and Snowflake roles. Those controls govern what a human or service principal is permitted to do at the infrastructure level. Vaikora governs what an AI agent is permitted to call at the tool level, before the downstream system ever sees the request.

For teams already running Microsoft Sentinel, SentinelOne, CrowdStrike Falcon, or AWS Security Hub, Vaikora integrates natively with all four. High-severity agent threats are promoted into those platforms as incidents or threat intelligence indicators, with severity mapping applied automatically (Critical=100, High=75, Medium=50, Low=25 in SentinelOne). No custom engineering is required to get AI agent risk into your existing detection workflow.

What to check next

If you are running an MCP-compatible agent in production, the starting point is installing `vaikora-guard-mcp` from PyPI and reviewing the six content inspection modules against your agent’s declared tool scope. Map the tools your agent can call to the policies you would write for a human with equivalent access. Anywhere the answer is "I would not let a human do this without approval," configure the require-approval decision for that tool class.

The source is on PyPI and the gateway is MIT licensed, so you can read the enforcement logic directly rather than taking a vendor’s word for how decisions are made.