Turnkey starter repository for Claude Code & Claude Desktop equipped with real-time PreToolUse secret defense hooks, kernel sandboxing, and adversarial leak blocking.
Documentation • Interactive Playground • Security Advisories • Trust Center
When autonomous coding agents (Claude Code, Cursor, Windsurf) run shell commands or inspect directories, untrusted model outputs or adversarial prompt injection payloads can trick them into exfiltrating credentials (cat .env, cat /proc/self/environ, or printenv).
This repository is pre-configured with AgentShield PreToolUse hooks. Every command Claude Code runs is dynamically intercepted:
- Syscalls accessing
/proc/*/environor SSH keys are blocked. - Credentials and API keys in stdout/stderr are masked into
[REDACTED_SECRET]tokens. - Unapproved network egress is prevented with strict CIDR filtering.
Click the green Use this template button above to create your own secure agent workspace.
git clone https://github.com/YOUR_ORG/YOUR_REPO.git
cd YOUR_REPOThe .claude/config.json hook is already wired up:
{
"hooks": {
"PreToolUse": "npx @ritualdev-lab/agentshield exec \"$TOOL_COMMAND\""
}
}Run an adversarial process probe command wrapped in the AgentShield defense kernel:
npm run test:adversarialYou will observe that all volatile environment variables are masked with zero leaked secrets.
├── .claude/
│ └── config.json # PreToolUse hook configuration for Claude Code
├── .agentshield.json # Sandboxing profile, redaction rules, and egress CIDRs
├── .env.example # Safe template for local credentials
├── src/
│ └── demo-tool.js # Example tool demonstrating zero-leak output
├── test/
│ └── verify-defense.test.js # Automated verification test suite
└── .github/workflows/
└── verify-defense.yml # CI PR security gate blocking leaked secrets
- Licensed under Apache-2.0.
- Coordinated Vulnerability Disclosure: security@ritualdev.in (SLA < 24h).
- Maintained by RitualDev Studio.
If you find this project valuable, consider supporting our open-source development: