How openclaw/clawscan works
ClawScan is a composable security-scanning harness for agent skills and OpenClaw plugins. Its main workflow accepts a target and scanner/profile selection, resolves configuration, scans the target with selected adapters, optionally judges the collected evidence, then emits an artifact and gate outcome. Separate branches provide benchmark runs and submission validation, profile discovery, dependency installation, and an OpenClaw install-policy decision. The graph follows the documented capabilities and source-index references; links to unsampled runner internals are left unverified rather than inferred as direct calls.
Main entry points: runner.go Scan orchestrator · main.go ClawScan CLI · resolver.go Run resolver · policy.go Install policy
Components 22
CLI and profiles
- Node launcher
npm/clawscan/bin/clawscan.js - ClawScan CLI
cmd/clawscan/main.go - Run resolver
internal/profiles/resolver.go - Profile catalog
internal/profiles/registry.go - Profile YAML
internal/profiles/yaml.go
Scan execution
- Scan orchestrator
internal/runner/runner.go - Target handling
internal/runner/target.go - Target content
internal/runner/target_content.go - Scanner catalog
internal/runner/scanner_registry.go - Scanner adapters
internal/runner - Command sandbox
internal/runner/sandbox.go
Evaluation and results
- Judge harness
internal/runner/runner.go - Run artifact
internal/runner/runner.go - Benchmark runs
internal/runner/benchmark_registry.go - Submission validation
internal/runner/submission.go - Leaderboard app
leaderboard/space/app.py
Host integrations
- Install planning
internal/runner/install.go - Install policy
internal/installpolicy/policy.go - Policy stages
internal/installpolicy/stages.go - ClawHub prompt
internal/clawhubprompt/prompt.go - Prompt parity check
cmd/verify-clawhub-prompt/main.go
Other components
- Operator
Connections 26
- Operator → Node launcher: launches
README.md - Operator → ClawScan CLI: runs
README.md - Node launcher → ClawScan CLI: spawns binary
npm/clawscan/bin/clawscan.js - ClawScan CLI → Run resolver: resolves options
cmd/clawscan/main.go - ClawScan CLI → Scan orchestrator: runs scans
cmd/clawscan/main.go - ClawScan CLI → Install policy: handles policy
cmd/clawscan/main.go - ClawScan CLI → Profile catalog: lists profiles
cmd/clawscan/main.go - Run resolver → Profile catalog: loads profiles
- Run resolver → Profile YAML: parses config
- Run resolver → Scan orchestrator: builds run options
internal/profiles/resolver.go - Profile catalog → Scanner catalog: validates scanner IDs
internal/profiles/registry.go - Scan orchestrator → Target handling: resolves target
- Target handling → Target content: reads content
- Scan orchestrator → Scanner catalog: selects adapters
- Scan orchestrator → Scanner adapters: dispatches scans
- Scanner adapters → Command sandbox: runs commands
- Scan orchestrator → Judge harness: invokes judge
internal/runner/runner.go - Scan orchestrator → Run artifact: writes results
internal/runner/runner.go - Scan orchestrator → Benchmark runs: runs benchmark
- ClawScan CLI → Submission validation: validates submission
- Submission validation → Leaderboard app: supplies metrics
- ClawScan CLI → Install planning: installs dependencies
- Install policy → Scan orchestrator: scans staged target
internal/installpolicy/policy.go - Install policy → Policy stages: uses policy stages
- Scan orchestrator → ClawHub prompt: renders prompt
internal/runner/runner.go - Prompt parity check → Scan orchestrator: builds comparison artifact
cmd/verify-clawhub-prompt/main.go