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.
โก Live Secret Redaction Playground
Type or paste a prompt with credentials below to see deterministic SHA-256 surrogate tokenization in real time.
sh -c "..."), ANSI-C escapes ($'cat\t.env'), redirection (< .env), and reader binaries (grep, awk, dd, python).
backend/.env) and respects Git worktrees without hook clobbering.
RitualDev-Lab/AgentShield@v1 blocks pull requests carrying exposed secrets with automated job summary reports.
[AGENT_SHIELD:ID:hexHash]) guarantee a 1:1 mathematical bijection upon local rehydration.
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.
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 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.
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 config.json --json
โ๏ธ In-Flight Redactor
Substitute leaked credentials with deterministic SHA-256 surrogate tokens.
npx @ritualdev-lab/agentshield redact app.ts --style hash
๐ Real-Time Stream Pipe
Stream logs or process outputs through redactor filter.
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.
๐ MCP Protocol Proxy
Filter JSON-RPC tool calls for agents using Model Context Protocol.
๐ Cryptographic Ledger
Verify tamper-evident HMAC audit log for incident forensics.
๐ Direct File Read Interception
Neutralizes attempts by autonomous agents to read production keys into context.
๐จ [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.
๐จ [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 "git status"
โ Allowed & executed transparently
๐ฆ Automatic Pre-Commit Hook
One command protects your entire team from accidentally committing secrets.
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.
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.
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.
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.
"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.
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.
"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.
// 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
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.
- โ 100% Local & Air-gapped Core Engine
- โ CLI & Stdio Streaming Interceptor
- โ Claude Code PreToolUse & Cursor Rules
- โ Git Pre-Commit Hook Integration
- โ Unlimited Public Repository Scans
- โ Everything in Solo, plus:
- โ GitHub Marketplace Action on Private Repos
- โ Sticky PR Review Comments & Inline Annotations
- โ Remote Team Policy Sync & Organization Tokens
- โ Zero-YAML GitHub App Webhook Integration
- โ Priority Discord & Email Support
- โ 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
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.
โจ 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!
"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.
Frequently Asked Questions
How does AgentShield prevent AI coding assistants from leaking credentials?
AgentShield intercepts agent shell commands via AST normalization (blocking cat .env, printenv, awk, dd, and curl with tokens) and substitutes exposed secrets in prompt streams with deterministic SHA-256 surrogate tokens.
Is AgentShield cloud-based or local-first?
AgentShield is strictly local-first and air-gapped with zero external telemetry, keeping all code, credentials, and logs securely on the developer's workstation.
Which AI coding agents are supported by AgentShield?
AgentShield supports Claude Code, Cursor, Windsurf, OpenAI Codex, Google Antigravity, and all tools implementing the Model Context Protocol (MCP).