โ† Back to Security & Passwords
Security & Passwords by @jamesouttake

skill-guard

Scan ClawHub skills for security vulnerabilities

0
Source Code

skill-guard

The only pre-install security gate for ClawHub skills.

Why skill-guard?

VirusTotal (ClawHub built-in) skillscanner (Gen Digital) skill-guard
When it runs After publish (server-side) On-demand lookup Before install (client-side)
What it checks Malware signatures Their database Actual skill content
Prompt injections โŒ โŒ โœ…
Data exfiltration URLs โŒ โŒ โœ…
Hidden instructions โŒ โŒ โœ…
AI-specific threats โŒ โŒ โœ…
Install blocking โŒ โŒ โœ…

VirusTotal catches known malware binaries โ€” but won't flag <!-- IGNORE PREVIOUS INSTRUCTIONS -->.

skillscanner checks if Gen Digital has reviewed it โ€” but can't scan new or updated skills.

skill-guard uses mcp-scan (Invariant Labs, acquired by Snyk) to analyze what's actually in the skill, catches AI-specific threats, and blocks install if issues are found.

The Problem

Skills can contain:

  • ๐ŸŽญ Prompt injections โ€” hidden "ignore previous instructions" attacks
  • ๐Ÿ’€ Malware payloads โ€” dangerous commands disguised in natural language
  • ๐Ÿ”‘ Hardcoded secrets โ€” API keys, tokens in plain text
  • ๐Ÿ“ค Data exfiltration โ€” URLs that leak your conversations, memory, files
  • โ›“๏ธ Toxic flows โ€” instructions that chain into harmful actions

One bad skill = compromised agent. Your agent trusts skills implicitly.

The Solution

# Instead of: clawhub install some-skill
./scripts/safe-install.sh some-skill

skill-guard:

  1. Downloads to staging (/tmp/) โ€” never touches your real skills folder
  2. Scans with mcp-scan โ€” Invariant/Snyk's security scanner for AI agents
  3. Blocks or installs โ€” clean skills get installed, threats get quarantined

What It Catches

Real example โ€” skill-guard flagged this malicious skill:

โ— [E004]: Prompt injection detected (high risk)
โ— [E006]: Malicious code pattern detected  
โ— [W007]: Insecure credential handling
โ— [W008]: Machine state compromise attempt
โ— [W011]: Third-party content exposure

VirusTotal: 0/76 engines. mcp-scan caught what antivirus missed.

Usage

# Secure install (recommended)
./scripts/safe-install.sh <skill-slug>

# With version
./scripts/safe-install.sh <skill-slug> --version 1.2.3

# Force overwrite
./scripts/safe-install.sh <skill-slug> --force

Exit Codes

Code Meaning Action
0 Clean Skill installed โœ“
1 Error Check dependencies/network
2 Threats found Skill quarantined in /tmp/, review before deciding

When Threats Are Found

Skill stays in /tmp/skill-guard-staging/skills/<slug>/ (quarantined). You can:

  1. Review โ€” read the scan output, inspect the files
  2. Install anyway โ€” mv /tmp/skill-guard-staging/skills/<slug> ~/.openclaw/workspace/skills/
  3. Discard โ€” rm -rf /tmp/skill-guard-staging/

Requirements

  • clawhub CLI โ€” npm i -g clawhub
  • uv โ€” curl -LsSf https://astral.sh/uv/install.sh | sh

Why This Matters

Your agent has access to your files, messages, maybe your whole machine. One malicious skill can:

  • Read your secrets and send them elsewhere
  • Modify your agent's behavior permanently
  • Use your identity to spread to other systems

Trust, but verify. Scan before you install.