by affaan-m
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. ๐ก๏ธ
# Add to your Claude Code skills
git clone https://github.com/affaan-m/agentshieldLast scanned: 5/11/2026
{
"issues": [
{
"type": "npm-audit",
"message": "postcss: PostCSS has XSS via Unescaped </style> in its CSS Stringify Output",
"severity": "medium"
}
],
"status": "PASSED",
"scannedAt": "2026-05-11T07:41:42.895Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}No comments yet. Be the first to share your thoughts!
30 days in the Featured rail ยท terms & refunds
Security auditor for AI agent configurations
Scans Claude Code setups for hardcoded secrets, permission misconfigs, hook injection, MCP server risks, and agent prompt injection vectors. Available as CLI, GitHub Action, and GitHub App integration.
Quick Start ยท What It Catches ยท API Reference ยท Opus Pipeline ยท GitHub Action ยท Distribution ยท MiniClaw ยท Changelog
The AI agent ecosystem is growing faster than its security tooling. In January 2026 alone:
Developers install community skills, connect MCP servers, and configure hooks without any automated way to audit the security of their setup. AgentShield scans your .claude/ directory and flags vulnerabilities before they become exploits.
Built at the Claude Code Hackathon (Cerebral Valley x Anthropic, Feb 2026). Part of the Everything Claude Code ecosystem (42K+ stars).
# Scan your Claude Code config (no install required)
npx ecc-agentshield scan
# Or install globally
npm install -g ecc-agentshield
agentshield scan
That's it. AgentShield auto-discovers your ~/.claude/ directory, scans all config files, and prints a graded security report.
Discovery intentionally skips common generated directories such as node_modules, build output, and .dmux worktree mirrors so transient copies do not duplicate findings.
AgentShield Security Report
Grade: F (0/100)
Score Breakdown
Secrets โโโโโโโโโโโโโโโโโโโโ 0
Permissions โโโโโโโโโโโโโโโโโโโโ 0
Hooks โโโโโโโโโโโโโโโโโโโโ 0
MCP Servers โโโโโโโโโโโโโโโโโโโโ 0
Agents โโโโโโโโโโโโโโโโโโโโ 0
โ CRITICAL Hardcoded Anthropic API key
CLAUDE.md:13
Evidence: sk-ant-a...cdef
Fix: Replace with environment variable reference [auto-fixable]
โ CRITICAL Overly permissive allow rule: Bash(*)
settings.json
Evidence: Bash(*)
Fix: Restrict to specific commands: Bash(git *), Bash(npm *), Bash(node *)
Summary
Files scanned: 6
Findings: 73 total โ 19 critical, 29 high, 15 medium, 4 low, 6 info
Auto-fixable: 8 (use --fix)
# Scan a specific directory
agentshield scan --path /path/to/.claude
# Auto-fix safe issues (replaces hardcoded secrets with env var references)
agentshield scan --fix
# JSON output for CI pipelines
agentshield scan --format json
# Generate an HTML executive security report
agentshield scan --format html > report.html
# Generate a portable audit bundle
agentshield scan --evidence-pack ./agentshield-evidence
# Three-agent Opus 4.6 adversarial analysis (requires ANTHROPIC_API_KEY)
agentshield scan --opus --stream
# Generate a secure baseline config
agentshield init
JSON reports now expose findings[].runtimeConfidence when AgentShield can distinguish active runtime config from project-local settings, template/example inventories, installed Claude plugin caches, declarative plugin manifests, and manifest-resolved non-shell hook implementations. Reports also include local harness adapter evidence for Claude Code, OpenCode, Codex, Gemini, Zed, VS Code, dmux, terminal-agent wrappers, and project-local templates when matching markers are present.
102 rules across 5 categories, graded AโF with a 0โ100 numeric score.
| What | Examples |
|---|---|
| API keys | Anthropic (sk-ant-), OpenAI (sk-proj-/sk-), xAI (xai-), AWS (AKIA), Google/Gemini (AIza), Stripe (sk_test_/sk_live_) |
| Tokens | GitHub PATs (ghp_/github_pat_), Linear (lin_api_), Cloudflare (CF_API_TOKEN=), Slack (xox[bprs]-), JWTs (eyJ...), Bearer tokens |
| Credentials | Hardcoded passwords, database connection strings (postgres/mongo/mysql/redis), private key material |
| Env leaks | Secrets passed through environment variables in configs, echo $SECRET in hooks |
| What | Examples |
|---|---|
| Wildcard access | Bash(*), Write(*), Edit(*) โ unrestricted tool permissions |
| Missing deny lists | No deny rules for rm -rf, sudo, chmod 777 |
| Dangerous flags | --dangerously-skip-permissions usage |
| Mutable tool exposure | All mutable tools (Write, Edit, Bash) allowed without scoping |
| Destructive git | git push --force, git reset --hard in allowed commands |
| Unrestricted network | curl *, wget, ssh *, scp * in allow list without scope |
| What | Examples |
|---|---|
| Command injection | ${file} interpolation in shell commands โ attacker-controlled filenames become code |
| Data exfiltration | curl -X POST with variable interpolation sending data to external URLs |
| Silent errors | 2>/dev/null, || true โ failing security hooks that silently pass |
| Missing hooks | No PreToolUse hooks, no Stop hooks for session-end validation |
| Network exposure | Unthrottled network requests in hooks, sensitive file access without filtering |
| Session startup | SessionStart hooks that download and execute remote scripts |
| Package installs | Global npm install -g, pip install, gem install, cargo install in hooks |
| Container escape | Docker --privileged, --pid=host, --network=host, root volume mounts |
| Credential access | macOS Keychain, GNOME Keyring, /etc/shadow reads |
| Reverse shells | /dev/tcp, mkfifo + nc, Python/Perl socket shells |
| Clipboard access | pbcopy, xclip, xsel, wl-copy โ exfiltration via clipboard |
| Log tampering | journalctl --vacuum, rm /var/log, history -c โ anti-forensics |
| What | Examples |
|---|---|
| High-risk servers | Shell/command MCPs, filesystem with root access, database MCPs, browser automation |
| Supply chain | npx -y auto-install without confirmation โ typosquatting vector |
| Hardcoded secrets | API tokens in MCP environment config instead of env var references |
| Remote transport | MCP servers connecting to remote URLs (SSE/streamable HTTP) |
| Shell metacharacters | &&, |, ; in MCP server command arguments |
| Missing metadata | No version pin, no description, excessive server count |
| Sensitive file args | .env, .pem, credentials.json passed as server arguments |
| Network exposure | Binding to 0.0.0.0 instead of localhost |
| Auto-approve | autoApprove settings that skip user confirmation for tool calls |
| Missing timeouts | High-risk servers without timeout โ resource exhaustion risk |
Supply-chain verification (agentshield scan --supply-chain) extracts MCP
package references plus root package.json and package-lock.json dependency
evidence, then reports provenance counts for npm vs git, pinned vs unpinned,
known-good packages, and npm-registry-backed metadata. Add
--supply-chain-online to query npm for downloads, maintainers, postinstall
scripts, deprecation, and package age.
Package-manager hardening checks also scan .npmrc, .yarnrc.yml, and
pnpm-workspace.yaml for plaintext registry credentials, explicit dependency
lifecycle-script enablement, and missing or weak release-age cooldowns where the
package manager supports them. npm configs are checked for lifecycle-script
blocking and unsupported release-age keys that can create false confidence; use
pnpm minimumReleaseAge / minimum-release-age, Yarn npmMinimalAgeGate, or an
external package-manager policy wrapper for cooldown enforcement.
AgentShield also scans AI developer-tool persistence surfaces used by recent npm
and PyPI campaign payloads, including Claude Code hook settings,
.claude/router_runtime.js, VS Code tasks.json folder-open automation,
Zed project tasks.json, .vscode/setup.mjs, .zed/setup.mjs, GitHub
workflow drop-ins, LaunchAgent/systemd dead-man switch artifacts,
gh-token-monitor token-store files, metadata-service credential targets, and
reported exfiltration or second-stage network indicators. These indicators are
emitted as critical hook findings so CI can fail fast even after the malicious
package has been uninstalled.
AgentShield scans both active MCP config and repository-shipped MCP templates.
mcp.json, .claude/mcp.json, .claude.json, and active settings.json should be treated as the highest-confidence runtime exposure.settings.local.json are emitted as runtimeConfidence: project-local-optional.mcp-configs/, config/mcp/, or configs/mcp/ indicate risky MCP definitions present in repository templates, not guaranteed active runtime enablement.runtimeConfidence: active-runtime | project-local-optional | template-example | docs-example | plugin-cache | plugin-manifest | hook-code.template-example MCP findings are score-weighted at 0.25x, and one