โšก Enterprise-Grade Zero-Leak Secret Defense & Sandbox
๐Ÿ“š Verified on DevShelf AI Catalog โ†—

Stop Autonomous AI Agents
From Leaking Your Secrets.

Deterministic in-flight secret interception, AST command sandboxing, Git pre-commit gates, and compliance audits for Claude Code, Cursor, Windsurf, Codex, and Antigravity.

agent@workstation: ~/workspace โ€” bash
agent@terminal:~$ npx @ritualdev-lab/agentshield exec "cat .env"

๐Ÿšจ [AgentShield Sandbox Block] Blocked attempt to read raw .env file directly into agent terminal context.
Command: 'cat .env'
Target: Production credentials intercepted before entering LLM inference window!

โšก Live Secret Redaction Playground

Type or paste a prompt with credentials below to see deterministic SHA-256 surrogate tokenization in real time.

Deploy app with OPENAI_API_KEY=[AGENT_SHIELD:OPENAI_API_KEY:4a7f9b8c1d2e3f40] and AWS_KEY=[AGENT_SHIELD:AWS_ACCESS_KEY_ID:8f1c4e2a9b3d5012].
๐Ÿ›ก๏ธ
AST Shell Command Sandbox
Unpacks subshell wrappers (sh -c "..."), ANSI-C escapes ($'cat\t.env'), redirection (< .env), and reader binaries (grep, awk, dd, python).
npx @ritualdev-lab/agentshield exec "command"
๐Ÿง 
Active Shannon Entropy ($H \ge 4.5$)
Mathematical entropy scanner detects arbitrary passwords, tokens, and custom API keys that lack predictable regex headers.
H = -Σ P(x) × log&sub2;(P(x)) ≥ 4.5
๐Ÿšฆ
Git Pre-Commit Gate
Audits staged files and diffs. Recursively protects subdirectories (e.g. backend/.env) and respects Git worktrees without hook clobbering.
npx @ritualdev-lab/agentshield hook git-install
๐Ÿ™
GitHub Actions PR Gate
Official action RitualDev-Lab/AgentShield@v1 blocks pull requests carrying exposed secrets with automated job summary reports.
uses: RitualDev-Lab/AgentShield@v1
๐Ÿ”
Collision-Proof Surrogates
Deterministic 16-hex SHA-256 tokens ([AGENT_SHIELD:ID:hexHash]) guarantee a 1:1 mathematical bijection upon local rehydration.
shield.rehydrate(sanitizedText)
๐Ÿ“‹
Compliance Attestations
Automatic control mapping for SOC2 CC6.1, PCI-DSS Req-3.4, HIPAA ยง164.312, and ISO27001 A.8.28 with audit-ready scores.
npx @ritualdev-lab/agentshield compliance .env
๐Ÿ“– Comprehensive Documentation

Complete Run & Integration Guide

Everything you need to run, configure, and integrate AgentShield across your local workstation, Git hooks, CI/CD pipelines, and autonomous AI agents.

๐Ÿš€ 1. Zero-Install Execution (npx)

Run AgentShield directly without modifying your global environment or installing dependencies.

# Audit any file or .env config
npx @ritualdev-lab/agentshield scan .env

# Redact exposed secrets to stdout
npx @ritualdev-lab/agentshield redact server.js

# Test shell interception
npx @ritualdev-lab/agentshield exec "cat .env"

๐Ÿ“ฆ 2. Local Project Installation

Install AgentShield as a development dependency for your engineering team.

# npm
npm install -D @ritualdev-lab/agentshield

# pnpm
pnpm add -D @ritualdev-lab/agentshield

# yarn
yarn add -D @ritualdev-lab/agentshield

๐ŸŒ 3. Global CLI Installation

Have agentshield and shorthand ashield globally available across all directories.

# Install globally
npm install -g @ritualdev-lab/agentshield

# Verify installation
agentshield --help
ashield --help

๐Ÿ” Secret Scanner

Deep scan targeting regular expression headers and Shannon entropy ($H \ge 4.5$).

npx @ritualdev-lab/agentshield scan .env
npx @ritualdev-lab/agentshield scan config.json --json

โœ‚๏ธ In-Flight Redactor

Substitute leaked credentials with deterministic SHA-256 surrogate tokens.

