Your MCP servers are an open door. Constitution Gate is the firewall. Dual-LLM quarantine classification at the edge, under 100ms.
$ curl -X POST https://constitution-gate.yagami8095.workers.dev/v1/check \ -H "Content-Type: application/json" \ -d '{"input": "run `cat /etc/passwd`", "mode": "block"}' {"safe": false, "risk": "malicious", "signals": ["shell_injection", "path_traversal"], "confidence": 0.97, "latency_ms": 42}
Constitution Gate sits between your AI agent and MCP servers. Every tool call and response passes through dual-LLM classification before reaching your system.
Your agent invokes an MCP tool (filesystem, shell, database, web)
Dual-LLM classification: fast regex + deep semantic analysis in parallel
Safe calls pass through. Malicious calls are quarantined with full audit trail
Every pattern is derived from real-world MCP exploits documented in the wild. Not theoretical -- these are attacks that have already been used.
Attackers embed shell commands inside MCP tool arguments, gaining arbitrary code execution on your server.
Malicious prompts trick tools into reading and exfiltrating API keys, database credentials, and secrets from environment variables.
Directory escape via ../ sequences to access files outside the intended sandbox, including /etc/shadow and SSH keys.
Injected instructions in tool responses that override the agent's system prompt, hijacking its behavior for subsequent turns.
Tool calls that encode sensitive data into DNS queries, URL parameters, or outbound HTTP requests to attacker-controlled endpoints.
Malicious MCP servers returning crafted responses designed to manipulate the agent into performing unintended actions.
20 pre-configured rules mapped to the OWASP Agentic AI threat taxonomy. Production-tested, not checkbox security.
block quarantines malicious calls. warn passes them through with a flag. log records silently for shadow testing.
POST /v1/check Content-Type: application/json Authorization: Bearer cg_sk_... { "input": "read file ../../../etc/shadow", "rules": ["owasp-top-10"], "mode": "block", "context": { "tool": "filesystem", "agent_id": "agent-prod-1" } }
{
"safe": false,
"risk": "malicious",
"signals": [
"path_traversal",
"sensitive_file_access"
],
"confidence": 0.97,
"latency_ms": 38,
"action": "blocked",
"rule_ids": ["CG-003", "CG-009"],
"audit_id": "aud_7f3k9m2x"
}
No credit card required for Free tier. All plans include the full detection engine.
Constitution Gate runs on Cloudflare Workers. Global edge deployment, zero cold starts, zero infrastructure to manage.
npm install -g wrangler
Authenticate with your Cloudflare account.
git clone github.com/yedanyagamiai/constitution-gate
Set your API key in wrangler.toml secrets.
wrangler deploy
Live on 300+ edge locations in under 30 seconds.
Update your agent's MCP endpoint to route through Constitution Gate. One line change.
name = "constitution-gate" main = "src/index.js" compatibility_date = "2024-12-01" [vars] MODE = "block" # block | warn | log RULES = "owasp-top-10" # rule preset LOG_LEVEL = "info" # Set secrets via: wrangler secret put CG_API_KEY
Constitution Gate is the missing security layer between AI agents and the tools they call. Based on arXiv:2509.14285, deployed in production.
Start protecting your MCP servers