AgentShield
Security auditor for AI agent configurations that scans Claude Code setups for hardcoded secrets, permission misconfigs, hook injection, MCP server risks, and prompt injection vectors.
At a Glance
About AgentShield
AgentShield is an MIT-licensed, open-source security scanner built specifically for AI agent configurations, with a focus on Claude Code setups. Created by Affaan Mustafa at the Claude Code Hackathon (Cerebral Valley × Anthropic, February 2026), it is available as a CLI tool, GitHub Action, ECC plugin, and GitHub App integration.
What It Is
AgentShield scans your .claude/ directory and flags security vulnerabilities before they become exploits. It covers 268 rules across 15 modules — secrets detection, permission auditing, hook analysis, MCP server security, and agent config review — and produces a graded security report (A–F, 0–100 numeric score). The tool is designed to fill a gap the README describes as the AI agent ecosystem growing faster than its security tooling.
What It Catches
AgentShield's rule engine spans five major categories:
- Secrets Detection — Hardcoded API keys (Anthropic, OpenAI, xAI, AWS, Google, Stripe), GitHub PATs, JWTs, database connection strings, and environment variable leaks
- Permission Audit (17 rules) — Wildcard access like
Bash(*), missing deny lists, dangerous flags like--dangerously-skip-permissions, unrestricted network commands - Hook Analysis (40 rules) — Command injection via
${file}interpolation, data exfiltration hooks, silent error suppression, reverse shells, clipboard access, container escape patterns - MCP Server Security (49 rules) — High-risk server types, supply-chain risks from
npx -yauto-install, hardcoded secrets in MCP env config, remote transport exposure, auto-approve settings - Agent Config Review (41 rules) — Unrestricted tool access, prompt injection surfaces, hidden Unicode instructions, URL execution directives, jailbreak patterns
Recognized defenses (deny lists, sandbox settings, blocking PreToolUse hooks) are credited in every report and never penalized.
Architecture and Distribution
The scanner is written in TypeScript and structured around a discovery layer, a rule registry, a scoring engine, and multiple output reporters. It ships through four channels:
- Standalone CLI —
npx ecc-agentshield scanor global install via npm - GitHub Action —
uses: affaan-m/agentshield@v1with SARIF output, baseline drift gating, and organization policy enforcement - ECC Plugin — Integration through the Everything Claude Code skill ecosystem
- ECC Tools GitHub App — Org-wide scanning; a Pro tier with automated repo analysis is also available
Output formats include terminal, JSON, Markdown, HTML executive reports, SARIF for GitHub code scanning, portable evidence packs, and remediation plan JSON files.
Claude Opus Deep Analysis Pipeline
The --opus flag activates a three-agent adversarial pipeline powered by Claude Opus:
- Red Team (Attacker) — Finds exploitable attack vectors and multi-step chains
- Blue Team (Defender) — Evaluates existing protections and recommends hardening
- Auditor — Synthesizes both perspectives into a prioritized risk assessment
The pipeline runs Red and Blue in parallel by default, or sequentially with --stream for real-time output. It requires an ANTHROPIC_API_KEY and can also route through OrcaRouter as an alternative provider.
MiniClaw: Sandboxed Agent Runtime
Bundled with AgentShield, MiniClaw is a minimal sandboxed AI agent runtime that exposes a single HTTP endpoint backed by an isolated sandbox. It enforces four independently layered controls: rate limiting and CORS at the server level, a prompt router that strips 12+ injection pattern categories, a three-tier tool whitelist (Safe/Guarded/Restricted), and a sandboxed filesystem with path traversal blocking and symlink escape detection. MiniClaw has zero external runtime dependencies beyond Node.js built-ins.
Update: AgentShield v1.6.0
The latest release is v1.6.0, published September 10, 2026. The repository was last updated September 24, 2026, and has accumulated 1,219 stars and 268 forks since its February 2026 creation at the Claude Code Hackathon. Recent development has focused on runtimeConfidence labeling for MCP findings, score-weighted discounting for template/example findings, supply-chain verification with npm registry metadata, compliance mapping to SOC 2, PCI DSS, and ISO 27001, and an organization policy gate with export/promote workflows for enterprise CI enforcement.
Community Discussions
Be the first to start a conversation about AgentShield
Share your experience with AgentShield, ask questions, or help others learn from your insights.
Pricing
Open Source
Fully free and MIT-licensed CLI, GitHub Action, and ECC plugin for scanning AI agent configurations.
- 268 security rules across 15 modules
- CLI via npx or global npm install
- GitHub Action integration
- ECC plugin for Claude Code
- Auto-fix engine
ECC Tools Pro
GitHub App with automated repo analysis and Stripe billing for teams.
- GitHub App with automated repo analysis
- Org-wide scanning
- Stripe billing
Capabilities
Key Features
- 268 security rules across 15 modules
- Secrets detection for API keys, tokens, and credentials
- Permission audit with 17 rules
- Hook analysis with 40 rules
- MCP server security with 49 rules
- Agent config review with 41 rules
- A-F graded security reports with 0-100 numeric score
- Auto-fix engine for safe issues
- Claude Opus three-agent adversarial pipeline
- GitHub Action with SARIF output
- Baseline drift gating
- Organization policy enforcement
- Compliance mapping to SOC 2, PCI DSS, ISO 27001
- Supply-chain verification for MCP packages
- External rule packs support
- MiniClaw sandboxed agent runtime
- Multiple output formats: terminal, JSON, Markdown, HTML, SARIF
- Portable evidence packs for audits
- Remediation plan JSON files
- runtimeConfidence labeling for findings
- Secure baseline config generator
