skills-security-audit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill Security Audit
AI Agent技能安全审计
Overview
概述
Scan and audit AI agent skills, plugins, and tool definitions for security vulnerabilities across nine risk categories aligned with the OWASP Agentic AI Top 10 (ASI01 through ASI10). This skill works cross-platform with Claude Code, OpenClaw, and any AI agent platform that uses file-based skill definitions. Rather than relying on brittle regex patterns, it performs AI-powered semantic analysis to detect prompt injection, data exfiltration, obfuscated code, privilege escalation, supply chain attacks, memory poisoning, trust boundary violations, and behavioral manipulation. Each audit produces a structured risk report with severity ratings, evidence citations, and actionable remediation guidance.
针对AI Agent技能、插件和工具定义进行扫描与审计,排查符合OWASP Agentic AI Top 10(ASI01至ASI10)标准的九类安全漏洞。该技能跨平台兼容Claude Code、OpenClaw及所有采用文件型技能定义的AI Agent平台。它不依赖脆弱的正则表达式,而是通过AI驱动的语义分析来检测Prompt Injection、Data Exfiltration、混淆代码、权限提升、供应链攻击、Memory Poisoning、信任边界违规和Behavioral Manipulation。每次审计都会生成结构化风险报告,包含严重程度评级、证据引用和可执行的修复指导。
When to Use
使用场景
- Before installing any third-party skill or plugin from a marketplace
- When reviewing skills downloaded from OpenClaw, ClawHub, or other registries
- Periodic audit of all installed skills and plugins
- When a skill requests unusual permissions or behaves unexpectedly
- 从市场安装任何第三方技能或插件之前
- 审核从OpenClaw、ClawHub或其他注册表下载的技能时
- 定期审计所有已安装的技能和插件
- 当技能请求异常权限或行为异常时
Security Check Categories
安全检查类别
| ID | Category | Severity | OWASP ASI |
|---|---|---|---|
| PI | Prompt Injection | CRITICAL | ASI01 |
| DE | Data Exfiltration | CRITICAL | ASI02 |
| CE | Malicious Command Execution | CRITICAL | ASI02, ASI05 |
| OB | Obfuscated/Hidden Code | WARNING | — |
| PA | Privilege Over-Request | WARNING | ASI03 |
| SC | Supply Chain Risks | WARNING | ASI04 |
| MP | Memory/Context Poisoning | WARNING | ASI06 |
| TE | Human Trust Exploitation | WARNING | ASI09 |
| BM | Behavioral Manipulation | INFO | ASI10 |
Load(relative to this file's directory) for detailed detection patterns, examples, and false positive guidance.references/security-rules.md
| ID | 类别 | 严重程度 | OWASP ASI |
|---|---|---|---|
| PI | Prompt Injection | CRITICAL | ASI01 |
| DE | Data Exfiltration | CRITICAL | ASI02 |
| CE | 恶意命令执行 | CRITICAL | ASI02, ASI05 |
| OB | 混淆/隐藏代码 | WARNING | — |
| PA | 过度请求权限 | WARNING | ASI03 |
| SC | 供应链风险 | WARNING | ASI04 |
| MP | Memory/Context Poisoning | WARNING | ASI06 |
| TE | 人类信任利用 | WARNING | ASI09 |
| BM | Behavioral Manipulation | INFO | ASI10 |
加载(相对于本文件的目录)以获取详细检测模式、示例和误报处理指南。references/security-rules.md
Audit Workflow
审计流程
Phase 1: Determine Scan Scope
阶段1:确定扫描范围
- If user specifies a directory path, scan all files in that directory recursively.
- If user says "scan installed", scan platform-specific skill directories:
- Claude Code:
~/.claude/plugins/cache/ - Cursor: and project
~/.cursor/extensions/.cursorrules - Windsurf:
~/.codeium/windsurf/ - Other platforms: ask user for the directory path.
- Claude Code:
- If user provides a GitHub URL, use WebFetch to retrieve the repository content, or clone it locally.
- Scan these file types: ,
.md,.json,.js,.py,.sh,.ts,.yaml.yml - List all files found and confirm with user before proceeding.
Important: Do NOT dispatch this audit to a subagent (Task tool). Subagents run in a sandboxed environment that cannot reador other system directories. Always run the audit in the main conversation context.~/.claude/plugins/cache/
- 如果用户指定目录路径,递归扫描该目录下的所有文件。
- 如果用户说“扫描已安装项”,扫描平台特定的技能目录:
- Claude Code:
~/.claude/plugins/cache/ - Cursor: 和项目
~/.cursor/extensions/.cursorrules - Windsurf:
~/.codeium/windsurf/ - 其他平台:询问用户目录路径。
- Claude Code:
- 如果用户提供GitHub URL,使用WebFetch获取仓库内容,或本地克隆。
- 扫描以下文件类型:,
.md,.json,.js,.py,.sh,.ts,.yaml.yml - 列出所有找到的文件,在继续前与用户确认。
重要提示:请勿将此审计任务分派给子Agent(Task工具)。 子Agent运行在沙箱环境中,无法读取或其他系统目录。请始终在主对话环境中运行审计。~/.claude/plugins/cache/
Phase 2: Analyze Each File
阶段2:分析每个文件
- Load (relative to this file's directory) for detailed detection patterns.
references/security-rules.md - Read each file using the Read tool.
- Check file content against all 9 categories (PI, DE, CE, OB, PA, SC, MP, TE, BM).
- For each finding, record: rule ID (e.g., PI-001), severity, file path and line number, description, and recommended action.
- Apply context-aware judgment — not every pattern match is a true positive.
- When a single code block triggers multiple rules, report each applicable rule separately. Cross-category overlap (e.g., OB + CE + PI on the same line) increases confidence that the finding is a true positive.
- Consider the skill's stated purpose when evaluating findings. A security auditing skill will naturally reference dangerous patterns.
- 加载(相对于本文件的目录)以获取详细检测模式。
references/security-rules.md - 使用Read工具读取每个文件。
- 检查文件内容是否符合所有9个类别(PI、DE、CE、OB、PA、SC、MP、TE、BM)。
- 对于每个发现,记录:规则ID(如PI-001)、严重程度、文件路径和行号、描述以及建议操作。
- 应用上下文感知判断——并非每个模式匹配都是真阳性。
- 当单个代码块触发多个规则时,分别报告每个适用规则。跨类别重叠(如同一行同时触发OB + CE + PI)会增加发现为真阳性的可信度。
- 评估发现时需考虑技能的声明用途。安全审计技能自然会引用危险模式,这并非恶意。
Phase 3: Generate Report
阶段3:生成报告
- Calculate risk score using the scoring formula below.
- Output the structured report using the template below.
- For batch scans of multiple skills, output a summary table at the end.
- 使用以下评分公式计算风险分数。
- 使用以下模板输出结构化报告。
- 对于多个技能的批量扫描,在末尾输出汇总表格。
Report Format
报告格式
Single Skill Report
单个技能报告
When auditing one skill, output this full report:
undefined审计单个技能时,输出完整报告:
undefinedSkill Security Audit Report
技能安全审计报告
Target: [skill-name] [version if available]
目标:[技能名称] [版本(如有)]
Risk Score: X.X/10 ([LEVEL])
风险分数:X.X/10 ([等级])
CRITICAL
CRITICAL(严重)
- [PI-001] file.md:42 — Description of finding Risk: Why this is dangerous Action: Recommended response
- [PI-001] file.md:42 — 发现描述 风险:为何存在危险 操作:建议响应
WARNING
WARNING(警告)
- [OB-003] script.js:15 — Description of finding Risk: Why this is concerning Action: Recommended response
- [OB-003] script.js:15 — 发现描述 风险:为何值得关注 操作:建议响应
INFO
INFO(信息)
- [BM-002] SKILL.md:88 — Description of finding Risk: Why this is worth noting Action: Recommended response
- [BM-002] SKILL.md:88 — 发现描述 风险:为何值得注意 操作:建议响应
Summary
总结
- CRITICAL: N | WARNING: N | INFO: N
- Risk Score: X.X/10 — [Overall recommendation]
undefined- CRITICAL:N | WARNING:N | INFO:N
- 风险分数:X.X/10 — [总体建议]
undefinedBatch Scan Report
批量扫描报告
When scanning multiple skills, use this compact format. Start with the summary dashboard, then show only skills with findings:
undefined扫描多个技能时,使用紧凑格式。先显示汇总仪表板,然后仅展示有发现的技能:
undefinedSkill Security Audit — Batch Report
技能安全审计 — 批量报告
Dashboard
仪表板
| # | Skill | Score | Level | C | W | I | Top Finding |
|---|---|---|---|---|---|---|---|
| 1 | skill-a | 0.0 | ✅ SAFE | 0 | 0 | 0 | — |
| 2 | skill-b | 2.4 | ⚠️ RISKY | 0 | 3 | 0 | [PA-001] Blanket permission grant |
| 3 | skill-c | 6.0 | 🔴 DANGEROUS | 2 | 1 | 1 | [DE-001] Reads ~/.ssh/id_rsa |
| 4 | skill-d | 8.2 | 🟣 MALICIOUS | 3 | 2 | 0 | [CE-003] curl |
Scanned: 4 skills | Clean: 1 | Needs review: 3
| # | 技能 | 分数 | 等级 | C | W | I | 首要发现 |
|---|---|---|---|---|---|---|---|
| 1 | skill-a | 0.0 | ✅ 安全 | 0 | 0 | 0 | — |
| 2 | skill-b | 2.4 | ⚠️ 风险 | 0 | 3 | 0 | [PA-001] Blanket permission grant |
| 3 | skill-c | 6.0 | 🔴 危险 | 2 | 1 | 1 | [DE-001] 读取~/.ssh/id_rsa |
| 4 | skill-d | 8.2 | 🟣 恶意 | 3 | 2 | 0 | [CE-003] curl |
已扫描:4个技能 | 无风险:1 | 需要审核:3
#3 skill-c — 6.0/10 🔴 DANGEROUS
#3 skill-c — 6.0/10 🔴 危险
| Rule | File:Line | Finding | Action |
|---|---|---|---|
| [DE-001] CRITICAL | lib/init.sh:14 | Reads | Remove sensitive file access |
| [DE-004] CRITICAL | lib/init.sh:15 | POSTs to external URL | Remove HTTP exfiltration |
| [OB-007] WARNING | lib/init.sh:13 | Comment says "setup" but code exfiltrates | Rewrite or remove |
| [BM-003] INFO | lib/init.sh:16 | Suppresses stderr output | Review necessity |
| 规则 | 文件:行号 | 发现 | 操作 |
|---|---|---|---|
| [DE-001] CRITICAL | lib/init.sh:14 | 读取 | 移除敏感文件访问权限 |
| [DE-004] CRITICAL | lib/init.sh:15 | 向外部URL发送POST请求 | 移除HTTP数据泄露操作 |
| [OB-007] WARNING | lib/init.sh:13 | 注释为“setup”但代码执行数据泄露 | 重写或移除 |
| [BM-003] INFO | lib/init.sh:16 | 抑制stderr输出 | 审核必要性 |
#4 skill-d — 8.2/10 🟣 MALICIOUS
#4 skill-d — 8.2/10 🟣 恶意
...
**Batch format rules:**
- Dashboard table always comes first — gives the user an instant overview.
- Only expand details for skills scoring above 0.0 (skip SAFE skills).
- Use a compact table per skill instead of nested bullet lists.
- Use emoji indicators in the Level column: ✅ SAFE, ⚠️ RISKY, 🔴 DANGEROUS, 🟣 MALICIOUS.
- Show the single most important finding in the "Top Finding" column of the dashboard....
**批量格式规则:**
- 仪表板表格始终放在最前面——让用户快速了解整体情况。
- 仅展开分数高于0.0的技能详情(跳过SAFE技能)。
- 每个技能使用紧凑表格而非嵌套项目符号列表。
- 等级列使用表情符号标识:✅ SAFE(安全)、⚠️ RISKY(风险)、🔴 DANGEROUS(危险)、🟣 MALICIOUS(恶意)。
- 在仪表板的“首要发现”列显示单个最重要的发现。Scoring
评分规则
Calculate risk score:
- Each CRITICAL finding: +2.0 points
- Each WARNING finding: +0.8 points
- Each INFO finding: +0.2 points
- Maximum score: 10.0
Risk levels:
- 0.0–2.0: SAFE — No significant risks found.
- 2.1–5.0: RISKY — Manual review recommended before use.
- 5.1–8.0: DANGEROUS — Do not install.
- 8.1–10.0: MALICIOUS — Confirmed malicious intent. Report to marketplace.
风险分数计算:
- 每个CRITICAL发现:+2.0分
- 每个WARNING发现:+0.8分
- 每个INFO发现:+0.2分
- 最高分:10.0
风险等级:
- 0.0–2.0: SAFE(安全) — 未发现重大风险。
- 2.1–5.0: RISKY(风险) — 使用前建议手动审核。
- 5.1–8.0: DANGEROUS(危险) — 请勿安装。
- 8.1–10.0: MALICIOUS(恶意) — 确认存在恶意意图。向市场举报。
False Positive Guidance
误报处理指南
- Consider the skill's legitimate purpose before flagging.
- A security auditing skill will naturally reference dangerous patterns — this is not malicious.
- Development tools may legitimately need Bash access.
- Look for intent, not just pattern presence.
- When uncertain, report the finding with a note explaining the ambiguity.
- 标记前考虑技能的合法用途。
- 安全审计技能自然会引用危险模式——这并非恶意。
- 开发工具可能合法需要Bash访问权限。
- 关注意图,而非仅模式存在。
- 不确定时,报告发现并附上说明歧义的注释。