π¦ ClawHub
Skill Defender
by @itsclawdbro
Scans installed OpenClaw skills for malicious patterns including prompt injection, credential theft, data exfiltration, obfuscated payloads, and backdoors. Use when installing new skills, after skill updates, or for periodic security scans. Runs deterministic pattern matching β fast, offline, no API cost.
TERMINAL
clawhub install skill-defenderπ About This Skill
name: skill-defender description: Scans installed OpenClaw skills for malicious patterns including prompt injection, credential theft, data exfiltration, obfuscated payloads, and backdoors. Use when installing new skills, after skill updates, or for periodic security scans. Runs deterministic pattern matching β fast, offline, no API cost.
Skill Defender β Malicious Pattern Scanner
When to Run
Automatic Triggers
1. New skill installed β Immediately runscan_skill.py against it before allowing use
2. Skill updated β Re-scan after any file changes in a skill directory
3. Periodic audit β Run batch scan on all installed skills when requestedManual Triggers
Scripts
scripts/scan_skill.py β Single Skill Scanner
Scans one skill directory for malicious patterns. Produces JSON or human-readable output.scripts/aggregate_scan.py β Batch Scanner
Scans ALL installed skills and produces a single JSON report. Includes a built-in allowlist to reduce false positives from security-related skills, API skills, and other known-safe patterns.How to Run
# Scan a single skill (human-readable)
python3 scripts/scan_skill.py /path/to/skill-dirScan a single skill (JSON output)
python3 scripts/scan_skill.py /path/to/skill-dir --jsonScan ALL installed skills (JSON aggregate report)
python3 scripts/aggregate_scan.pyWith custom skills directory
python3 scripts/aggregate_scan.py --skills-dir /path/to/skillsWith verbose warnings
python3 scripts/scan_skill.py /path/to/skill-dir --verboseExclude false positives
python3 scripts/scan_skill.py /path/to/skill-dir --exclude "pattern1" "pattern2"
Exit Codes (scan_skill.py)
0 = clean or informational only1 = suspicious (medium/high findings)2 = dangerous (critical findings)3 = errorOutput Format (aggregate_scan.py)
{
"skills": [
{
"name": "skill-name",
"verdict": "clean|suspicious|dangerous|error",
"findingsCount": 0,
"findings": []
}
],
"summary": "All 37 skills passed with no significant issues.",
"totalSkills": 37,
"cleanCount": 37,
"suspiciousCount": 0,
"dangerousCount": 0,
"errorCount": 0,
"timestamp": "2026-02-02T06:00:00+00:00"
}
Auto-Detection
Both scripts auto-detect paths:
skills/ parent), falls back to ~/clawd/skills, ~/skills, ~/.openclaw/skillsaggregate_scan.py finds scan_skill.py co-located in the same directoryHandling Results
β
Clean (verdict: "clean")
β οΈ Suspicious (verdict: "suspicious")
π¨ Dangerous (verdict: "dangerous")
Built-in Allowlist
The aggregate scanner includes an allowlist for known false positives:
Pattern Reference
See references/threat-patterns.md for full documentation of all detected patterns, organized by category with explanations of why each is dangerous.
Important Notes
--exclude flag help