@denial-web/clawguard 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/.clawguard.example.json +16 -0
  2. package/LICENSE +21 -0
  3. package/README.md +241 -0
  4. package/SECURITY.md +33 -0
  5. package/action.yml +72 -0
  6. package/docs/ARCHITECTURE.md +312 -0
  7. package/docs/ARCHITECTURE_ROADMAP.md +267 -0
  8. package/docs/CLAWHUB_METADATA.md +57 -0
  9. package/docs/DEMO_CAPTURE.md +25 -0
  10. package/docs/DEMO_SCRIPT.md +87 -0
  11. package/docs/DEPENDENCY_SCANNING.md +61 -0
  12. package/docs/GITHUB_ACTION.md +56 -0
  13. package/docs/GITHUB_REPO_SETUP.md +76 -0
  14. package/docs/HTML_REPORTS.md +27 -0
  15. package/docs/INTEGRATION_SPEC.md +253 -0
  16. package/docs/LAUNCH_CHECKLIST.md +64 -0
  17. package/docs/LAUNCH_PLAN.md +40 -0
  18. package/docs/LOCAL_PROJECT_ASSETS.md +250 -0
  19. package/docs/MCP_PLUGIN_SCANNING.md +53 -0
  20. package/docs/NEXT_SESSION.md +110 -0
  21. package/docs/NPM_PUBLISHING.md +66 -0
  22. package/docs/OPENCLAW_CLAWHUB_RESEARCH.md +128 -0
  23. package/docs/POLICY_MODEL.md +198 -0
  24. package/docs/PROJECT_REVIEW.md +108 -0
  25. package/docs/REAL_WORLD_VALIDATION.md +57 -0
  26. package/docs/RELEASE_NOTES_v0.1.0.md +52 -0
  27. package/docs/REPORT_SCHEMA.md +81 -0
  28. package/docs/RULES.md +92 -0
  29. package/docs/THREAT_MODEL.md +50 -0
  30. package/docs/WEB_DEMO.md +39 -0
  31. package/docs/WORKSPACE_SCANNING.md +41 -0
  32. package/examples/clawhub-origin-without-lock/skills/orphan-helper/.clawhub/origin.json +6 -0
  33. package/examples/clawhub-origin-without-lock/skills/orphan-helper/SKILL.md +11 -0
  34. package/examples/clawhub-workspace/.clawhub/lock.json +22 -0
  35. package/examples/clawhub-workspace/skills/drift-helper/.clawhub/origin.json +6 -0
  36. package/examples/clawhub-workspace/skills/drift-helper/SKILL.md +11 -0
  37. package/examples/clawhub-workspace/skills/missing-origin/SKILL.md +11 -0
  38. package/examples/clawhub-workspace/skills/weather-helper/.clawhub/origin.json +6 -0
  39. package/examples/clawhub-workspace/skills/weather-helper/SKILL.md +15 -0
  40. package/examples/declared-api-skill/SKILL.md +27 -0
  41. package/examples/dependency-python-skill/SKILL.md +16 -0
  42. package/examples/dependency-python-skill/pyproject.toml +5 -0
  43. package/examples/dependency-python-skill/requirements.txt +3 -0
  44. package/examples/dependency-risky-skill/SKILL.md +16 -0
  45. package/examples/dependency-risky-skill/package.json +12 -0
  46. package/examples/dependency-safe-skill/SKILL.md +16 -0
  47. package/examples/dependency-safe-skill/package-lock.json +19 -0
  48. package/examples/dependency-safe-skill/package.json +7 -0
  49. package/examples/metadata-mismatch-skill/SKILL.md +22 -0
  50. package/examples/openclaw-plugin-config/.openclaw/plugins.json +18 -0
  51. package/examples/openclaw-workspace/.agents/skills/research-helper/SKILL.md +11 -0
  52. package/examples/openclaw-workspace/skills/notes/SKILL.md +3 -0
  53. package/examples/openclaw-workspace/skills/research-helper/SKILL.md +17 -0
  54. package/examples/risky-mcp-config/.cursor/mcp.json +29 -0
  55. package/examples/risky-openclaw-plugin/openclaw.plugin.json +6 -0
  56. package/examples/risky-openclaw-plugin/package.json +7 -0
  57. package/examples/risky-openclaw-plugin/src/index.ts +1 -0
  58. package/examples/risky-skill/SKILL.md +17 -0
  59. package/examples/safe-mcp-config/.cursor/mcp.json +15 -0
  60. package/examples/safe-openclaw-plugin/dist/index.js +1 -0
  61. package/examples/safe-openclaw-plugin/openclaw.plugin.json +5 -0
  62. package/examples/safe-openclaw-plugin/package.json +14 -0
  63. package/examples/safe-skill/SKILL.md +12 -0
  64. package/package.json +49 -0
  65. package/schemas/clawguard-report.schema.json +266 -0
  66. package/scripts/capture-demo.js +206 -0
  67. package/src/clawhub.js +383 -0
  68. package/src/cli.js +296 -0
  69. package/src/config.js +205 -0
  70. package/src/dependencies.js +417 -0
  71. package/src/mcp-config.js +592 -0
  72. package/src/policy.js +165 -0
  73. package/src/reporters/html.js +482 -0
  74. package/src/reporters/sarif.js +121 -0
  75. package/src/rule-catalog.js +400 -0
  76. package/src/rules.js +121 -0
  77. package/src/scanner.js +387 -0
  78. package/src/skill-metadata.js +516 -0
  79. package/src/web-server.js +395 -0
  80. package/src/workspace.js +233 -0
  81. package/web/app.js +374 -0
  82. package/web/index.html +119 -0
  83. package/web/styles.css +453 -0
