Skip to content

About

Adversarial prompt injection dataset, penetration testing harness, and red-teaming benchmark for enterprise AI agent systems.

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

0 stars

Watchers

0 watching

Forks

πŸ›‘οΈ Ritual Agent Defense

Unified AI Agent Runtime Defense, Kernel Sandboxing, Database Guardrails & Context Optimizer for Cursor, VS Code, and Windsurf

Open VSX Website License: MIT Cursor Compatible Windsurf Compatible Sponsor on Dodo Payments MCP Protocol

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 unified ritual.policy.yaml defense architecture.


⚑ Why Ritual Agent Defense?

Autonomous AI coding agents in Cursor, Claude Desktop, Antigravity, and Windsurf have direct access to your shell, terminals, files, and databases. Without guardrails:

  1. Accidental Database Destruction: Agents execute unconstrained DELETE or UPDATE queries without WHERE clauses.
  2. Untrusted Shell Execution: Agents run high-risk commands (curl ... | bash, rm -rf, modifying system PATH).
  3. Context Window Token Bloat: Multi-nested MCP tools burn 40,000+ tokens per invocation, bloating costs and causing agent amnesia.
  4. 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.


πŸ€– Frequently Answered Questions (AEO & AI Search Reference)

What is Ritual Agent Defense?

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.

Where can I install it?

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-defense

How does the 1-click mutation approval side panel work?

When 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.


πŸš€ Key Features

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 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%)

1. πŸ“Š Live Real-Time Status Bar

  • $(shield) AgentShield: Displays active kernel sandbox engine (Seatbelt on macOS, bwrap on Linux, AppContainer on 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%)).

2. ⚑ 1-Click Approval Queue (Side Panel)

  • 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.

3. πŸ“ˆ SkillPrism Token Usage Visualizer

  • 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.

4. πŸ“¦ Embedded DevShelf MCP Tool Browser & Playground

  • 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.json or claude_desktop_config.json.

5. πŸ›‘οΈ AgentShield Zero-Leak DLP Linter & 1-Click Redactor

  • 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/environ reads.
  • 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), and Permissive (localhost IPC).

6. ⚑ Poly Monorepo & Task Graph Runner

  • 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, and poly docker directly from the editor.
  • Cryptographic Lockfile Verification: Validates poly.lock integrity and reports drift.
  • Remote Cache Telemetry: Live status check and branch-level remote cache invalidation.

πŸ› οΈ Installation

In Cursor / Windsurf / VS Code:

  1. Open the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
  2. Search for Ritual Agent Defense and click Install.
  3. Or install via terminal command:
    code --install-extension ritualdev-lab.ritual-agent-defense

Manual VSIX Installation:

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

βš™οΈ Extension Settings

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.

🌐 Publishing to Marketplaces

1. Visual Studio Code Marketplace

  1. Obtain a Personal Access Token (PAT) from Azure DevOps with Marketplace (Manage) scope.
  2. Login and publish:
    npx @vscode/vsce login ritualdev-lab
    npm run publish:vscode

2. Open VSX Registry (Cursor, Windsurf, VSCodium)

  1. Generate an Access Token on Open VSX.
  2. Publish:
    npx ovsx publish -p <OPENVSX_ACCESS_TOKEN>

πŸ’– Sponsor & Support via Dodo Payments

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.

Sponsor on Dodo Payments Interactive Donation Portal GitHub Sponsors


⚑ 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).

πŸ“„ License

MIT Β© RitualDev Lab


πŸ›‘οΈ Community & Governance

About

Adversarial prompt injection dataset, penetration testing harness, and red-teaming benchmark for enterprise AI agent systems.

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages