cd /news/ai-safety/a-policy-enforcement-layer-for-mcp-t… Β· home β€Ί topics β€Ί ai-safety β€Ί article
[ARTICLE Β· art-26804] src=github.com β†— pub= topic=ai-safety verified=true sentiment=Β· neutral

A policy enforcement layer for MCP tool execution using Rego

Regentix, a policy enforcement gateway for LLM tool execution, uses Rego-based governance to intercept and validate MCP requests from clients like Claude Desktop before execution. The system combines a Rust proxy, a Python AI backend with a fine-tuned Qwen2.5-Coder model, and an Angular dashboard to generate and enforce deny-by-default policies, blocking unauthorized actions such as restricted Git repository access.

read3 min publishedJun 14, 2026

Policy-driven MCP proxy for secure LLM tool execution using Rego-based governance with local AI-generated rules

⚠️ Warning

This project is in early development and is not production-ready. It may contain bugs, incomplete features, or breaking changes. Use at your own risk.

Video Demo

regentix_demo-2.mp4 #

Regentix is a security and governance system that sits between LLM clients (like Claude Desktop) and MCP (Model Context Protocol) servers.

It acts as a policy enforcement gateway, ensuring that every tool execution request generated by an LLM is validated against Rego-based policies (Regorus engine) before being executed.

The system combines:

  • MCP proxy enforcement (Rust)
  • AI-driven policy generation (Python)
  • Rego policy engine (Regorus)
  • Web UI for rule creation (Angular)

LLM-generated intent should never directly become execution.

Every action must pass through a governance layer.

  • πŸ” Rego-based policy enforcement via Regorus - πŸ€– AI-generated policies using fine-tuned Qwen2.5-Coder-1.5B-Instruct - 🧠 Synthetic dataset generation via Google Gemini - πŸšͺ MCP proxy integration with Claude Desktop - 🧾 Fine-grained access control (e.g. Git repository restrictions)
  • 🌐 Web dashboard for policy generation (Angular UI)
  • βš™οΈ Multi-language architecture (Rust + Python + Angular)
  • πŸ›‘οΈ Deny-by-default execution model
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   Claude Desktop     β”‚
                    β”‚   (MCP Client)       β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚ MCP Tool Call
                              β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   Regentix MCP Proxy (Rust)  β”‚
              β”‚   - STDIO MCP Server         β”‚
              β”‚   - Enforcement layer        β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β”‚ Policy evaluation
                        β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   Regorus Policy Engine (Rego)       β”‚
        β”‚   - Allow / Deny decisions           β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                   β”‚
        β”‚ ALLOW             β”‚ DENY
        β–Ό                   β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ MCP Servers    β”‚   β”‚ Blocked Execution  β”‚
β”‚ (Git, FS, etc) β”‚   β”‚ Request rejected   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ Python AI Backend                    β”‚
        β”‚ - Fine-tuned Qwen2.5-Coder          β”‚
        β”‚ - Generates Rego policies           β”‚
        β”‚ - Uses Gemini synthetic dataset      β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
                  β”‚ policy generation API
                  β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ Angular Web Dashboard                β”‚
        β”‚ - UI for policy creation             β”‚
        β”‚ - Sends requests to backend          β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Claude Desktop sends MCP tool request

  • Rust MCP Proxy intercepts request

  • Regorus evaluates Rego policies

  • Decision:

  • Allow β†’ forward to MCP server

  • Deny β†’ block execution

  • Python backend generates policies via AI

  • Angular UI manages rule creation

  • Base model: Qwen2.5-Coder-1.5B-Instruct

  • Dataset: synthetic data generated via Google Gemini

  • Output: Rego policies compatible with Regorus

Capabilities:

  • Natural language β†’ policy generation

  • Policy refinement

  • Rule validation

  • Block GitHub repository access via MCP Git server

  • Restrict filesystem operations

  • Prevent destructive tool actions

  • Role-based execution control

Layer Technology
MCP Proxy Rust
Policy Engine Regorus
Backend Python
Frontend Angular
Model Qwen2.5-Coder
Dataset Gemini

Alternative compiling: ./deploy_build_rust.sh ./deploy_release_rust.sh

chmod +x deploy_build_rust.sh deploy_release_rust.sh

cd model_ai/ python -m venv venv source venv/bin/activate pip install -r requirements.txt

cd model_ai/rego-finetuning ./start.sh

cd model_ai/ python start_server.py

cd regentix_frontend npm install npm start

Open: http://localhost:4200/

{ { "mcpServers": { "regentix": { "command": "", "args": [] } }

In this file add the mcp server for example: [

{
"server_name":"filesystem",
"command":"npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", ""],
"env":{}
},
{
"server_name": "commands",
"command": "npx",
"args": ["-y", "mcp-server-fetch-typescript"],
"env": {}
},
{
"server_name": "github",
"command": "npx",
"args": [
  "-y",
    "@modelcontextprotocol/server-github"],
"env": {}
}

]

  • Deny-by-default execution
  • All MCP calls intercepted
  • Rego policy validation required
  • Explicit allow only

This project was built with extensive assistance from generative AI models. Used for:

  • code generation
  • architecture design
  • Rust learning

LLM intent β‰  execution

All actions must be governed

  • Improved Rego rule synthesis
  • HTTP transport support (not only STDIN MCP)
  • LLM-agnostic integration layer

OPA / Regorus / Qwen / Gemini / Claude MCP / Rust / Python / Angular

── more in #ai-safety 4 stories Β· sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/a-policy-enforcement…] indexed:0 read:3min 2026-06-14 Β· β€”