扫描 Claude Code 配置中的安全漏洞、误配与注入风险并给出检查结果
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "security-scan" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/security-scan/SKILL.md 2. 保存为 ~/.claude/skills/security-scan/SKILL.md 3. 装好后重载技能,告诉我可以用了
请扫描我的 .claude/ 目录,检查 CLAUDE.md、settings.json、MCP servers、hooks 和 agent definitions 中的安全漏洞、错误配置与注入风险,并按严重级别列出问题和修复建议。
一份按严重程度排序的安全检查报告,包含风险说明、受影响文件和修复建议。
重点检查 .claude/ 配置中的 MCP servers 和 hooks,识别高权限命令、危险脚本调用、外部连接风险以及潜在的提示注入入口,并说明原因。
针对 MCP 与 hooks 的专项风险清单,附带原因分析和加固建议。
基于对 .claude/ 的扫描结果,帮我生成一个修复优先级清单:先修哪些高危问题、哪些可以延后,并给出每项的建议修改方向。
一份可执行的修复计划,包含优先级、处理顺序和对应整改方向。
Audit your Claude Code configuration for security issues using AgentShield.
.claude/settings.json, CLAUDE.md, or MCP configs| 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 |
AgentShield must be installed. 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 .
Run against the current project's .claude/ directory:
# Scan current project
npx ecc-agentshield scan
# Scan a specific path
npx ecc-agentshield scan --path /path/to/.claude
# Scan with minimum severity filter
npx ecc-agentshield scan --min-severity medium
# 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
Apply safe fixes automatically (only fixes marked as auto-fixable):
npx ecc-agentshield scan --fix
This will:
Run the adversarial three-agent pipeline for deeper analysis:
# Requires ANTHROPIC_API_KEY
export ANTHROPIC_API_KEY=your-key
npx ecc-agentshield scan --opus --stream
This runs:
Scaffold a new secure .claude/ configuration from scratch:
npx ecc-agentshield init
Creates:
settings.json with scoped permissions and deny listCLAUDE.md with security best practicesmcp.json placeholderAdd to your CI pipeline:
- uses: affaan-m/agentshield@v1
with:
path: '.'
min-severity: 'medium'
fail-on-findings: true
| 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 |
Bash(*) in the allow list (unrestricted shell access)${file} interpolation2>/dev/null, || true)npx -y auto-install in MCP server configs…
帮助团队编排多代理协作流程,管理任务归属、看板流转与交接控制。
帮助开发者掌握 Redis 生产级数据结构模式、缓存与并发控制方案
帮助开发者理解 Swift 6.2 并发模型变化与安全使用方式。
帮助开发团队设计与优化 Playwright 端到端测试、配置流水线并降低用例不稳定性。
快速查询基因组数据库并完成序列检索、富集分析与可复现生信记录
为 OpenClaw 定制完整龙虾灵魂设定,生成定位、人格规则、名称与头像提示词。
帮助开发者从兼容 MCP 的客户端扫描 AI 代理代码中的安全漏洞。
为 Claude Code 与 Cursor 增强端口扫描、漏洞检测与密钥审计等安全能力。
在安装前静态扫描 Claude Code 技能、插件或 MCP 服务的恶意风险
让 Claude Code 调用 OpenAI 模型进行代码审查、架构分析与安全审计,并自动生成报告。
帮助开发与运维团队检测提示注入、查询漏洞并评估版本受影响范围
为代码库执行多引擎安全审查,识别漏洞、密钥泄露与依赖风险并生成优先级报告