claw-shield is a production-ready OpenClaw security scanner for skills downloaded from ClawHub or other untrusted sources. It parses JavaScript with Babel, applies an extensible pattern registry, analyzes SKILL.md, and produces a terminal safety report with a bounded risk score.
npm installnpx claw-shield scan ./path-to-skillOptional JSON output:
npx claw-shield scan ./path-to-skill --jsoncritical: +40 pointshigh: +20 pointsmedium: +10 pointslow: +5 points
Scores cap at 100 and map to:
SAFE:0-10SUSPICIOUS:11-49DANGEROUS:50-79CRITICAL:80-100
Recommendations map to:
SAFE:INSTALLSUSPICIOUS:INSTALL WITH CAUTIONDANGEROUSorCRITICAL:DO NOT INSTALL
The scanner detects:
- Dynamic
eval,new Function, base64 staging, executable string assembly, and escape-heavy strings - External
fetch,axios,http,https,XMLHttpRequest,WebSocket, and DNS activity - Environment harvesting plus env-to-network flows
child_process,vm, dynamicrequire(), and suspicious filesystem access- Prototype pollution
SKILL.mdpermission mismatches, suspicious metadata requirements, and homepage/domain mismatch
npm testThe Jest suite covers malicious, clean, and suspicious fixtures, targeted rule validation, report formatting, and false-positive guards against popular npm packages.