Skip to content

PhilipKarns/clawdefend-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

clawdefend-scanner

Open source security scanner for OpenClaw AI skills.

This is the core scanning engine that powers ClawDefend — the security analysis platform for the OpenClaw ecosystem.

What It Does

Scans OpenClaw AI skills (from ClawHub or GitHub) for security vulnerabilities:

  • Static analysis — 15+ rules across SSRF, command injection, credential exposure, path traversal, eval/exec abuse, suspicious URLs, and more
  • LLM analysis — GPT-4o intent analysis to catch obfuscated or context-dependent risks
  • Scoring — Letter-grade scoring (A–F) with severity levels (Clean / Low / Medium / High / Critical)
  • Binary detection — Flags compiled binaries, caps score at C (70) when present
  • ClawHub integration — Fetches and scans skills directly from clawhub.ai
  • GitHub integration — Scans skills from any public GitHub repo

Files

File Purpose
src/static-analysis.ts 15+ static rules engine — pattern matching, AST-style checks
src/llm-analysis.ts GPT-4o intent analysis for subtle/obfuscated risks
src/scoring.ts Score calculation, letter grades, severity thresholds
src/clawhub.ts ClawHub URL parsing, ZIP download, binary detection
src/github.ts GitHub repo file fetching
src/index.ts Pipeline orchestration and exports

Usage

This is a TypeScript library. The full ClawDefend platform (web dashboard, API, auth, billing) is at clawdefend.com.

import { fetchClawHubFiles, runStaticAnalysis, runLLMAnalysis, calculateScore } from "./src";

// Scan a ClawHub skill
const { files, binaryFiles } = await fetchClawHubFiles("https://clawhub.ai/author/skill-name");

// Run static rules
const staticFindings = runStaticAnalysis(files);

// Run LLM analysis (requires OPENAI_API_KEY)
const llmResult = await runLLMAnalysis(files);

// Merge and score
const allFindings = [...staticFindings, ...llmResult.findings];
const { overallScore, severity } = calculateScore(allFindings, {
  binaryFiles: binaryFiles.map(b => b.path)
});

console.log(`Score: ${overallScore}/100 (${severity})`);

Requirements

  • Node.js 18+
  • OPENAI_API_KEY env var (for LLM analysis)
  • Optional: GITHUB_TOKEN for higher GitHub API rate limits

Dependencies

  • fflate — ZIP extraction
  • openai — LLM analysis

Stats

Built from scanning 851+ OpenClaw skills. Found vulnerabilities in 70%+ of scanned skills.

License

MIT — use it, fork it, improve it.

Related

  • ClawDefend — Full platform with dashboard, monitoring, and alerts
  • ClawHub — The OpenClaw skill marketplace

About

Open source security scanner for OpenClaw AI skills — powers ClawDefend.com

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors