Agentshield
AI agent security scanner. Detect vulnerabilities in agent configurations, MCP servers, and tool permissions. Available as CLI, GitHub Action, ECC plugin, and GitHub App integration. 🛡️
Last verified:
What is Agentshield?
AgentShield is a security auditor for Claude Code configurations, built at the Claude Code Hackathon (Cerebral Valley x Anthropic, February 2026). It scans your .claude/ directory for vulnerabilities, misconfigurations, and injection risks across five categories: secrets detection, permission auditing, hook injection analysis, MCP server risk profiling, and agent config review. The tool helps developers secure their AI agent setups before they become exploits.
Key features include 102 static analysis rules with 1,282 tests and 98% coverage, an auto-fix engine that safely resolves issues like hardcoded secrets and wildcard permissions, and a three-agent adversarial pipeline powered by Claude Opus 4.6 for deep analysis. The red-team agent finds attack vectors, the blue-team agent evaluates protections, and the auditor synthesizes prioritized risk assessments. Output formats include terminal, JSON, Markdown, HTML, and SARIF for CI/CD integration.
AgentShield is designed for developers building with Claude Code, Cursor, Codex, OpenCode, and other AI coding agents. It's particularly valuable for teams using the Everything Claude Code ecosystem (42K+ stars) who need production-safe agentic workflows. The tool integrates as a CLI, GitHub Action, GitHub App, and via the /security-scan command directly inside Claude Code.
Agentshield pricing
Pricing model: Freemium
AgentShield CLI is open source and free (npm package ecc-agentshield). GitHub Action is free to use. The ECC Tools GitHub App is free for open source projects and $19/month for private repositories. No paid tier mentioned for the CLI itself.
Agentshield pros
- Scans for 102 security rules across 5 categories
- 1,282 tests with 98% coverage
- Auto-fix engine for safe issues like hardcoded secrets
- Three-agent adversarial pipeline with Opus 4.6
- Red-team/blue-team/auditor analysis approach
- Multiple output formats: terminal, JSON, Markdown, HTML, SARIF
- No install required with npx ecc-agentshield scan
- GitHub Action for CI/CD integration
- /security-scan command inside Claude Code
- Graded security report with A-F score (0-100)
- Detects API keys from Anthropic, OpenAI, AWS, GitHub, Stripe
- Finds command injection in hooks with ${file} interpolation
- MCP server risk profiling for excessive permissions
- Secure init command generates hardened .claude/ directory
- Supply-chain verification for MCP package provenance
- Works across Claude Code, Cursor, Codex, OpenCode, Zed, VS Code
Agentshield cons
- Requires ANTHROPIC_API_KEY for --opus deep analysis
- Auto-fix only applies safe issues, manual review needed for others
- Template/example files can generate false positives
- Project-local settings may cause noise in reports
- Hook-code analysis has narrow language-aware rules only
- skill-md prompt text bypasses most agent/injection rules
- Real secrets in docs/examples still flagged as critical
- Some agent findings are policy findings not rule bugs
- Offline supply-chain verification may miss npm registry metadata
Frequently asked questions about Agentshield
What is AgentShield?
AgentShield is a security auditor for Claude Code configurations that scans for vulnerabilities, misconfigurations, and injection risks. Built at the Claude Code Hackathon (Cerebral Valley x Anthropic, February 2026), it analyzes your .claude/ directory across 5 categories with 102 static analysis rules, 1,282 tests, and 98% coverage.
How do I run a quick scan?
Run npx ecc-agentshield scan with no install needed. It auto-discovers your ~/.claude/ directory, scans all config files, and prints a graded security report with A-F score. You can also install globally with npm install -g ecc-agentshield.
What files does AgentShield scan?
AgentShield scans CLAUDE.md (project-level configuration), ~/.claude/settings.json (user settings), ~/.claude.json or mcp.json (MCP server configurations), hooks/hooks.json (hook definitions), agents/.md (agent definitions), and skills/.md (skill files).
What are the 5 security categories?
The five categories are: 1) Secrets Detection (14 patterns for API keys, tokens, credentials), 2) Permission Auditing (tool access boundaries, filesystem permissions), 3) Hook Injection Analysis (command injection, path traversal), 4) MCP Server Risk Profiling (excessive permissions, insecure servers), and 5) Agent Config Review (overly permissive definitions, missing constraints).
What does the --opus flag do?
The --opus flag runs three Claude Opus 4.6 agents in an adversarial pipeline: Attacker (finds exploit chains), Defender (evaluates protections), and Auditor (synthesizes prioritized risk assessment). This provides adversarial reasoning beyond pattern matching. Requires ANTHROPIC_API_KEY.
Can AgentShield auto-fix issues?
Yes, run npx ecc-agentshield scan --fix to auto-fix safe issues. Safe fixes include adding .gitignore entries for config files with secrets, removing debug hooks, updating deprecated MCP URLs, and fixing path traversal. Manual fixes required for hardcoded secrets (need secret manager choice), overly permissive agents, and complex injection chains.
What output formats are available?
Terminal (default, color-graded report), JSON (for CI pipelines with npx ecc-agentshield scan --format json), Markdown (for documentation), HTML (executive security report), and SARIF (for GitHub code scanning). Evidence packs and remediation plans are also available.
How do I use AgentShield in CI/CD?
Use the GitHub Action: uses: affaan-m/agentshield@v1 with inputs for path, min-severity, fail-on-findings, format, and policy. Exit codes are 0 (no issues), 1 (low/medium issues), 2 (critical/high issues - fails CI). Set fail-on-findings: true to fail the action on findings.
What grading scale does AgentShield use?
AgentShield uses an A-F grade with 0-100 numeric score: A (90-100, secure configuration), B (75-89, minor issues), C (60-74, needs attention), D (40-59, significant risks), F (0-39, critical vulnerabilities). Score breakdown covers secrets, permissions, hooks, MCP servers, and agents.
Is AgentShield free?
Yes, the AgentShield CLI is open source and free via npm package ecc-agentshield. The GitHub Action is free. The ECC Tools GitHub App is free for open source projects and $19/month for private repositories.