Home | Blog | Tool Call Interception Before Execution: Inside the vaikora-guard-mcp Open-Source Proxy

Tool Call Interception Before Execution: Inside the vaikora-guard-mcp Open-Source Proxy

When you give an AI agent access to tools, the agent decides when to call them. That decision happens at model inference time, and without something sitting inline, nothing checks whether the call should actually be allowed before it goes out.

That gap is what vaikora-guard-mcp addresses. It sits between the agent and whatever tools or APIs it wants to reach, checks each call against policy, and either allows, blocks, modifies, or routes it to a human for approval before anything executes.

What the Proxy Actually Does

vaikora-guard-mcp is an MCP-compatible proxy. It intercepts every tool call that an MCP client would normally pass straight through to a tool server. Before the call lands, the proxy evaluates it against a configured policy and returns a decision.

The four possible outcomes are:

  • Allow: the call proceeds as-is
  • Block: the call is stopped, an explanation is returned to the agent
  • Modify: the call parameters are rewritten to a safer form before execution
  • Require approval: the call is held until a human confirms or rejects it

That last one matters for high-consequence operations. If an agent wants to delete a file, write to a production database, or POST to an external endpoint, you can require a human in the loop without changing any application code.

The Technical Shape of It

The package is written in Python and published on PyPI as `vaikora-guard-mcp`. To add it to an existing MCP setup, you install it, point your MCP client at the proxy instead of the tool server, and configure your policy rules. No SDK migration, no rewriting the agent.

“`
pip install vaikora-guard-mcp
“`

Inside, there are six content inspection modules. These handle things like scanning tool call arguments for sensitive patterns, matching tool names against an allow or deny list, and checking whether the requesting agent context has permission to invoke a particular tool at all.

The proxy is self-hosted. Your tool calls do not leave your environment to get a policy decision. If you want to audit decisions later, the proxy writes each one to a SHA-256 hash-chained log. That means the record of what was allowed or blocked cannot be altered without breaking the chain.

A Concrete Scenario

Say an agent is tasked with summarizing customer support tickets and has access to a `query_database` tool and an `email_send` tool. The legitimate workflow needs `query_database`. It should never need `email_send`.

Without a policy gate, nothing stops the agent from calling `email_send` if the model infers that sending a summary outbound is a reasonable next step. With vaikora-guard-mcp, you configure a policy that blocks calls to `email_send` for this agent context. The call never reaches the tool server. The agent gets a block response and either halts or falls back to a safe path, depending on how you’ve written the agent loop.

The policy check adds P50 latency of 8ms and P99 latency of 45ms. For most tool call patterns, that’s not noticeable. For synchronous workflows where every millisecond counts, it’s worth knowing before you decide where in the stack to place the proxy.

Why Open Source Here

Security controls benefit from being inspectable. When a team is deciding whether to put something inline on every tool call their agent makes, they need to verify the logic, not just trust a black box. MIT licensing means you can read the source, fork it, modify it for your specific environment, and deploy it without negotiating terms.

The source is on GitHub and published to PyPI.

The proxy works as a standalone tool. If your team later wants a control plane with policy management UI, cross-agent visibility, and integrations with Microsoft Sentinel, CrowdStrike Falcon, or SentinelOne, Vaikora’s commercial product connects to it. But the proxy runs fine without any of that.

What to Check First

Before you configure any policy, map which tools your agents actually call and which ones they should never call. Look at your agent’s tool list and ask: if the model decides to call every tool it has access to, which calls would cause real harm?

That list becomes your initial block policy. Start with the highest-consequence tools, ones that write data, send communications, or call external endpoints, and require approval for those. Allow everything else to pass through while you build confidence in the setup.

Then review the proxy logs after a few days of real traffic. You will almost always find tool calls you didn’t anticipate.