Supporting files are included at skill-relative paths. See UPSTREAM-NOTICE.md for their pinned sources, licenses, hashes, and import changes.
Scan agent skills for security issues before adoption. Detects prompt injection, malicious code, excessive permissions, secret exposure, and supply chain risks.
Resolve this installed skill directory explicitly. Run the bundled helper with an already reviewed Python environment containing PyYAML; no repository-root working directory or implicit dependency download is required.
scripts/scan_skill.pyStatic analysis scanner that detects deterministic patterns. Outputs structured JSON (skill-scanner.locators.v2). It reports fixed finding descriptions, local file/line locators, counts, recognized tools and metadata field presence/types. It omits raw metadata values, source excerpts, decoded payloads, commands, symlink targets and complete URLs. Inspect those privately at the reported location. Relative filenames, the selected directory identifier and URL hostnames remain visible identifiers; the report is not an anonymizer for sensitive names. Unsupported inputs remain incomplete, not safe.
python3 "<installed-skill-dir>/scripts/scan_skill.py" "<authorized-inert-skill-directory>"
Returns JSON with findings, URL host/line locators, structure info, and severity counts. The script catches patterns mechanically — your job is to evaluate intent and filter false positives.
Use a private inert snapshot: this helper is static inspection, not an execution sandbox. It refuses final symlinks/non-regular files and bounds a file to 1 MiB, a tree to 1,000 files / 16 MiB. Hosts without guarded no-follow file opens report incomplete rather than silently following links. Nested regular text files are included; binary/unreadable inputs remain explicit coverage gaps. A scan error or incomplete coverage exits nonzero, not a clean pass.
Source payloads are omitted from the report rather than relying on recognition of every secret format. Visible filenames and hostnames can still be confidential identifiers; inspect reports locally before sharing. No target script, lifecycle hook, test or external URL is executed. Domain familiarity and lexical overlap do not satisfy semantic review or merge authority.
Determine the scan target:
plugins/*/skills/<name>/ or .claude/skills/<name>/
*/SKILL.md files and scan eachValidate the target contains a SKILL.md file. List the skill structure:
ls -la <skill-directory>/
ls <skill-directory>/references/ 2>/dev/null
ls <skill-directory>/scripts/ 2>/dev/null
Run the bundled scanner:
python3 "<installed-skill-dir>/scripts/scan_skill.py" "<authorized-inert-skill-directory>"
Parse the JSON output. The script produces findings with severity levels, URL analysis, and structure information. Use these as leads for deeper analysis.
Fallback: If the script fails, proceed with manual analysis using Grep patterns from the reference files.
Read the SKILL.md and check:
name and description must be presentname field should match the directory nameallowed-tools — is Bash justified? Are tools unrestricted (*)?Load the installed skill's references/prompt-injection-patterns.md for context.
Review scanner findings in the "Prompt Injection" category. For each finding:
Critical distinction: A security review skill that lists injection patterns in its references is documenting threats, not attacking. Only flag patterns that would execute against the agent running the skill.
This phase is agent-only — no pattern matching. Read the full SKILL.md instructions and evaluate:
Description vs. instructions alignment:
Config/memory poisoning:
CLAUDE.md, MEMORY.md, settings.json, .mcp.json, or hook configurations~/.claude/ or any agent configuration directoryScope creep:
Information gathering:
If the skill has a scripts/ directory:
references/dangerous-code-patterns.md for contextdependencies — are they legitimate, well-known packages?Legitimate patterns: gh CLI calls, git commands, reading project files, JSON output to stdout are normal for skill scripts.
Review URL domains and file/line locators from the scanner output; inspect complete URLs locally in the source:
Load the installed skill's references/permission-analysis.md for the tool risk matrix.
Evaluate:
Example assessments:
Read Grep Glob — Low risk, read-only analysis skillRead Grep Glob Bash — Medium risk, needs Bash justification (e.g., running bundled scripts)Read Grep Glob Bash Write Edit WebFetch Task — High risk, near-full access| Level | Criteria | Action |
|---|---|---|
| HIGH | Pattern confirmed + malicious intent evident | Report with severity |
| MEDIUM | Suspicious pattern, intent unclear | Note as "Needs verification" |
| LOW | Theoretical, best practice only | Do not report |
False positive awareness is critical. The biggest risk is flagging legitimate security skills as malicious because they reference attack patterns. Always evaluate intent before reporting.
## Skill Security Scan: [Skill Name]
### Summary
- **Findings**: X (Y Critical, Z High, ...)
- **Risk Level**: Critical / High / Medium / Low / No pattern matches
- **Skill Structure**: SKILL.md only / +references / +scripts / full
### Findings
#### [SKILL-SEC-001] [Finding Type] (Severity)
- **Location**: `SKILL.md:42` or `scripts/tool.py:15`
- **Confidence**: High
- **Category**: Prompt Injection / Malicious Code / Excessive Permissions / Secret Exposure / Supply Chain / Validation
- **Issue**: [What was found]
- **Evidence**: [local file/line and matched pattern; omit secret-bearing source snippets]
- **Risk**: [What could happen]
- **Remediation**: [How to fix]
### Needs Verification
[Medium-confidence items needing human review]
### Assessment
[Scoped review recommendation / More evidence required / Do not adopt]
[Brief justification for the assessment]
Risk level determination:
| File | Purpose |
|---|---|
references/prompt-injection-patterns.md |
Injection patterns, jailbreaks, obfuscation techniques, false positive guide |
references/dangerous-code-patterns.md |
Script security patterns: exfiltration, shells, credential theft, eval/exec |
references/permission-analysis.md |
Tool risk tiers, least privilege methodology, common skill permission profiles |