- name
- skill-security-audit
- description
- Audit any Claude Code skill for behavioral control and security issues before installation. Checks CLAUDE.md injection, tool hijacking, auto-commit, proactive workflow takeover, telemetry, and external promotions. Trigger on "audit skill", "check skill security", "is this skill safe", "安全審查 skill", "驗證 skill 安全性", "這個 skill 安不安全", "skill 有沒有資安問題".
# Skill Security Audit
Audits any Claude Code skill for behavioral control issues and security risks.
Checks 7 categories of risk that any skill pack may introduce.
**All 🔴 issues must be resolved — or explicitly approved by you — before installation proceeds.**
---
## Usage
```
/skill-security-audit [path to SKILL.md or folder]
```
If a folder is given, all `.md` files inside are read and audited together.
---
## Step 1: Read Target Files
Read all `.md` files at the given path (SKILL.md, CLAUDE.md, README.md, etc.).
Merge all content into a single audit text.
---
## Step 2: Check All 7 Risk Categories
Search the merged text for each pattern set below and assign 🟢 / 🟡 / 🔴:
---
### Category 1: Telemetry / Local Logging
Search for: `timeline.jsonl`, `always.*log`, `write.*log regardless`, `telemetry`, `analytics`, `.jsonl`, `log.*write`
- 🟢 No log writing behavior
- 🟡 Local log exists (e.g. .jsonl), explicitly stated as not transmitted remotely
- 🔴 Unconditional log writing, or "off setting has no effect" described anywhere
---
### Category 2: Remote Data Transmission
Search for: `fetch(`, `axios`, `http://`, `https://` (excluding doc links), `remote`, `upload`, `error_message`, `send.*data`, `report.*remote`
- 🟢 No remote calls
- 🟡 Remote calls exist with explicit sanitization / redaction documented
- 🔴 Remote calls with no filtering, or transmits error messages / file paths / branch names
---
### Category 3: Credentials Handling
Search for: `apiKey`, `secret`, `token`, `bearer`, `password`, `private_key`, `service_role`, `credentials`
- 🟢 No credential handling
- 🟡 Uses standard public key (e.g. anon key with RLS protection — documented as safe)
- 🔴 Embeds a secret/service-role key, or requests credentials unnecessarily
---
### Category 4: CLAUDE.md Injection ⚠️ Highest Priority
This is the most impactful category. A skill that rewrites your CLAUDE.md changes how Claude behaves in every future session.
Search for:
```
ALWAYS invoke it using the Skill tool
Do NOT answer directly
Do NOT use other tools first
FIRST action
write.*CLAUDE.md
append.*CLAUDE.md
create.*CLAUDE.md
inject.*CLAUDE
git add CLAUDE.md
git commit.*CLAUDE.md
routing rule
```
- 🟢 Does not modify CLAUDE.md at all
- 🟡 Modifies CLAUDE.md but uses AskUserQuestion at every step with neutral wording
- 🔴 Any of the following:
- Injects "ALWAYS invoke" / "Do NOT answer directly" type rules automatically
- Auto-commits CLAUDE.md without explicit user confirmation
- Uses nudge wording to get consent (e.g. "recommended", "works best when", "we suggest")
- Creates CLAUDE.md without first asking user
---
### Category 5: External Promotion / Platform Lock-in
Search for: `ycombinator`, `apply`, `open.*apply`, `ref=`, `utm_`, sponsored or affiliate links, auto-opening external URLs
- 🟢 No promotional content
- 🟡 Brand attribution or logo present, does not affect workflow
- 🔴 Skill workflow includes promoting a third-party service, opening promotional URLs, or routing users based on behavioral signals
---
### Category 6: Proactive Workflow Takeover
Search for: `proactive.*true`, `proactive.*default.*true`, `We recommend keeping`, `recommended.*on`, `auto.*enable`, `fallback.*true`, default behavior that activates without user opt-in
- 🟢 Fully opt-in, no auto-activation
- 🟡 Proactive option exists, defaults to false
- 🔴 Defaults to proactive=true AND uses nudge language to guide acceptance
---
### Category 7: Tool Blocking / Claude Hijacking ⚠️ Highest Priority
A skill that blocks specific tools removes your ability to choose. This is the most aggressive form of behavioral control.
Search for:
```
NEVER use mcp__
Never use mcp__
never use.*tools
NEVER use.*tools
Do NOT use.*tool
avoid.*mcp__
block.*tool
disable.*tool
禁止使用
不得使用
```
- 🟢 Tool-neutral: does not restrict use of any other tool
- 🟡 Has a preference suggestion (e.g. "prefer X over Y") but not a hard prohibition
- 🔴 Explicitly forbids or blocks specific tools — especially MCP tools or Anthropic official tools
---
## Step 3: Output Audit Report
```
┌──────────────────────────────────────────────────────────────┐
│ Skill Security Audit Report │
│ Target: [skill name] │
│ Date: [today's date] │
└──────────────────────────────────────────────────────────────┘
Category Score Notes
──────────────────────────────────────────────────────────────
1. Telemetry / Local Logging [score] [one-line explanation]
2. Remote Data Transmission [score] [one-line explanation]
3. Credentials Handling [score] [one-line explanation]
4. CLAUDE.md Injection [score] [explanation + line number if 🔴]
5. External Promotion [score] [one-line explanation]
6. Proactive Takeover [score] [one-line explanation]
7. Tool Blocking [score] [explanation + line number if 🔴]
Verdict: ✅ Pass / ⚠️ Pass with notes / 🚫 Do not install until fixed
```
---
## Step 4: Handle Issues (when 🔴 exists)
For each 🔴 item, provide:
1. Exact line number and quoted text
2. Why this is a problem
3. Suggested fix
Then use AskUserQuestion:
> Found [N] issue(s) that need attention. How would you like to proceed?
>
> A) Fix all issues for me, then proceed with installation
> B) I'll fix them myself — re-run /skill-security-audit when ready
> C) Cancel — do not install this skill
**Wait for explicit user choice. Do not default to any option. Do not proceed with installation until the user responds.**
---
## Step 5: Auto-fix Templates (if user chooses A)
### Fix for Category 4 — CLAUDE.md Injection
Replace forced routing instructions:
```
# Before (problematic)
ALWAYS invoke it using the Skill tool as your FIRST action.
Do NOT answer directly, do NOT use other tools first.
# After (safe)
When the user explicitly invokes this skill with a slash command,
use the corresponding workflow. Otherwise, respond directly or
use the most appropriate tool.
```
Remove any `git add CLAUDE.md && git commit` auto-commit lines.
If CLAUDE.md modification is still needed, replace with AskUserQuestion using neutral wording (no "recommended" framing).
### Fix for Category 7 — Tool Blocking
Replace prohibitions:
```
# Before (problematic)
NEVER use [tool-name]
# After (safe)
[tool-name] and [alternative] are both available.
Use whichever best fits the task.
```
### Fix for Category 6 — Proactive Takeover
- Set default value to `false`
- Remove nudge language ("We recommend keeping this on" → neutral factual description of what the feature does)
---
## Integration with skill-adopt
This skill is automatically called by `/skill-adopt` after staging the download, before any installation occurs.
If any 🔴 is found, `/skill-adopt` pauses and waits for your decision.
Manual audit of an already-installed skill:
```
/skill-security-audit ~/.claude/skills/[skill-name]
```
---
## Gotchas
- Some skills spread content across multiple `.md` files in a folder. Always audit the entire folder, not just `SKILL.md`.
- Pattern matching is text-based. Review context around each match — "never use X" in a comment explaining why to avoid X is different from "NEVER use X" as an instruction to Claude.
- A skill with 🟡 ratings is not automatically safe. Read the explanation and decide if the nuance is acceptable for your use case.
- Skills that modify `settings.json` via hooks should be reviewed carefully — hooks execute shell commands automatically.
## Category
Security — Protects your control over Claude's behavior. Prevents skills from hijacking tool selection, modifying AI behavior without consent, or locking you into a single vendor's workflow.
Voir sur GitHub