npx @ritualdev-lab/agentshield redact app.ts
npx @ritualdev-lab/agentshield redact app.ts --style hash

๐ŸŒŠ Real-Time Stream Pipe

Stream logs or process outputs through redactor filter.

env | npx @ritualdev-lab/agentshield stream
cat build.log | npx @ritualdev-lab/agentshield stream

๐Ÿ“‹ Regulatory Compliance

Score credentials against SOC2 CC6.1, PCI-DSS 3.4, HIPAA ยง164.312, and ISO27001.

npx @ritualdev-lab/agentshield compliance .env

๐Ÿ”’ MCP Protocol Proxy

Filter JSON-RPC tool calls for agents using Model Context Protocol.

npx @ritualdev-lab/agentshield mcp-proxy

๐Ÿ“œ Cryptographic Ledger

Verify tamper-evident HMAC audit log for incident forensics.

npx @ritualdev-lab/agentshield ledger verify

๐Ÿ›‘ Direct File Read Interception

Neutralizes attempts by autonomous agents to read production keys into context.

npx @ritualdev-lab/agentshield exec "cat .env"

๐Ÿšจ [AgentShield Sandbox Block]
Blocked attempt to read raw .env file!

๐ŸŽญ ANSI-C & Tab Obfuscation Defense

De-obfuscates escape strings and command substitution tricks before evaluation.

npx @ritualdev-lab/agentshield exec "sh -c $'cat\\t.env'"

๐Ÿšจ [AgentShield Sandbox Block]
De-obfuscated AST: 'cat .env' → Blocked!

โœ… Transparent Developer Passthrough

Safe commands execute cleanly without overhead or interference.

npx @ritualdev-lab/agentshield exec "npm test"
npx @ritualdev-lab/agentshield exec "git status"

โœ… Allowed & executed transparently

๐Ÿšฆ Automatic Pre-Commit Hook

One command protects your entire team from accidentally committing secrets.

# Install in .git/hooks/pre-commit
npx @ritualdev-lab/agentshield hook git-install

# Manually audit staged files
npx @ritualdev-lab/agentshield hook check

๐Ÿ™ Official GitHub Action

Add .github/workflows/agentshield.yml to guard all PRs automatically.

name: AgentShield Security Gate
on: [pull_request, push]
jobs:
  gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - uses: RitualDev-Lab/AgentShield@v1
        with: { fail_on_leak: "true" }

๐Ÿ“Š CI Command Line Gate

Run within GitLab CI, CircleCI, Jenkins, or Docker build runners.

# Diff against base branch & export SARIF
npx @ritualdev-lab/agentshield ci --base origin/main \
  --report report.md \
  --sarif results.sarif

๐ŸŸฃ Claude Code Setup

Automatically intercept agent terminal executions before commands touch your environment.

# 1-click init or add to .claude/settings.json:
npx @ritualdev-lab/agentshield init-claude

# .claude/settings.json hooks array:
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash|Terminal",
        "command": "npx @ritualdev-lab/agentshield exec --claude-hook"
      }
    ]
  }
}

๐Ÿ”ต Cursor & Windsurf Setup

Add to your project's .cursorrules or .windsurfrules.

# Add rule to .cursorrules:
"Always run npx @ritualdev-lab/agentshield exec
before inspecting configs or shell state.
Verify staged diff with:
npx @ritualdev-lab/agentshield hook check"

โšก Google Antigravity & Codex

Native agent skill execution with automatic activation.

# AgentShield includes native SKILL.md
cat SKILL.md

# Automatically invokes local CLI gates
โœ“ Zero setup required

๐ŸŒ DevShelf MCP Server (Claude, Cursor, Antigravity)

Connect your AI assistant to DevShelf's live directory and security audit engine via Model Context Protocol.

# Add to claude_desktop_config.json or cursor settings:
"devshelf": {
  "command": "npx",
  "args": ["-y", "devshelf", "mcp"]
}
# Discover tools & verify zero-leak audits!

๐Ÿงฉ Programmatic TypeScript / Node.js API

Embed AgentShield redaction and sandboxing directly into custom agent frameworks, Express proxies, or LLM middleware.

import { AgentShieldEngine, AgentCommandSandbox } from "@ritualdev-lab/agentshield";

