Unified AI Agent Runtime Defense, Kernel Sandboxing, Database Guardrails & Context Optimizer for Cursor, VS Code, and Windsurf
The essential safety and governance companion for autonomous AI coding agents. Intercept destructive database mutations, sandbox shell commands, trim context token bloat, and browse verified MCP tools directly in your editor.
Canonical VS Code Extension Alignment: For the canonical lightweight 3-layer IDE extension covering AgentShield Sandbox, DBShield Mutation Approvals, and SkillPrism MCP Context Compactor, see
RitualDev-Lab/agentshield-vscode.
This repository (ritual-agent-defense) hosts the extended multi-mesh workbench edition (including the embedded DevShelf browser and Poly monorepo runner). Both extensions share the unifiedritual.policy.yamldefense architecture.
Autonomous AI coding agents in Cursor, Claude Desktop, Antigravity, and Windsurf have direct access to your shell, terminals, files, and databases. Without guardrails:
- Accidental Database Destruction: Agents execute unconstrained
DELETEorUPDATEqueries withoutWHEREclauses. - Untrusted Shell Execution: Agents run high-risk commands (
curl ... | bash,rm -rf, modifying system PATH). - Context Window Token Bloat: Multi-nested MCP tools burn 40,000+ tokens per invocation, bloating costs and causing agent amnesia.
- Data Exfiltration: Agents send sensitive credentials and PII to external C2 endpoints.
Ritual Agent Defense brings the entire RitualDev-Lab suite (AgentShield, DBShield, SkillPrism, DevShelf, web-sec-auditor, and mcp-builder-kit) into a unified visual IDE experience.
Ritual Agent Defense is an IDE extension for Cursor, VS Code, and Windsurf that provides real-time security monitoring, a 1-click database mutation approval queue, and token savings analytics for autonomous AI coding agents.
It is officially published on the Open VSX Registry and compatible with Cursor, Windsurf, VSCodium, and VS Code. Install with:
code --install-extension ritualdev-lab.ritual-agent-defenseWhen an AI agent in Cursor or Claude Code attempts to run a database query (UPDATE, DELETE, DROP) or a high-risk bash command, DBShield and AgentShield hold the execution in an isolated dry-run block. The extension's side panel renders the SQL/AST diff with [Approve β
] and [Reject β] buttons, enabling human-in-the-loop verification without context-switching.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Activity Bar (Ritual Mesh) β
ββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββ€
β 1-Click Approval Queue β [DBShield Β· UPDATE] β
β β’ Pending mutations β UPDATE users SET role = 'admin' WHERE id=1; β
β β’ Dangerous bash cmds β [β 1-Click Approve] [β Reject] β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββ€
β SkillPrism Token Savings β β‘ 261.9k Tokens Saved (68.1% Compaction) β
β β’ Real-time compaction β Est. LLM Cost Savings: $5.24 USD β
β β’ Tool invocation charts β βββββββββββββββββββ Sent: 32% | Trimmed: 68%β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββ€
β DevShelf Tool Catalog β π¦ Browse 500+ Verified MCP Tools & APIs β
β β’ In-editor playground β [β‘ Add to Cursor/Claude] [βΆ Playground] β
ββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββ
Status Bar: $(shield) AgentShield: Seatbelt | $(database) DBShield: Balanced (1 Pending) | $(zap) Saved: 261.9k (68%)
$(shield) AgentShield: Displays active kernel sandbox engine (Seatbelton macOS,bwrapon Linux,AppContaineron Windows), micro-jail counts, and blocked syscall attempts.$(database) DBShield: Shows wire-protocol proxy status, safety tier (STRICT,BALANCED), and highlights pending approvals in yellow.$(zap) SkillPrism: Shows cumulative tokens compressed and context window savings ratio (e.g.,Saved: 261.9k (68%)).
- Provides human-in-the-loop review for sensitive database mutations (
UPDATE,DELETE,DROP) and destructive shell executions. - View formatted SQL with PII masking indicators and risk scoring (
$0\text{--}100$ ). - Click "β 1-Click Approve" or "β Reject" to instantly unblock or abort the agent's operation without leaving your editor.
- Real-time visual breakdown of raw tokens vs. compacted tokens sent to LLMs.
- Displays calculated dollar savings based on current API token pricing.
- Per-tool invocation history showing compression percentages across
db_describe_schema,git_diff_inspector,cloud_logs_tail, and more.
- Search and filter over 500+ verified Model Context Protocol (MCP) servers and APIs.
- Interactive Playground: Test any tool or endpoint inside an isolated sandbox runner directly in the side panel before installing.
- 1-Click Installer: Click "β‘ Add to Cursor / Claude" to automatically configure
.cursor/mcp.jsonorclaude_desktop_config.json.
- Real-time ReDoS-Safe Secret Scanning: Scans active documents on open and change for unmasked OpenAI keys, AWS access keys, GitHub PATs, Anthropic tokens, and
/proc/self/environreads. - 1-Click Quick-Fix: Click the lightbulb on any detected credential leak to instantly execute "π‘οΈ Redact Secret with AgentShield", replacing the sensitive value with
[AGENTSHIELD_REDACTED:<ID>:<SALT>]. - Kernel Sandbox Profile Switcher: Toggle between
Strict(zero-network air-gapped jail),Standard(Git-only egress), andPermissive(localhost IPC).
- Polyglot Workspace Discovery: Tree view scanning npm, PyPI/uv, Cargo, and Go workspace members and dependencies.
- 1-Click Poly Runner: Execute
poly install,poly audit,poly fix,poly doctor,poly graph, andpoly dockerdirectly from the editor. - Cryptographic Lockfile Verification: Validates
poly.lockintegrity and reports drift. - Remote Cache Telemetry: Live status check and branch-level remote cache invalidation.
- Open the Extensions view (
Ctrl+Shift+XorCmd+Shift+X). - Search for
Ritual Agent Defenseand click Install. - Or install via terminal command:
code --install-extension ritualdev-lab.ritual-agent-defense
Download the latest ritual-agent-defense-x.x.x.vsix release and run:
cursor --install-extension ritual-agent-defense-0.1.0.vsix
# or
code --install-extension ritual-agent-defense-0.1.0.vsix| Setting | Default | Description |
|---|---|---|
ritual.dbshieldUrl |
http://localhost:3100 |
DBShield live approval feed and defense gateway URL. |
ritual.sandboxEngine |
auto |
Enforced kernel sandbox profile (Seatbelt, bwrap, AppContainer). |
ritual.skillprismEndpoint |
http://localhost:6379 |
SkillPrism federated cache and context compaction service. |
ritual.autoRefreshIntervalMs |
3000 |
Polling interval for live approvals and status bar updates. |
ritual.notifications |
true |
Show pop-up notifications when an agent requests a mutation approval. |
- Obtain a Personal Access Token (PAT) from Azure DevOps with Marketplace (Manage) scope.
- Login and publish:
npx @vscode/vsce login ritualdev-lab npm run publish:vscode
- Generate an Access Token on Open VSX.
- Publish:
npx ovsx publish -p <OPENVSX_ACCESS_TOKEN>
Ritual Agent Defense is 100% open-source and MIT-licensed. Your sponsorship directly finances our VS Code, Cursor, and Windsurf runtime defense rigs, kernel sandboxing drivers, and Open VSX marketplace distribution pipelines.
β‘ 1-Click Dodo Payments Checkout Β β’Β π Interactive Donation Form (USD & INR UPI) Β β’Β β€οΈ GitHub Sponsors
π Zero physical shipping required. Powered by Dodo Payments (Merchant of Record) with instant tax invoice and global payment methods (Cards, UPI, Apple Pay).
MIT Β© RitualDev Lab