Pre-publication scanning for AI agent skills. YARA-like pattern matching, CNN code classification, Shannon entropy analysis, and obfuscation detection. The only zero-day scanner for the OpenClaw ecosystem.
18 YARA-like signatures covering the ClawHavoc campaign, credential theft, base64 payloads, eval injection, shell execution, Discord/Pastebin exfiltration, and supply chain attacks. Each signature is a pre-compiled regex with severity classification. Weight: 40% of composite score.
Shannon entropy calculation per line and overall. Normal code: ~4.0-4.5 bits/char. Obfuscated payloads: >5.5 bits/char. Lines exceeding threshold are flagged individually. High-entropy line ratio boosts the normalized score. Weight: 15% of composite score.
1D convolutional neural network on character-level input. Embedding(128,64) for ASCII, two Conv1d layers (128 and 64 filters), global max pooling, and a sigmoid output. Pre-trained weights seeded from known malicious byte n-grams. Weight: 25% of composite score.
Measures variable name entropy (random names = obfuscation), string concatenation chains (splitting to evade matching), hex/octal/unicode escape sequences, and non-alphanumeric character ratios. Catches evasion techniques that bypass pattern-only scanners. Weight: 20% of composite score.
// Request { "skill_content": "import os\nos.system('curl ...')", "skill_name": "suspicious_skill", "metadata": { "author": "unknown", "version": "1.0" } } // Response { "skill_name": "suspicious_skill", "risk_score": 0.72, "risk_level": "high", "threats_found": [ { "pattern_name": "SUBPROCESS_SHELL", "severity": "high", "description": "Shell command execution detected.", "line_number": 2, "matched_text": "os.system('curl ...')" } ], "entropy_score": 0.31, "obfuscation_score": 0.12, "cnn_score": 0.68, "pattern_match_score": 0.20, "model_version": "shieldclaw-cnn-char-v1" }
// Request { "skills": [ { "skill_content": "...", "skill_name": "skill_a" }, { "skill_content": "...", "skill_name": "skill_b" } ] } // Response { "total_scanned": 2, "total_threats": 5, "critical_count": 2, "high_count": 3, "results": [/* array of ScanResponse */] }
// Request { "content": "import clawdhub1; clawdhub1.activate()", "signature_names": ["MALICIOUS_PACKAGE", "CLAWHAVOC_ENV_THEFT"] } // Response { "matches": [ { "pattern_name": "MALICIOUS_PACKAGE", "severity": "critical", "matched_text": "clawdhub1", "line_number": 1 } ], "signatures_checked": 2 }
curl -X POST http://localhost:8000/scan/skill \
-H "Content-Type: application/json" \
-d '{
"skill_content": "import os; os.system(\"rm -rf /\")",
"skill_name": "test_skill"
}'