// 1. Initialize Engine
const shield = new AgentShieldEngine();

// 2. Sanitize LLM prompt input
const input = "Connect using postgres://admin:secret123@db:5432/main";
const result = shield.scanAndRedact(input);
console.log(result.sanitizedText);
// → "Connect using postgres://admin:[AGENT_SHIELD:GENERIC_PASSWORD:8f2a1b]@db:5432/main"

// 3. Rehydrate locally upon LLM completion
const original = shield.rehydrate(result.sanitizedText);

// 4. Test Shell Sandbox
const sandbox = new AgentCommandSandbox();
const check = sandbox.inspect("cat .env");
console.log(check.allowed); // false
๐Ÿ“– View Complete Markdown Guide on GitHub (GUIDE.md) โž”
๐Ÿ’ผ Enterprise Defense & Commercial Licensing

Enterprise Zero-Leak Security at Any Scale

Always 100% free for individual developers & open-source projects. Upgrade to Team or Enterprise for centralized policies, GitHub App gates, and automated compliance attestation.

Open-Source & Solo
$0 / forever
For open-source maintainers, indie hackers, and local developers.
  • โœ“ 100% Local & Air-gapped Core Engine
  • โœ“ CLI & Stdio Streaming Interceptor
  • โœ“ Claude Code PreToolUse & Cursor Rules
  • โœ“ Git Pre-Commit Hook Integration
  • โœ“ Unlimited Public Repository Scans
Install Open-Source Free
Enterprise Fleet
$49 / seat / mo
For scale-ups and enterprises requiring SIEM streaming and SOC 2 audits.
  • โœ“ Everything in Team, plus:
  • โœ“ SaaS Control Plane Server & Heartbeat Telemetry
  • โœ“ Splunk / Datadog / Sentinel CEF SIEM Streaming
  • โœ“ Enterprise SAML / OIDC SSO & RBAC Validator
  • โœ“ Cryptographic SOC 2 & ISO 27001 Attestation Bundle
  • โœ“ Custom Honeypot Canary Decoys & Tripwires
  • โœ“ Dedicated Security Architecture Review
Deploy Enterprise Fleet (via Dodo) โž”
๐Ÿ”’ Commercial payments processed via Dodo Payments. Need an enterprise invoice, custom MSA, or vendor security onboarding? Contact contact@ritualdev.in
๐Ÿ† Public Honor Roll

Sponsors & Patrons Leaderboard

Celebrating community contributors and enterprise patrons defending open-source AI agents from secret leaks. Every contribution directly funds open-source bounties, CI benchmarks, and honeypot defenses.

๐Ÿฅ‡ Top Contributor
Alex K. (CloudSec Labs)
$250 Contributed
๐Ÿ’– Total Backers
18+ Backers
Global Open-Source
๐Ÿ›ก๏ธ Active Bounty Reserve
$575+
100% Transparent

โœจ Join the Sponsor Leaderboard

Leave your name, choose any amount ($1 / โ‚น10+ via UPI, Cards, Apple Pay), and add an optional message that will appear publicly on the leaderboard!

Max 120 characters โ€ข Displayed publicly next to your name and badge
๐Ÿ›ก๏ธ Verified Ecosystem Badges

"Secured by AgentShield" Trust Badges

Showcase verified zero-leak security across your open-source repositories and DevShelf listings. Generated dynamically with cryptographic audit verification signatures.

Zero-Leak Verified
Secured by AgentShield Zero-Leak
For all open-source projects passing AgentShield local or CI git hook audit.
[![Secured by AgentShield](https://img.shields.io/badge/Secured%20by-AgentShield%20Zero--Leak-8b5cf6?logo=shield&logoColor=white&style=flat-square)](https://agentshield.ritualdev.in/)
DevShelf Spotlight & Top Placement
520+ Dev Tools Reach
Featured sticky placement in target DevShelf category, SEO spotlight card, and full Verified Sponsor badge.
npx @ritualdev-lab/agentshield badge <tool> --tier sponsor

๐Ÿ“š Explore More Developer Tools on DevShelf

AgentShield is proudly part of the open-source suite maintained by RitualDev Lab. Discover hundreds of 100% verified free-tier developer tools, AI sandboxes, and APIs on DevShelf.

Explore DevShelf AI Catalog โž”