Skip to main content Switch to mobile version agentgate-mcp 0.1.0 Runtime security gateway for AI agents (MCP): policy, poisoning/rug-pull detection, taint tracking and SIEM-ready audit logs.
pip install agentgate-mcp Copy PIP instructions
A runtime security gateway for AI agents using MCP. It tracks data flow across tool calls, sends detections to your SIEM, and is measured on an open attack benchmark.
Status: v0.1.0 (pre-release). Everything in the project plan's core is built and measured: stdio and HTTP proxies, seven detectors, taint tracking, SIEM pack, benchmark. See Results and Roadmap.
AgentGate sits between an MCP client (Claude Desktop, VS Code, Cursor, a custom agent) and each MCP server. It inspects every JSON-RPC message, then allows it, denies it or asks a human. Every decision becomes a structured audit event that can go to Splunk.
MCP client ──stdio/HTTP──▶ agentgate wrap / serve ──stdio/HTTP──▶ real MCP server(s) │ manifest guard (pinning, rug pull, shadowing) │ poisoning heuristics · classifier · LLM judge (optional) │ argument policy (paths, shell, SSRF) · secrets & PII │ result scanner · taint tracker (cross-server data flow) ▼ audit.jsonl ──▶ Splunk HEC ──▶ Sigma rules + dashboard
The Splunk dashboard after replaying the demo attack chain in the lab (lab/). 10 of 12 detections fire, including two correlation rules. See detections/README.md.
End-to-end demo with a real LLM (openai/gpt-oss-120b, transcripts): asked only "What's the weather in Delhi?", an agent with a poisoned weather tool leaked a canary SSH key to the attacker in 6 of 7 unprotected runs and 0 of 7 with AgentGate.
pip install -e . # PyPI release as agentgate-mcp is coming with v0.1.0 On Windows, see docs/windows_quickstart.md.
Put every stdio server of a client behind AgentGate in one step (shows a diff first; --apply writes it and keeps a .bak):
agentgate install --client claude-desktop # or cursor, windsurf, vscode, claude-code agentgate install --client claude-desktop --apply Or wrap a server by hand. In your client's MCP config, replace the server command:
// before "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "C:/Users/me/projects"] } // after "filesystem": { "command": "agentgate", "args": ["wrap", "--server", "filesystem", "--", "npx", "-y", "@modelcontextprotocol/server-filesystem", "C:/Users/me/projects"] } For a remote (Streamable HTTP) server, run the gateway and point the client at it:
pip install -e ".[http]" agentgate serve --server github --upstream https://mcp.example.com/mcp --port 8765 # client config: "url": "http://127.0.0.1:8765/" As a central gateway in Docker (audit events go to docker logs for your log shipper):
docker build -t agentgate . docker run -p 8765:8765 -e UPSTREAM=http://mcp-server:8000/mcp -e SERVER=github agentgate Useful commands:
agentgate pins # pinned tool definitions and their status agentgate approve weather # review and approve new/changed tool definitions agentgate logs --findings # recent audit events that had findings agentgate report -o report.md # Markdown summary: decisions, top findings, blocked by session agentgate scan-config --sarif r.sarif # audit client MCP configs (Claude, Cursor, VS Code, ...) agentgate check -s filesystem --input '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"read_file","arguments":{"path":"~/.ssh/id_rsa"}}}' agentgate check -s weather --manifest tools.json # scan a tools/list result (exit 1 if blocked) Team allowlist (policy-as-code): agentgate pins-export -o pins.json writes every approved tool definition with its SHA-256; commit it, review changes in pull requests, and run agentgate pins-import pins.json on each machine. With defaults.first_seen_tool: deny, only reviewed definitions ever reach the model. Import re-hashes each definition and rejects a file whose definitions were edited without updating the hash; protecting the file itself is up to code review and signed commits.
To approve "ask" decisions from your phone, set defaults.approvals: telegram in the policy and export TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID; AgentGate sends Allow/Deny buttons and denies if nobody answers within two minutes.
State lives in ~/.agentgate/ (override with AGENTGATE_HOME). The policy comes from --policy, then AGENTGATE_POLICY, then the bundled policies/default.yaml.
Results (frozen run, 29 Nov 2026)
AgentGate-Bench: 60 attack cases in 10 categories and 112 benign cases (42 real MCP server manifests with 709 tools, plus real documentation text as tool results). Rules and thresholds were frozen (commit ba3c71f) before the test split was read. Full results · error analysis
100% on obvious poisoning, invisible Unicode, rug pulls, shadowing, secrets, command injection, SSRF.
Taint tracking lifts obfuscated exfiltration from 0% to 60%.
Subtle, keyword-free poisoning: 0% with every layer. That's the main open problem.
The classifier's gains were all on the dev split; on test it added nothing, so it stays opt-in.
Generalisation check (corpus v2): after adding 43 cases in new families and tuning on dev only, recall on the 20 new unseen test cases was 50% vs 77% on dev (results). Rules fit what you've seen; this is the honest number.
LLM-judge layer (post-freeze, gpt-oss-20b): subtle poisoning 57% → 86%, overall 92% → 96%, false positives 4% → 6% (results).
Caveat: the same person wrote the rules and the attacks; a held-out red-team set is next.
Compared with existing tools on the same cases (details):
Neither other tool's rules have seen these cases, while mine were written alongside them, so this favours AgentGate; read the fairness notes.
Tools that are flagged, or that changed since approval, are removed from tools/list, so the model never sees the poisoned description. Calls to them are denied with a JSON-RPC error. If a detector crashes, the message is denied (fail closed).
AgentGate does not replace sandboxing or least-privilege credentials. It is one layer of defence in depth.
Prompt-injection detection is probabilistic. False-negative rates will be reported honestly in the benchmark.
No enterprise features (SSO, multi-tenancy).
stdio relay and Streamable HTTP reverse proxy; fail-closed pipeline; JSONL audit log
YAML policy (allow / deny / ask); approvals on a terminal or via Telegram
Manifest pinning, rug-pull diff, shadowing; team allowlist via pins-export / pins-import
Poisoning heuristics (intent patterns, invisible Unicode, homoglyphs, suspicious defaults), applied to tools, server instructions and prompts
Argument policy, SSRF (incl. IPv4 shorthand), secrets and Indian PII, result scanning and redaction
Taint tracker: winnowed fingerprints, exact and key=value secrets, identifiers for paraphrased leaks, URL/base64/hex decoding, shared across servers
Optional ONNX classifier and LLM judge (with persistent verdict cache)
scan-config (SARIF), check, lethal-trifecta posture warning
Splunk pack (16 Sigma rules, dashboard, lab) and Wazuh rules, both verified on an attack chain
AgentGate-Bench: 110 attacks, 42 real benign servers, two freezes, comparison, CI gate
LLM-judge results with gpt-oss-20b (gpt-oss-120b run in progress, Groq free-tier quota)
Held-out red-team evaluation (needs an outside contributor)
PyPI release and demo video
python -m venv .venv && . .venv/bin/activate # Windows: .venv\Scripts\activate pip install -e ".[dev]" pytest -q && ruff check . && mypy See docs/threat_model.md and docs/owasp_mapping.md.
Contributions welcome: see CONTRIBUTING.md. Licence: Apache-2.0. To report a vulnerability, see SECURITY.md.
Both files in this release have provenance metadata.
Apache-2.0 View SPDX License List
agents ai-security llm mcp prompt-injection siem
Development Status 2 - Pre-Alpha
Programming Language Python :: 3
Release files for agentgate-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 906.9 kB
Release files / agentgate_mcp-0.1.0.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Release files / agentgate_mcp-0.1.0-py3-none-any.whl
Security for agentgate-mcp 0.1.0
Both files in this release have been uploaded with provenance metadata.
With provenance agentgate_mcp-0.1.0.tar.gz Dec 2, 2026
With provenance agentgate_mcp-0.1.0-py3-none-any.whl Dec 2, 2026
Attestation for agentgate_mcp-0.1.0.tar.gz
Attestation for agentgate_mcp-0.1.0-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Dec 2, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




