● ZERO-DEPENDENCY OS-ISOLATED SECURITY REFERENCE MONITOR Β· 100% PYTHON 3.10+ STDLIB

mcp-cage v0.2.2 β€” Zero-Code Wire & Native-Hook Security Firewall

"Gitleaks + Little Snitch for AI Coding Agents" β€” Deterministic, non-bypassable Information-Flow Control (IFC), format-preserving secret scrubbing, SSRF/DNS exfiltration blocking, and MCPTox / CurXecute defense for Claude Code, Cursor, OpenAI Codex CLI, Google Gemini CLI, Google Antigravity (agy), and any Model Context Protocol (MCP) server.

πŸ‘€ Author: Nagarajulu (Naga) Aerakoni πŸ“¦ Package: nagarajulu/mcp-cage βœ… Verification: 41 / 41 E2E & Unit Security Tests Passing ⚑ Wire Overhead: < 0.3 ms per JSON-RPC Frame πŸ“œ License: MIT
5 Modes
Universal Enforcement Surfaces
Wire Proxy (`wrap`), Native Agent Hooks (`hook`), Shell Wrapper, In-Process Python SDK & `mcp-sploit` CI Auditor.
8 Planes
Defense-in-Depth Architecture
Secret Vault, Dual-Lattice IFC, MELON Provenance, Spotlighting, SSRF/DNS Guard, Schema Lockfile, Config Linter & Scoped Leases.
11+ Classes
Bidirectional Wire Secret Scrubbing
OpenAI, Anthropic, AWS, GitHub PAT, Stripe, Slack, PEM Keys, JWT, DB URIs & `.env` secrets replaced prior to LLM context.
0 Deps
100% Python Standard Library
Powered by atomic `BEGIN IMMEDIATE` SQLite WAL transactions across concurrent MCP subprocesses and native hooks.
Universal Deployment Architecture

Interactive 5 Integration Modes Explorer β€” Hooks Are Not the Only Way

Whether your agent supports native lifecycle hooks (Claude Code, Cursor, Gemini CLI, Codex, Antigravity), only speaks raw stdio MCP JSON-RPC (Claude Desktop, Zed, Windsurf), executes raw shell subcommands, or runs in-process as a Python LangGraph/PydanticAI workflow, mcp-cage enforces the exact same SQLite WAL security state machine.

PLANE A β€” ZERO-HOOK WIRE PROXY Works with ANY MCP Host (Claude Desktop, Cursor, Windsurf, Zed, Cline)

Copy-Paste Invocation / Integration Snippet

            
Formal Reference Monitor Primitives

Interactive 8-Plane Security Feature Matrix

Click any of the 8 security planes below to inspect its formal invariant, real-world exploit/CVE coverage, and live wire transformation inside mcp_cage_core.py.

PLANE 1 OF 8

Formal Security Invariant:
Mitigated CVEs & Attack Classes:
Wire / Runtime Inspection Preview

          
Interactive Browser Sandbox

Live Exploit & Toxic-Flow Simulator (V1 Failure Replay vs. V0.2.2 Defense)

Replay the V1 Handle-Tracker Failure (where context laundering & cross-process leaks bypass naive guards) side-by-side against mcp-cage v0.2.2, inspect the live $(P \times U \Rightarrow S)$ capability graph, or run mcp-sploit static audits and explore the 36-Vector Master Attack Atlas.

Mode:
Live $(P \times U \Rightarrow S)$ Toxic-Flow Circuit Breaker Graph
Watch nodes light up as Private Sources $[P]$ and Untrusted Inputs $[U]$ enter the session context window:
[P] Private Source (PUBLIC)
Γ—
[U] Untrusted Input (TRUSTED)
β‡’
πŸ›‘οΈ Gate: ARMED & SAFE
βž”
[S] External Sink / Mutator

Interactive Replay & Tool Palette

1. Data & Context Sources (Read)
2. Local Workspace & Destructive Mutators
3. Egress, SSRF, DNS Exfil & MELON Attacks
Session Integrity
Confidentiality
MELON Provenance
5-Min Scoped Lease
Lethal Trifecta

1. MCP Host Context (Claude / Cursor)

2. mcp-cage Wire & Hook Monitor

3. Upstream MCP / Shell Subprocess

Cross-Process SQLite Secret Vault (secret_vault)

IDClassWire PlaceholderRaw Secret (Hidden from LLM)

Tamper-Evident Audit Stream (.mcp-cage/audit.jsonl)

Drop-In Configuration Builder

Interactive Copy-Paste Config Generator (7 Agent & SDK Targets)

Customize your workspace directory, SQLite state path, and enforcement mode below, then select your AI coding agent or Python framework to generate a ready-to-paste configuration.

.claude/settings.json + .mcp.json

        
60 Years of Systems & Agentic IFC

1966–2026 Academic Research Lineage Table

