| name | ecc-agentshield |
| description | Security scanner cho Claude Code config — quét CLAUDE.md, settings.json, hooks, MCP servers, agents tìm lỗ hổng bảo mật. 1282 tests, 102 static analysis rules. |
| origin | ECC |
| user-invocable | true |
AgentShield — Security Scanner cho Agent Config
Audit Claude Code configuration cho vulnerabilities, misconfigurations, và injection risks.
Khi nào dùng
- Setup project mới với Claude Code
- Sau khi sửa
.claude/settings.json, CLAUDE.md, hoặc MCP configs
- Trước khi commit config changes
- Security hygiene định kỳ
Cài đặt
npm install -g ecc-agentshield
npx ecc-agentshield --version
Scan cơ bản
npx ecc-agentshield scan
npx ecc-agentshield scan --path /path/to/.claude
npx ecc-agentshield scan --min-severity medium
Output formats
npx ecc-agentshield scan
npx ecc-agentshield scan --format json
npx ecc-agentshield scan --format markdown
npx ecc-agentshield scan --format html > report.html
Auto-fix
npx ecc-agentshield scan --fix
Deep analysis (Opus 4.6)
export ANTHROPIC_API_KEY=your-key
npx ecc-agentshield scan --opus --stream
Những gì được scan
| File | Checks |
|---|
CLAUDE.md | Hardcoded secrets, auto-run, prompt injection |
settings.json | Overly permissive allow lists, missing deny lists |
mcp.json | Risky MCP servers, hardcoded env secrets, npx supply chain |
hooks/ | Command injection via interpolation, data exfiltration |
agents/*.md | Unrestricted tool access, missing model specs |
Grade scale
| Grade | Score | Ý nghĩa |
|---|
| A | 90-100 | Secure |
| B | 75-89 | Minor issues |
| C | 60-74 | Needs attention |
| D | 40-59 | Significant risks |
| F | 0-39 | Critical vulnerabilities |
GitHub Action
- uses: affaan-m/agentshield@v1
with:
path: '.'
min-severity: 'medium'
fail-on-findings: true
Lỗi nghiêm trọng (fix ngay)
- Hardcoded API keys trong config files
Bash(*) trong allow list (unrestricted shell)
- Command injection trong hooks qua
${file} interpolation
- Shell-running MCP servers
Source
https://github.com/affaan-m/agentshield · npm: ecc-agentshield