@@ -0,0 +1,110 @@
1
+ # Next Session Checkpoint
2
+
3
+ Saved: 2026-05-08 11:45 +07
4
+
5
+ ## Current Status
6
+
7
+ ClawGuard now has a strong foundation:
8
+
9
+ - Static scanner for OpenClaw-style skills and MCP configs.
10
+ - OpenClaw `SKILL.md` frontmatter parsing.
11
+ - Metadata mismatch checks for undeclared env vars, binaries, config paths, network access, and install behavior.
12
+ - `.clawguard.json` config and policy presets.
13
+ - Suppressions with required reasons and critical-finding guardrails.
14
+ - SARIF output and GitHub Action metadata.
15
+ - Self-contained HTML reports.
16
+ - MCP/plugin config scanning for `.cursor/mcp.json`, `.openclaw/mcp.json`, `.openclaw/plugins.json`, and `mcp.json`.
17
+ - OpenClaw workspace scanning for `skills/` and `.agents/skills/`.
18
+ - Duplicate skill-name and risky override findings.
19
+ - Versioned JSON report schema.
20
+ - Central rule catalog and rule docs.
21
+ - ClawHub metadata and lockfile scanning.
22
+ - Dependency manifest and package lock scanning.
23
+ - Local web demo for paste, folder, and example scans.
24
+ - Web demo HTML report download.
25
+ - README demo screenshots and launch assets under `docs/assets/`.
26
+ - Fresh-copy validation from `/private/tmp`.
27
+ - Real-world ClawHub validation notes against current public sources.
28
+ - ClawHub `envVars` and `requiredEnv` declaration parsing.
29
+ - First-class `openclaw.plugin.json` package manifest scanning.
30
+ - OpenClaw plugin compatibility, runtime output, code execution, and sensitive capability rules.
31
+ - GitHub bug report and fixture submission issue templates.
32
+ - Pull request template.
33
+ - Draft `v0.1.0` release notes.
34
+ - Repeatable Playwright demo capture script with visible cursor movement.
35
+ - Generated demo screenshots, HTML report, WebM, and MP4 assets.
36
+ - Release package metadata, repository links, explicit npm package `files`, and visible MIT `LICENSE`.
37
+ - `npm pack --dry-run` validated with a temporary npm cache.
38
+
39
+ ## Verification
40
+
41
+ Last full test run:
42
+
43
+ ```bash
44
+ npm test
45
+ ```
46
+
47
+ Result: 70/70 passing.
48
+
49
+ Fresh-copy validation also passed:
50
+
51
+ ```bash
52
+ npm ci
53
+ npm test
54
+ node src/cli.js scan examples/risky-openclaw-plugin --html plugin-report.html --fail-on none
55
+ ```
56
+
57
+ Useful smoke commands:
58
+
59
+ ```bash
60
+ node src/cli.js scan examples/metadata-mismatch-skill --fail-on none
61
+ node src/cli.js scan examples/risky-mcp-config --fail-on none
62
+ node src/cli.js scan-workspace examples/openclaw-workspace --fail-on none
63
+ node src/cli.js scan-workspace examples/openclaw-workspace --html /private/tmp/clawguard-workspace.html --fail-on none
64
+ node src/cli.js scan examples/clawhub-workspace --fail-on none
65
+ node src/cli.js scan examples/dependency-risky-skill --fail-on none
66
+ node src/cli.js scan examples/dependency-safe-skill --fail-on none
67
+ node src/cli.js scan examples/dependency-python-skill --fail-on none
68
+ node src/cli.js scan examples/risky-openclaw-plugin --fail-on none
69
+ node src/cli.js scan examples/safe-openclaw-plugin --fail-on none
70
+ npm run web
71
+ npm run web -- --port 4174
72
+ npm run demo:capture
73
+ npm --cache /private/tmp/clawguard-npm-cache pack --dry-run
74
+ ```
75
+
76
+ ## Best Next Step
77
+
78
+ Prepare the final public launch package.
79
+
80
+ Target inputs:
81
+
82
+ - short demo GIF or video using `docs/DEMO_SCRIPT.md`
83
+ - GitHub repository description and topics from `docs/GITHUB_REPO_SETUP.md`
84
+ - first `v0.1.0` release notes
85
+ - real installed OpenClaw/ClawHub skill folders if available locally
86
+
87
+ Target findings:
88
+
89
+ - optional ClawHub package digest/source verification
90
+ - false-positive cleanup from real installed skills
91
+ - publish repo, tag `v0.1.0`, and open first public feedback thread
92
+
93
+ Suggested files:
94
+
95
+ - `src/mcp-config.js`
96
+ - `src/clawhub.js`
97
+ - `src/skill-metadata.js`
98
+ - `test/scanner.test.js`
99
+ - `docs/REAL_WORLD_VALIDATION.md`
100
+ - `docs/GITHUB_REPO_SETUP.md`
101
+ - `README.md`
102
+ - `docs/LAUNCH_CHECKLIST.md`
103
+
104
+ ## Good Commit Message Later
105
+
106
+ ```text
107
+ Build ClawGuard security scanner foundation
108
+ ```
109
+
110
+ This repo is still uncommitted. Run `git status --short` before committing so unrelated local changes are not accidentally included.
@@ -0,0 +1,66 @@
1
+ # npm Publishing
2
+
3
+ ClawGuard is published as:
4
+
5
+ ```text
6
+ @denial-web/clawguard
7
+ ```
8
+
9
+ ## Preferred Path: Trusted Publishing
10
+
11
+ Use npm trusted publishing so GitHub Actions can publish with short-lived OIDC credentials instead of local OTPs or long-lived npm tokens.
12
+
13
+ Workflow file:
14
+
15
+ ```text
16
+ .github/workflows/publish.yml
17
+ ```
18
+
19
+ Configure this on npmjs.com:
20
+
21
+ ```text
22
+ Provider: GitHub Actions
23
+ Organization or user: denial-web
24
+ Repository: clawguard
25
+ Workflow filename: publish.yml
26
+ Environment name: leave blank
27
+ ```
28
+
29
+ After the trusted publisher is connected, publish from GitHub Actions:
30
+
31
+ 1. Go to the GitHub repository.
32
+ 2. Open `Actions`.
33
+ 3. Select `Publish to npm`.
34
+ 4. Click `Run workflow`.
35
+
36
+ The workflow also runs automatically when a GitHub release is published.
37
+
38
+ ## First Publish Notes
39
+
40
+ If npm does not allow trusted publishing before the first package publish, publish manually once from a local terminal after enabling npm 2FA:
41
+
42
+ ```bash
43
+ npm publish --access public
44
+ ```
45
+
46
+ After the first package exists on npm, connect trusted publishing and use GitHub Actions for later releases.
47
+
48
+ ## Release Flow
49
+
50
+ For a patch release:
51
+
52
+ ```bash
53
+ npm version patch
54
+ git push origin main --follow-tags
55
+ gh release create v0.1.1 --generate-notes
56
+ ```
57
+
58
+ The release event will trigger `.github/workflows/publish.yml`.
59
+
60
+ ## Verify
61
+
62
+ After publishing, test the package from npm:
63
+
64
+ ```bash
65
+ npx @denial-web/clawguard scan examples/risky-skill
66
+ ```
@@ -0,0 +1,128 @@
1
+ # OpenClaw and ClawHub Research
2
+
3
+ Checked: 2026-05-07
4
+
5
+ This document captures the current public OpenClaw and ClawHub shape that ClawGuard should build around. It uses official OpenClaw and ClawHub sources only.
6
+
7
+ ## Official Sources
8
+
9
+ - [OpenClaw GitHub repository](https://github.com/openclaw/openclaw)
10
+ - [OpenClaw architecture docs](https://docs.openclaw.ai/concepts/architecture)
11
+ - [OpenClaw skills docs](https://docs.openclaw.ai/tools/skills)
12
+ - [ClawHub docs](https://docs.openclaw.ai/tools/clawhub)
13
+ - [ClawHub GitHub repository](https://github.com/openclaw/clawhub)
14
+ - [ClawHub skill format](https://github.com/openclaw/clawhub/blob/main/docs/skill-format.md)
15
+ - [OpenClaw skills archive](https://github.com/openclaw/skills)
16
+
17
+ ## Current OpenClaw Shape
18
+
19
+ OpenClaw is a personal AI assistant with a long-lived Gateway as the control plane. The Gateway owns messaging surfaces, exposes a WebSocket API, validates inbound frames against JSON Schema, and coordinates clients, nodes, tools, sessions, and events.
20
+
21
+ Security-relevant facts:
22
+
23
+ - The main session can run tools on the host, which means skills and tools should be treated as meaningful trust decisions.
24
+ - Non-main sessions can be sandboxed with Docker, SSH, or OpenShell backends.
25
+ - Typical sandbox policy allows core file/process/session tools and denies broader tools such as browser, canvas, nodes, cron, Discord, and gateway.
26
+ - OpenClaw treats inbound direct messages as untrusted input and uses pairing/allowlist controls for remote surfaces.
27
+ - Skills are loaded into the agent prompt and can influence how tools are used.
28
+ - Plugins can ship skills, so plugin review and skill review are connected.
29
+
30
+ ## Current Skill Model
31
+
32
+ OpenClaw uses AgentSkills-compatible folders. A skill is a directory containing `SKILL.md` with YAML frontmatter and instructions.
33
+
34
+ Current skill locations and precedence:
35
+
36
+ - Extra skill folders from `skills.load.extraDirs`
37
+ - Bundled skills shipped with OpenClaw
38
+ - Managed/local skills in `~/.openclaw/skills`
39
+ - Personal agent skills in `~/.agents/skills`
40
+ - Project agent skills in `<workspace>/.agents/skills`
41
+ - Workspace skills in `<workspace>/skills`
42
+
43
+ If names conflict, workspace skills take precedence over project, personal, managed/local, bundled, and extra-dir skills.
44
+
45
+ Important implication: ClawGuard should scan the skill that actually wins by precedence, not only every folder it can see. A later phase should add `clawguard openclaw scan-workspace` to resolve and report effective skills.
46
+
47
+ ## Current ClawHub Shape
48
+
49
+ ClawHub is the public registry for OpenClaw skills and plugins.
50
+
51
+ Current registry roles:
52
+
53
+ - Public browsing of skill content and metadata.
54
+ - Versioned skill bundles with semver, changelogs, tags, and `latest`.
55
+ - Downloads as zip bundles.
56
+ - Search and discovery.
57
+ - Stars, comments, moderation, reporting, hiding, deletion, and ban flows.
58
+ - Plugin/package browsing with family, trust, and capability metadata.
59
+ - Publish flows for skills and plugins.
60
+
61
+ Native OpenClaw flows install ClawHub skills into the active workspace `skills/` directory. Native plugin installs validate advertised compatibility before archive installation, and ClawHub source metadata is persisted for future updates.
62
+
63
+ The separate `clawhub` CLI can install skills into `./skills` under the current working directory and stores local state in `.clawhub/lock.json`.
64
+
65
+ ## Current Skill Format Signals
66
+
67
+ The ClawHub skill format makes `SKILL.md` central:
68
+
69
+ - `SKILL.md` or `skill.md` is required.
70
+ - YAML frontmatter is optional but important for metadata extraction.
71
+ - `description` is used for UI and search summary.
72
+ - Runtime metadata is declared under `metadata.openclaw` with aliases for older names.
73
+ - Important fields include `requires.env`, `requires.bins`, `requires.anyBins`, `requires.config`, `primaryEnv`, `envVars`, `install`, `os`, `homepage`, and related metadata.
74
+ - Install kinds currently include `brew`, `node`, `go`, and `uv`.
75
+ - Published skills accept text-based files only.
76
+ - Server-side bundle size is capped at 50 MB.
77
+ - Published ClawHub skills are MIT-0.
78
+
79
+ ClawHub's own docs say its security analysis checks whether declarations match actual skill behavior. Example: a skill that references an API key but does not declare it should be flagged as a metadata mismatch.
80
+
81
+ ## ClawGuard Product Inference
82
+
83
+ Inference from the sources: ClawGuard should not try to replace ClawHub security analysis. It should become an independent, explainable, local and CI-friendly enforcement layer that works before install, after install, and during pull requests.
84
+
85
+ The strongest ClawGuard scope is:
86
+
87
+ - Skill scanner for `SKILL.md` and supporting files.
88
+ - Frontmatter mismatch scanner for declared requirements versus observed behavior.
89
+ - MCP and plugin config scanner for tool/capability risk.
90
+ - Install/update gate for OpenClaw and ClawHub workflows.
91
+ - CI and GitHub Action for community repositories.
92
+ - Web demo for quick "upload skill, get risk score" sharing.
93
+
94
+ The strongest first public message is:
95
+
96
+ > Run ClawGuard before trusting an OpenClaw skill or plugin.
97
+
98
+ ## Architecture Requirements From Research
99
+
100
+ ClawGuard needs to support these inputs:
101
+
102
+ - A single skill folder.
103
+ - A workspace `skills/` folder.
104
+ - Project agent skills in `.agents/skills`.
105
+ - Managed/local skill folders when explicitly passed.
106
+ - ClawHub local install metadata in `.clawhub/`.
107
+ - OpenClaw plugin config and source metadata.
108
+ - MCP configs from `.openclaw`, `.cursor`, and common MCP config paths.
109
+ - ClawHub package metadata when supplied by a user or integration.
110
+
111
+ ClawGuard needs to produce these outputs:
112
+
113
+ - Human CLI report.
114
+ - JSON report for automation.
115
+ - Policy decision for install gates.
116
+ - SARIF report for GitHub code scanning.
117
+ - HTML report for demos and enterprise review.
118
+ - JSONL audit events for later SIEM or governance use.
119
+
120
+ ## Research-Driven Priorities
121
+
122
+ 1. Parse `SKILL.md` frontmatter and compare declarations to observed behavior.
123
+ 2. Scan OpenClaw workspace skill folders and report effective precedence.
124
+ 3. Scan `.clawhub/lock.json` and origin metadata for source/version context.
125
+ 4. Scan plugin and MCP config for broad tools, unknown sources, install scripts, and network/system capabilities.
126
+ 5. Add policy presets for personal, governed, and enterprise use.
127
+ 6. Add GitHub Action and SARIF output.
128
+ 7. Add web demo and demo GIF around "Upload skill -> Risk score -> Explanation -> Safer action".
@@ -0,0 +1,198 @@
1
+ # Policy Model
2
+
3
+ ClawGuard separates detection from decision-making.
4
+
5
+ Detection answers:
6
+
7
+ > What did we find?
8
+
9
+ Policy answers:
10
+
11
+ > What should happen before this skill or plugin is trusted?
12
+
13
+ ## Risk Levels
14
+
15
+ `info`
16
+
17
+ Useful context. Does not imply danger.
18
+
19
+ Examples:
20
+
21
+ - Missing optional metadata.
22
+ - Skill has install requirements.
23
+ - Workspace contains duplicate skill names.
24
+
25
+ `low`
26
+
27
+ Minor risk or maintenance issue.
28
+
29
+ Examples:
30
+
31
+ - Uses common external domains.
32
+ - Declares broad tags without matching instructions.
33
+ - Reads normal config files.
34
+
35
+ `medium`
36
+
37
+ The skill can surprise the user or expand trust.
38
+
39
+ Examples:
40
+
41
+ - Undeclared binary requirement.
42
+ - Broad filesystem wording.
43
+ - Network access that matches the skill purpose but is not declared.
44
+ - Prompt instructions that ask the model to ignore unrelated context.
45
+
46
+ `high`
47
+
48
+ The skill can touch sensitive data, external systems, or powerful tools.
49
+
50
+ Examples:
51
+
52
+ - Reads environment variables or credential files.
53
+ - Sends data to external endpoints.
54
+ - Requests shell, browser, GitHub, Slack, email, calendar, or gateway capabilities.
55
+ - Uses install scripts or opaque dependency setup.
56
+
57
+ `critical`
58
+
59
+ The skill can cause serious damage or execute untrusted logic.
60
+
61
+ Examples:
62
+
63
+ - Downloads and executes remote code.
64
+ - Runs destructive shell commands.
65
+ - Silently exfiltrates secrets.
66
+ - Attempts to disable safety controls or approvals.
67
+ - Uses obfuscation to hide execution or network behavior.
68
+
69
+ ## Decisions
70
+
71
+ `allow`
72
+
73
+ No blocking issues. The report may still show informational findings.
74
+
75
+ `warn`
76
+
77
+ Show the risk and allow the operator to continue.
78
+
79
+ `manual_review`
80
+
81
+ Require a human review before install, update, or merge.
82
+
83
+ `sandbox_required`
84
+
85
+ Allow only inside a sandbox or with limited tools.
86
+
87
+ `dual_approval`
88
+
89
+ Require two reviewers for high-risk enterprise workflows.
90
+
91
+ `block`
92
+
93
+ Do not install, enable, or merge.
94
+
95
+ ## Presets
96
+
97
+ Personal:
98
+
99
+ - Allow `info` and `low`.
100
+ - Warn on `medium`.
101
+ - Manual review on `high`.
102
+ - Block `critical`.
103
+
104
+ Governed:
105
+
106
+ - Allow `info`.
107
+ - Warn on `low`.
108
+ - Manual review on `medium`.
109
+ - Sandbox required on `high`.
110
+ - Block `critical`.
111
+
112
+ Enterprise:
113
+
114
+ - Allow `info`.
115
+ - Warn on `low`.
116
+ - Manual review on `medium`.
117
+ - Dual approval or sandbox required on `high`.
118
+ - Block `critical`.
119
+ - Block undeclared sensitive behavior even when the base severity is lower.
120
+
121
+ ## Policy Inputs
122
+
123
+ Policy should consider:
124
+
125
+ - Risk level and score.
126
+ - Finding category.
127
+ - Confidence.
128
+ - Target kind.
129
+ - Source trust.
130
+ - Whether the behavior is declared in `SKILL.md`.
131
+ - Whether the skill requires secrets.
132
+ - Whether the skill requires install commands.
133
+ - Whether sandboxing is available.
134
+ - Whether a finding is in executable code, metadata, documentation, or tests.
135
+ - Whether the repo has a known maintainer or pinned version.
136
+
137
+ ## OpenClaw-Specific Checks
138
+
139
+ Policy should treat these as important:
140
+
141
+ - Workspace skill overrides a safer managed or bundled skill.
142
+ - Skill ships through a plugin and may load indirectly.
143
+ - Agent allowlists are unrestricted.
144
+ - Main session has host tool access.
145
+ - Non-main sandbox is unavailable or disabled.
146
+ - Skill asks for tools that typical sandbox defaults deny.
147
+
148
+ ## ClawHub-Specific Checks
149
+
150
+ Policy should treat these as important:
151
+
152
+ - Local install differs from registry origin metadata.
153
+ - Lockfile version is old, missing, or inconsistent.
154
+ - A skill references secrets not declared under `metadata.openclaw`.
155
+ - A skill requires binaries not declared under `requires.bins` or `requires.anyBins`.
156
+ - A skill includes install specs that fetch packages or binaries.
157
+ - Plugin compatibility or source metadata is missing.
158
+
159
+ ## Suppressions
160
+
161
+ Suppressions should be explicit and auditable.
162
+
163
+ Recommended suppression shape:
164
+
165
+ ```json
166
+ {
167
+ "findingId": "network-access",
168
+ "path": "skills/weather/SKILL.md",
169
+ "reason": "Weather skill is expected to call the weather API.",
170
+ "expires": "2026-12-31",
171
+ "reviewer": "security@example.com"
172
+ }
173
+ ```
174
+
175
+ Rules:
176
+
177
+ - Suppressions require a reason.
178
+ - Suppressions should expire.
179
+ - Suppressions should match finding ID and path.
180
+ - Suppressions must not hide critical remote execution by default.
181
+
182
+ ## Audit Events
183
+
184
+ Policy decisions should be exportable as JSONL:
185
+
186
+ ```json
187
+ {
188
+ "time": "2026-05-07T00:00:00Z",
189
+ "target": "skills/todoist",
190
+ "score": 68,
191
+ "level": "high",
192
+ "decision": "sandbox_required",
193
+ "preset": "governed",
194
+ "findingIds": ["credential-access", "network-access"]
195
+ }
196
+ ```
197
+
198
+ This gives enterprise users a path to governance without making the first product heavy.
@@ -0,0 +1,108 @@
1
+ # ClawGuard Project Review
2
+
3
+ This review is focused on making ClawGuard strong, secure, and credible as a public companion tool for OpenClaw-style skills and MCP configs.
4
+
5
+ ## What Is Already Strong
6
+
7
+ - The project has a sharp purpose: scan skills before users trust them.
8
+ - The first product surface is small and useful: `clawguard scan <path>`.
9
+ - The scanner is static-only. It does not execute untrusted skill code.
10
+ - The scanner has no runtime dependencies, which reduces supply-chain risk.
11
+ - Findings are explainable: rule ID, severity, file, line, evidence, and recommendation.
12
+ - The CLI supports JSON output, so it can become a GitHub Action or CI gate.
13
+ - The README uses the right positioning: companion project, not OpenClaw replacement.
14
+ - The repo includes safe and risky example skills for demos and tests.
15
+
16
+ ## Most Important Security Properties
17
+
18
+ - Never execute scanned files.
19
+ - Never install dependencies from scanned projects.
20
+ - Avoid following symlinks into unexpected paths.
21
+ - Bound file size and work per scan.
22
+ - Keep every finding explainable.
23
+ - Prefer clear false positives over silent false negatives, but keep noisy rules under control.
24
+ - Make CI behavior configurable with a fail threshold.
25
+
26
+ ## Improvements Already Added
27
+
28
+ - File-size guard with a 1 MB default limit.
29
+ - Symlink skipping.
30
+ - Unreadable file reporting instead of whole-scan failure.
31
+ - Multiple findings per rule while avoiding overlapping duplicate evidence.
32
+ - `--fail-on` CLI threshold for CI usage.
33
+ - `--max-file-size` CLI option.
34
+ - More rules for install lifecycle scripts, obfuscated execution, and data exfiltration.
35
+ - OpenClaw `SKILL.md` frontmatter parsing.
36
+ - First metadata mismatch checks for undeclared env vars, binaries, config paths, network access, and install behavior.
37
+ - `.clawguard.json` policy/config support.
38
+ - Policy decisions for personal, governed, and enterprise presets.
39
+ - Suppressions with required reasons and critical-finding guardrails.
40
+ - SARIF reporter for GitHub code scanning.
41
+ - Composite GitHub Action metadata.
42
+ - MCP/plugin config scanning for `.cursor/mcp.json`, `.openclaw/mcp.json`, `.openclaw/plugins.json`, and `mcp.json`.
43
+ - MCP/plugin findings for runtime package commands, unpinned packages, secret env injection, broad filesystem access, shell execution, remote URLs, and write-capable tools.
44
+ - Versioned JSON report schema.
45
+ - Rule metadata catalog with stable rule IDs.
46
+ - Self-contained HTML report generation.
47
+ - OpenClaw workspace skill precedence scanning for `skills/` and `.agents/skills/`.
48
+ - ClawHub lockfile and per-skill origin metadata scanning.
49
+ - ClawHub version drift, source drift, missing origin, missing lockfile, invalid metadata, and unusual source rules.
50
+ - Dependency manifest and lockfile scanning for npm and Python skill bundles.
51
+ - Dependency findings for install scripts, missing lockfiles, unpinned specs, direct sources, suspicious names, and invalid manifests.
52
+ - CI workflow with read-only GitHub token permissions.
53
+ - Lockfile for deterministic npm metadata.
54
+ - Threat model documentation.
55
+
56
+ ## Highest-Value Next Features
57
+
58
+ 1. GitHub Action Hardening
59
+
60
+ Add end-to-end workflow examples, upload SARIF in this repo's own CI, and test the action from a clean checkout.
61
+
62
+ 2. Real Fixture Corpus
63
+
64
+ Add many safe and risky fixtures so rule quality improves without guessing.
65
+
66
+ 3. SARIF Report
67
+
68
+ Generate GitHub code scanning output for pull request annotations.
69
+
70
+ 4. HTML Report Polish
71
+
72
+ Add visual screenshots, print styling, and optional report branding once the demo flow is ready.
73
+
74
+ 5. Web Demo
75
+
76
+ Build "paste SKILL.md -> get risk score" first. Folder upload can come later.
77
+
78
+ 6. Rule Metadata Refinement
79
+
80
+ Add confidence, CWE-style tags where useful, and richer examples for each rule.
81
+
82
+ ## Product Direction
83
+
84
+ The best version of ClawGuard is not a giant framework. It is a trusted review layer:
85
+
86
+ - Fast local CLI
87
+ - CI gate
88
+ - GitHub Action
89
+ - Web demo
90
+ - Security checklist
91
+ - OpenClaw ecosystem docs and examples
92
+
93
+ The strongest identity is:
94
+
95
+ > The simple security scanner developers run before trusting an agent skill.
96
+
97
+ ## Launch Bar
98
+
99
+ Before public launch, ClawGuard should have:
100
+
101
+ - At least 20 tests
102
+ - At least 20 fixtures
103
+ - A demo GIF
104
+ - A GitHub Action example
105
+ - A threat model
106
+ - A short limitations section
107
+ - A clear non-affiliation statement
108
+ - A security reporting policy
@@ -0,0 +1,57 @@
1
+ # Real-World Validation
2
+
3
+ Last checked: 2026-05-08.
4
+
5
+ ## Sources Checked
6
+
7
+ - Official ClawHub repository: https://github.com/openclaw/clawhub
8
+ - Official ClawHub skill format docs: https://github.com/openclaw/clawhub/blob/main/docs/skill-format.md
9
+ - OpenClaw ClawHub docs: https://docs.openclaw.ai/tools/clawhub
10
+
11
+ The official `openclaw/clawhub` repository was cloned at:
12
+
13
+ ```text
14
+ f14d70759dcc14b24890f5a50e1f9ce06f38eacd
15
+ ```
16
+
17
+ An attempted shallow clone of `https://github.com/openclaw/skills` returned `Repository not found` from GitHub in this environment, so validation used the current ClawHub source repository, docs, schema code, and a local skill fixture modeled on the current public skill-format docs.
18
+
19
+ ## Compatibility Signals
20
+
21
+ Current ClawHub docs describe:
22
+
23
+ - Skill folders with `SKILL.md` or `skill.md`.
24
+ - Per-skill install metadata at `<skill>/.clawhub/origin.json`.
25
+ - Workspace install state at `<workdir>/.clawhub/lock.json`.
26
+ - Runtime declarations under `metadata.openclaw`.
27
+ - Alias metadata namespaces: `metadata.clawdbot` and `metadata.clawdis`.
28
+ - Required env declarations through `requires.env`, `primaryEnv`, and `envVars`.
29
+ - Install specs under `metadata.openclaw.install`.
30
+ - Install kinds including `brew`, `node`, `go`, and `uv`.
31
+
32
+ ## Validation Results
33
+
34
+ ClawGuard already covered the main ClawHub surfaces:
35
+
36
+ - `SKILL.md` and `skill.md` frontmatter parsing.
37
+ - `.clawhub/origin.json` and `.clawhub/lock.json` scanning.
38
+ - `openclaw.plugin.json` package manifest scanning.
39
+ - Lock/origin drift detection.
40
+ - Declared env, binary, config, network, and install behavior.
41
+ - npm and Python dependency manifest checks.
42
+ - MCP and OpenClaw plugin config checks.
43
+
44
+ This validation added parser support for:
45
+
46
+ - `metadata.openclaw.envVars` map entries.
47
+ - `requiredEnv` declarations used by ClawHub config examples.
48
+ - OpenClaw plugin package compatibility fields required by current ClawHub publishing flows.
49
+ - TypeScript plugin runtime entries that need matching compiled JavaScript output.
50
+
51
+ The latest-format validation fixture now scans without undeclared metadata findings. It only reports the expected low external-network signal for the example URL.
52
+
53
+ ## Remaining Real-World Gaps
54
+
55
+ - Add optional digest/source verification for ClawHub plugin packages when metadata is available.
56
+ - Validate against real installed skill folders once a public archive or local ClawHub install is available.
57
+ - Add a small corpus of known-safe and known-risky public skills after manual review.