Skip to main content

AgentShield

Static analysis security scanner for Claude Code configurations. Scans CLAUDE.md, hooks, MCP configs, agent definitions, skills, and settings.json for vulnerabilities, misconfigurations, and injection risks. Built at Cerebral Valley x Anthropic Hackathon (Feb 2026) as part of Everything Claude Code (ECC).
  • GitHub: affaan-m/agentshield
  • npm: ecc-agentshield
  • 1282 tests, 102 rules, 98% coverage (all claimed from README, unverified independently)

What It Scans

Five scan categories:
  1. Secrets detection — 14 patterns (API keys, tokens, credentials embedded in config files)
  2. Permission auditing — overly broad tool permissions, missing deny rules
  3. Hook injection analysis — user-controlled data flowing into hook commands without sanitization
  4. MCP server risk profiling — untrusted MCP servers, overprivileged tool access
  5. Agent config review — agent definitions that lack isolation or have overly broad tool access
Targets: CLAUDE.md, settings.json, .claude/, MCP configs, hook definitions, agents/*.md, skills/.

The 3-Agent Opus Pipeline (--opus flag)

Deep analysis mode runs three Claude Opus 4.6 agents in a red-team pipeline:
“Adversarial reasoning, not just pattern matching.” This is a concrete instance of Multi-Vendor Adversarial Review applied to security configuration rather than code review.

Usage

From within Claude Code (ECC installed):
CI integration: Exit code 2 on critical findings — usable as a build gate. Output formats: Terminal (A–F grade), JSON, Markdown, HTML. GitHub Action available at affaan-m/agentshield.

Scope vs. Existing Security Concepts

AgentShield is config-layer security, not code-layer security. The distinction matters: These are complementary, not overlapping. A codebase can pass code review and still have hooks that pass user-controlled strings to shell commands without sanitization.