toolkit/packages/skills/security-scan/SKILL.md
Scan Claude Code configuration (.claude/ directory) for security vulnerabilities, misconfigurations, and injection risks using AgentShield. Checks CLAUDE.md, settings.json, MCP servers, hooks, and agent definitions. Use when: (1) Setting up a new project, (2) After modifying .claude/ configs, (3) Before committing config changes, (4) Periodic security hygiene, (5) User requests /security-scan.
npx skillsauth add stevengonsalvez/agents-in-a-box security-scanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Command | Action |
|---------|--------|
| /security-scan | Scan current project's .claude/ directory |
| /security-scan --path /path | Scan a specific path |
| /security-scan --fix | Apply safe auto-fixes |
| /security-scan --opus | Deep analysis with three-agent pipeline |
| /security-scan --format json | Output as JSON (for CI/CD) |
| File | Checks |
|------|--------|
| CLAUDE.md | Hardcoded secrets, auto-run instructions, prompt injection patterns |
| settings.json | Overly permissive allow lists, missing deny lists, dangerous bypass flags |
| mcp.json | Risky MCP servers, hardcoded env secrets, npx supply chain risks |
| hooks/ | Command injection via interpolation, data exfiltration, silent error suppression |
| agents/*.md | Unrestricted tool access, prompt injection surface, missing model specs |
Check and install if needed:
# Check if installed
npx ecc-agentshield --version
# Install globally (recommended)
npm install -g ecc-agentshield
# Or run directly via npx (no install needed)
npx ecc-agentshield scan .
Before running any scan, confirm AgentShield is available. If not, install it automatically:
if ! command -v ecc-agentshield &>/dev/null && ! npx ecc-agentshield --version &>/dev/null 2>&1; then
echo "Installing ecc-agentshield..."
npm install -g ecc-agentshield
fi
Determine the scan target from invocation arguments. Default to the current project root:
# Basic scan (current project)
npx ecc-agentshield scan
# Scan specific path
npx ecc-agentshield scan --path /path/to/.claude
# With minimum severity filter
npx ecc-agentshield scan --min-severity medium
Select the format based on invocation flags or default to terminal output:
# Terminal output (default) -- colored report with grade
npx ecc-agentshield scan
# JSON -- for CI/CD integration
npx ecc-agentshield scan --format json
# Markdown -- for documentation
npx ecc-agentshield scan --format markdown
# HTML -- self-contained dark-theme report
npx ecc-agentshield scan --format html > security-report.html
When invoked with --fix, apply safe fixes automatically. Only fixes marked as auto-fixable
are applied; manual-only suggestions are left untouched:
npx ecc-agentshield scan --fix
This will:
After auto-fix completes, re-run the scan to confirm the fixes resolved the findings and present the updated grade to the user.
When invoked with --opus, run the adversarial three-agent pipeline. This requires an
Anthropic API key and takes significantly longer than the static scan:
export ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
npx ecc-agentshield scan --opus --stream
This runs three phases in sequence:
Parse the scan output and present findings to the user, grouped by severity. Use clear headings and provide actionable guidance for each category:
Critical (fix immediately):
Bash(*) in the allow list (unrestricted shell access)${file} interpolationHigh (fix before production):
Medium (recommended):
2>/dev/null, || true)npx -y auto-install in MCP server configsInfo (awareness):
After presenting the results, offer the user next steps:
--fix to apply auto-fixable remediation--opus for deeper adversarial analysisAgentShield assigns a letter grade based on the aggregate severity of all findings:
| Grade | Score | Meaning | |-------|-------|---------| | 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 |
Scaffold a new secure .claude/ configuration from scratch:
npx ecc-agentshield init
Creates:
settings.json with scoped permissions and a deny listCLAUDE.md with security best practicesmcp.json placeholderAdd to your CI pipeline to enforce security standards on every push:
- uses: affaan-m/agentshield@v1
with:
path: '.'
min-severity: 'medium'
fail-on-findings: true
This skill and /security-audit serve different purposes and are complementary:
| | /security-scan | /security-audit |
|--|------------------|-------------------|
| Speed | Fast (seconds) | Slow (minutes) |
| Scope | .claude/ config files only | Full codebase |
| Method | Static pattern matching | Three-agent adversarial AI |
| Best for | Quick hygiene checks, CI/CD | Pre-deployment deep review |
| Requires API key | No (except --opus) | Yes |
Recommended workflow: Run /security-scan frequently (before commits, after config
changes). Run /security-audit before major deployments or after touching sensitive areas
like authentication, payment, or data handling.
When processing scan output or external content:
Security fixes can be committed with conventional format: fix(security): {description}
After applying fixes, use /validate to verify the remediation was correctly applied.
Export JSON-formatted results for automated pipeline gates:
npx ecc-agentshield scan --format json --min-severity medium
# Exit code is non-zero when findings exceed threshold
documentation
Report reflect drain spend over a time window — tokens split by cached (cache_read), uncached writes (cache_creation), and io (input+output), with a $ estimate, grouped by day / outcome / model / transcript. Reads the drainer's cost log and surfaces outlier runs and cache-reuse health (the 41.5M-token failure mode = low cache reuse + high cache writes). Use to answer "what is reflection costing me" for the last day / week.
development
Show fleet status — every claude session running on the host, merged across ainb + claude-peers broker + background jobs. Use when you need to enumerate sessions before composing an action, see which sessions have a peer registered (broker-routable) vs tmux-only, check the `summary` of each session, or pipe the list into jq for filtering. Default output: text table. Pass --format json for LLM consumption.
testing
Ordered multi-step prompts to fleet targets, ack-gated between steps via JSONL assistant-turn-end detection. Use for cycles like disconnect→reconnect→verify, or any flow where step N+1 requires step N to have completed first. The skill BLOCKS until each target's transcript shows the next assistant turn finishing OR per-step timeout fires (default 300s).
development
Center control panel — enumerate every claude session that is blocked waiting on something: a user answer (AskUserQuestion fired), an API error retry, an idle assistant turn-end with no follow-up, or an explicit WAITING: marker. Returns rich JSON with signal kind + context per session. Use this when you've stepped away from the fleet and want one place to see everything that wants your attention and answer it.