mcp-cage synthesizes six decades of Operating Systems capability confinement, decentralized Information-Flow Control (IFC), and modern LLM security research into a single zero-dependency runtime monitor.

Year System / Milestone Paper Authors / Venue Primary Citation Link Core Principle & Direct Adaptation in mcp-cage v0.2.2
1966 Capability-Based Addressing Dennis & Van Horn (MIT) Β· CACM doi:10.1145/365230.365252 β†— Replaced ambient authority with unforgeable object capabilities; inspires mcp-cage's opaque <MCP_REDACTED_...> secret vault handles and per-tool role confinement.
1972 The Reference Monitor Concept James P. Anderson Β· USAF ESD-TR-73-51 ESD-TR-73-51 β†— Defines the three reference monitor guarantees: non-bypassable, tamper-proof (out-of-process OS pipe isolation), and verifiable (small zero-dependency core).
1973–77 Bell-LaPadula & Biba Dual Lattices Bell & LaPadula (MITRE) Β· K. J. Biba MTR-2547 / MTR-3153 β†— Formalized No Read Up / No Write Down (Confidentiality) and No Read Down / No Write Up (Integrity); unified in mcp-cage's product lattice $(\mathcal{I} \times \mathcal{C})$.
1976 A Lattice Model of Secure Information Flow Dorothy E. Denning Β· CACM 19(5) doi:10.1145/360051.360056 β†— Proved that monotonic label join ($\sqcup$) across state transitions prevents both explicit and implicit information leaks.
1999 JFlow / Jif (Decentralized Label Model) Andrew C. Myers Β· POPL '99 doi:10.1145/292540.292561 β†— Introduced principled declassification and endorsement gates, mirrored in mcp-cage's ENDORSE_CONTEXT and LEASE_MUTATOR_5M human step-up actions.
2006–07 HiStar & Flume (OS-Level DIFC) Zeldovich et al. (OSDI '06) Β· Krohn et al. (SOSP '07) USENIX OSDI '06 β†— Enforced DIFC at OS process/pipe boundaries without trusting application codeβ€”directly analogous to mcp-cage wrap treating the LLM and MCP server as untrusted processes.
2010 Capsicum: Practical Capabilities for UNIX Watson, Anderson, Laurie, Kennaway Β· USENIX Security '10 USENIX Sec '10 β†— Demonstrated incremental capability sandboxing of existing UNIX binaries, inspiring mcp-cage's canonical workspace path guards and dotfile write locks.
2024 Spotlighting & StruQ (Prompt Boundary Marking) Hines et al. (Microsoft) Β· Chen et al. (UC Berkeley) arXiv:2403.14720 β†— Cryptographically randomized datamarking boundaries (<<<UNTRUSTED_DATA_BOUNDARY id=...>>>) with anti-spoofing sanitization on UNTRUSTED_SOURCE wire outputs.
2025 MELON: Provable Defense via Provenance Attribution Zhu et al. Β· ICML / arXiv 2025 arXiv:2502.05174 β†— Adapted as mcp-cage's zero-LLM provenance extractor: records URLs, domains, and emails from untrusted outputs and hard-blocks sinks targeting them ([PROVENANCE HIJACK BLOCKED]).
2025 CaMeL: Defending Prompt Injections by Design Debenedetti et al. (Google DeepMind) Β· arXiv 2025 arXiv:2503.18813 β†— Separates data capabilities and provenance from untrusted LLM control flow; mcp-cage achieves this at zero token cost on the JSON-RPC wire and hook boundary.
2025 Progent: Programmable Privilege Control for LLM Agents Shi et al. (UC Berkeley) Β· arXiv 2025 arXiv:2504.11703 β†— Deterministic parameter-level policy guards; adapted in StandardArgGuards (SQL AST/verb guards, SSRF/IMDSv1 guards, high-entropy DNS exfil blockers, and dotfile locks).
2025 FIDES: Securing AI Agents with Information-Flow Control Costa et al. (Microsoft Research) Β· arXiv 2025 arXiv:2505.23643 β†— Dual-lattice confidentiality and integrity label propagation with explicit sink clearance checks in multi-turn tool sessions.
2025 MCPTox: Benchmark & Analysis of MCP Tool Poisoning Wang et al. Β· arXiv 2025 arXiv:2508.14925 β†— Structural sanitization of poisoned tools/list descriptions, cross-server shadowing detection, and SHA-256 schema pinning in mcp-lock.json.
2026 FLOWSEAL & mcp-cage v0.2.2 Nagarajulu (Naga) Aerakoni arXiv:2609.14003 / GitHub β†— Unifies Plane A (MCP JSON-RPC 2.0 wire proxy) and Plane B (native IDE/CLI lifecycle hooks) over a single cross-process SQLite WAL taint state machine & bidirectional secret vault.
Taint Provenance Chain in Current Session:
Proposed JSON-RPC / Hook Call Arguments: