@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,253 @@
1
+ # Integration Spec
2
+
3
+ This spec defines how ClawGuard should work with OpenClaw, ClawHub, GitHub, web demos, and MCP without replacing any of them.
4
+
5
+ ## Integration Principles
6
+
7
+ - Stay independent and compatible.
8
+ - Prefer read-only scanning.
9
+ - Run before trust is granted.
10
+ - Use OpenClaw and ClawHub metadata when available.
11
+ - Verify declarations against local file behavior.
12
+ - Make output easy to paste into issues, PRs, and docs.
13
+
14
+ ## OpenClaw Integration
15
+
16
+ ### Skill Folder Scan
17
+
18
+ Command:
19
+
20
+ ```bash
21
+ clawguard scan-skill ./skills/my-skill
22
+ ```
23
+
24
+ Behavior:
25
+
26
+ - Locate `SKILL.md` or `skill.md`.
27
+ - Parse frontmatter.
28
+ - Scan supporting files.
29
+ - Detect declared versus observed mismatch.
30
+ - Produce risk score and policy decision.
31
+
32
+ ### Workspace Scan
33
+
34
+ Command:
35
+
36
+ ```bash
37
+ clawguard scan-workspace ~/.openclaw/workspace
38
+ ```
39
+
40
+ Behavior:
41
+
42
+ - Scan `<workspace>/skills`.
43
+ - Scan `<workspace>/.agents/skills` if present.
44
+ - Report duplicate skill names.
45
+ - Report effective winning skills by precedence.
46
+ - Report project-level skill risk.
47
+ - Detect `.clawhub/lock.json` when present.
48
+
49
+ Later:
50
+
51
+ - Optionally inspect `~/.openclaw/skills` when explicitly requested.
52
+ - Optionally inspect `~/.agents/skills` when explicitly requested.
53
+ - Read OpenClaw config to understand agent skill allowlists.
54
+
55
+ ### Plugin-Aware Skill Scan
56
+
57
+ Plugins can ship skills. ClawGuard should eventually parse plugin manifests and inspect bundled skill folders before the plugin is enabled.
58
+
59
+ Checks:
60
+
61
+ - Plugin-declared skills.
62
+ - Plugin capabilities.
63
+ - Install scripts or setup commands.
64
+ - Compatibility metadata.
65
+ - Required environment variables.
66
+ - Tool surface exposed by the plugin.
67
+
68
+ ## ClawHub Integration
69
+
70
+ ### Pre-Install Gate
71
+
72
+ Target command pattern:
73
+
74
+ ```bash
75
+ clawguard clawhub inspect <slug>
76
+ clawguard clawhub install --gate <slug>
77
+ ```
78
+
79
+ Behavior:
80
+
81
+ - Fetch or receive a skill bundle.
82
+ - Scan before writing into the active workspace.
83
+ - Show policy decision.
84
+ - Continue only when policy allows or the operator approves.
85
+
86
+ Network fetching should be opt-in. The first implementation can scan bundles already downloaded by `clawhub inspect` or native OpenClaw commands.
87
+
88
+ ### Post-Install Audit
89
+
90
+ Command:
91
+
92
+ ```bash
93
+ clawguard scan ./skills
94
+ ```
95
+
96
+ Behavior:
97
+
98
+ - Scan installed skills.
99
+ - Read `.clawhub/lock.json` if present.
100
+ - Read per-skill `.clawhub/origin.json` if present.
101
+ - Detect local drift from registry metadata when enough information exists.
102
+
103
+ Current implementation:
104
+
105
+ - Normalizes lockfile entries from `skills` or `packages` arrays and objects.
106
+ - Normalizes origin metadata from per-skill `.clawhub/origin.json` files.
107
+ - Reports missing lockfile, missing origin metadata, version drift, source drift, invalid metadata, and unusual source URLs.
108
+ - Adds a `clawhub` summary to JSON and HTML reports.
109
+
110
+ ### Metadata Comparison
111
+
112
+ ClawGuard should compare:
113
+
114
+ - Declared `requires.env` versus observed env var usage.
115
+ - Declared `primaryEnv` and `envVars` versus observed credential usage.
116
+ - Declared `requires.bins` or `requires.anyBins` versus observed shell commands.
117
+ - Declared `requires.config` versus observed config reads.
118
+ - Declared `install` specs versus package files and setup instructions.
119
+ - Declared homepage/source versus remote URLs used by the skill.
120
+
121
+ ## MCP and Tool Config Integration
122
+
123
+ Initial config paths:
124
+
125
+ - `.openclaw/plugins.json`
126
+ - `.openclaw/mcp.json`
127
+ - `.cursor/mcp.json`
128
+ - `mcp.json`
129
+ - Common project-local MCP config files discovered later.
130
+
131
+ Checks:
132
+
133
+ - Unknown command sources.
134
+ - Broad filesystem access.
135
+ - Environment variable injection.
136
+ - Tools that can send messages, browse, write files, run shell, control gateway, or call external APIs.
137
+ - Unpinned package specs.
138
+ - Install commands.
139
+ - Remote endpoints.
140
+
141
+ Current implementation:
142
+
143
+ - Scans `.openclaw/plugins.json`, `.openclaw/mcp.json`, `.cursor/mcp.json`, and `mcp.json`.
144
+ - Reports runtime package commands, unpinned packages, shell execution, secret env injection, broad filesystem access, remote URLs, and write-capable external tools.
145
+
146
+ Command:
147
+
148
+ ```bash
149
+ clawguard scan-mcp .cursor/mcp.json
150
+ ```
151
+
152
+ ## GitHub Action
153
+
154
+ Use cases:
155
+
156
+ - Scan pull requests adding or changing skills.
157
+ - Scan `SKILL.md` metadata before publishing to ClawHub.
158
+ - Upload SARIF to GitHub code scanning.
159
+ - Fail PRs based on policy preset.
160
+
161
+ Example:
162
+
163
+ ```yaml
164
+ name: ClawGuard
165
+
166
+ on:
167
+ pull_request:
168
+
169
+ permissions:
170
+ contents: read
171
+ security-events: write
172
+
173
+ jobs:
174
+ scan:
175
+ runs-on: ubuntu-latest
176
+ steps:
177
+ - uses: actions/checkout@v4
178
+ - uses: denial-web/clawguard@v1
179
+ with:
180
+ target: skills
181
+ policy: governed
182
+ sarif: clawguard.sarif
183
+ ```
184
+
185
+ ## Web Demo
186
+
187
+ First demo:
188
+
189
+ - Paste `SKILL.md`.
190
+ - Click scan.
191
+ - Show risk score.
192
+ - Show findings with line evidence.
193
+ - Show safer action.
194
+
195
+ Second demo:
196
+
197
+ - Upload a skill folder as zip.
198
+ - Scan files in browser where possible.
199
+ - Keep uploads local-only if feasible.
200
+
201
+ The web demo should be visual and shareable, but the security model must be clear: static analysis helps review risk, it does not prove safety.
202
+
203
+ ## MCP Server
204
+
205
+ Optional later server:
206
+
207
+ Tools:
208
+
209
+ - `scan_skill`
210
+ - `scan_directory`
211
+ - `scan_mcp_config`
212
+ - `explain_finding`
213
+ - `policy_decision`
214
+
215
+ Rules:
216
+
217
+ - Read-only by default.
218
+ - No remote fetching unless explicitly enabled.
219
+ - No command execution.
220
+ - Return structured results.
221
+ - Keep evidence bounded.
222
+
223
+ ## Output Compatibility
224
+
225
+ All integrations should use one shared core report schema. Surfaces can format differently, but the underlying result should be stable.
226
+
227
+ Required report fields:
228
+
229
+ - `target`
230
+ - `targetKind`
231
+ - `source`
232
+ - `score`
233
+ - `level`
234
+ - `decision`
235
+ - `findings`
236
+ - `filesScanned`
237
+ - `filesSkipped`
238
+ - `scanOptions`
239
+ - `limitations`
240
+
241
+ ## First Integration Sequence
242
+
243
+ 1. `SKILL.md` frontmatter parser.
244
+ 2. Metadata mismatch checks.
245
+ 3. Workspace scan with duplicate/effective skill reporting.
246
+ 4. JSON schema for reports.
247
+ 5. GitHub Action wrapper.
248
+ 6. SARIF reporter.
249
+ 7. Web paste demo.
250
+ 8. MCP config parser.
251
+ 9. ClawHub origin/lockfile parser.
252
+ 10. Dependency and package lock scanner.
253
+ 11. Optional ClawHub pre-install wrapper.
@@ -0,0 +1,64 @@
1
+ # Launch Checklist
2
+
3
+ Use this before sharing ClawGuard publicly.
4
+
5
+ ## Product Readiness
6
+
7
+ - [x] `npm test` passes.
8
+ - [x] `npm run web` starts locally.
9
+ - [x] Paste scan works.
10
+ - [x] Folder scan works.
11
+ - [x] Example scans work for safe, risky, ClawHub, dependency, workspace, and MCP cases.
12
+ - [x] HTML report download works.
13
+ - [x] JSON copy works or fails gracefully when browser clipboard permission is blocked.
14
+ - [x] README Quick Start is accurate.
15
+ - [x] Security model and limitations are clear.
16
+
17
+ ## Demo Assets
18
+
19
+ - [x] Record a short web demo video.
20
+ - [x] Capture a screenshot of the `Dependency Risk` scan.
21
+ - [x] Capture a screenshot of the downloaded HTML report.
22
+ - [x] Add screenshot or GIF links to README.
23
+ - [x] Prepare a 30-second demo script from [docs/DEMO_SCRIPT.md](DEMO_SCRIPT.md).
24
+ - [x] Add repeatable demo capture command.
25
+
26
+ ## GitHub Repository
27
+
28
+ - [ ] Repo description: `Governance and security scanner for OpenClaw skills, ClawHub installs, MCP configs, and skill dependencies.`
29
+ - [ ] Topics: `openclaw`, `clawhub`, `mcp`, `security`, `ai-agents`, `scanner`, `governance`, `supply-chain`.
30
+ - [x] License is visible.
31
+ - [x] Security policy is visible.
32
+ - [x] GitHub Action example is documented.
33
+ - [x] Rule catalog is documented.
34
+ - [x] Bug report issue template is available.
35
+ - [x] Fixture submission issue template is available.
36
+ - [x] Pull request template is available.
37
+ - [x] v0.1.0 release notes are drafted.
38
+ - [x] Package metadata and npm package contents are validated.
39
+
40
+ ## First Launch Post
41
+
42
+ Suggested post:
43
+
44
+ > I am building ClawGuard, a companion governance/security scanner for OpenClaw-style skills, ClawHub installs, MCP configs, and skill dependencies. It gives a local risk score, policy decision, evidence, and shareable HTML report before you trust a third-party skill.
45
+
46
+ Include:
47
+
48
+ - One screenshot or GIF.
49
+ - Link to README.
50
+ - One sentence about static-analysis limitations.
51
+ - Invitation for safe/risky fixture contributions.
52
+
53
+ ## Do Not Launch Until
54
+
55
+ - [x] The demo can be run by someone else from a fresh clone.
56
+ - [x] The README explains that ClawGuard is independent and not affiliated with OpenClaw.
57
+ - [x] Findings are clearly described as risk signals, not proof of malicious intent.
58
+
59
+ ## Remaining Before Public Launch
60
+
61
+ - Record a short GIF or video using [docs/DEMO_SCRIPT.md](DEMO_SCRIPT.md).
62
+ - Regenerate demo assets with `npm run demo:capture` after visual UI changes.
63
+ - Apply the repository description and topics in GitHub after the repo is created.
64
+ - Validate against real installed skill folders once a public skill archive or local ClawHub install is available.
@@ -0,0 +1,40 @@
1
+ # ClawGuard Launch Plan
2
+
3
+ ## Week 1: Useful MVP
4
+
5
+ - Keep the CLI dependency-free and easy to run. Status: done.
6
+ - Improve detection for `SKILL.md`, MCP configs, package scripts, shell scripts, and install instructions. Status: done.
7
+ - Add JSON output examples for CI usage. Status: done.
8
+ - Add a local web demo with paste, folder, examples, JSON copy, and HTML report export. Status: done.
9
+ - Record a short web demo GIF. Status: next.
10
+
11
+ ## Week 2: GitHub Visibility
12
+
13
+ - Publish the repo with a clear README and demo GIF.
14
+ - Submit small upstream PRs: safety checklist, skill review guidance, metadata suggestions.
15
+ - Open useful OpenClaw ecosystem discussions without promoting aggressively.
16
+ - Write one technical article: "How to Audit OpenClaw Skills Before Running Them".
17
+
18
+ ## Week 3: Shareable Tooling
19
+
20
+ - Add a simple web scanner: upload skill folder or paste `SKILL.md`. Status: done.
21
+ - Add a GitHub Action wrapper. Status: done.
22
+ - Add a badge format: `ClawGuard: scanned`.
23
+ - Generate shareable HTML reports. Status: done.
24
+
25
+ ## Week 4: Authority
26
+
27
+ - Publish a small "OpenClaw Skill Security Checklist".
28
+ - Start `awesome-openclaw-security` only after ClawGuard has real usage.
29
+ - Document threat models: prompt injection, secret access, tool abuse, remote code execution.
30
+ - Invite feedback from maintainers and security researchers.
31
+
32
+ ## Positioning Rule
33
+
34
+ Be the companion security layer for the ecosystem. Do not position ClawGuard as an OpenClaw replacement.
35
+
36
+ ## Immediate Next
37
+
38
+ 1. Capture screenshots and a short GIF using [docs/DEMO_SCRIPT.md](DEMO_SCRIPT.md).
39
+ 2. Add the screenshot/GIF to the README.
40
+ 3. Run the launch checklist in [docs/LAUNCH_CHECKLIST.md](LAUNCH_CHECKLIST.md).
@@ -0,0 +1,250 @@
1
+ # Local Project Assets For ClawGuard
2
+
3
+ This file maps useful material found in nearby local projects under `/Users/hy/CascadeProjects`.
4
+
5
+ The goal is not to blindly merge projects. The strongest path is to reuse patterns, tests, fixtures, and architecture ideas that make ClawGuard more credible as a focused OpenClaw-style skill and MCP security scanner.
6
+
7
+ ## Best Reuse Candidates
8
+
9
+ ### 1. AegisBrain Skill Scanner
10
+
11
+ Source:
12
+
13
+ - `/Users/hy/CascadeProjects/aegisbrain/packages/skill-runtime/src/scanner.ts`
14
+ - `/Users/hy/CascadeProjects/aegisbrain/docs/SECURITY_MODEL.md`
15
+ - `/Users/hy/CascadeProjects/aegisbrain/packages/policies/governed/default.policy.json`
16
+ - `/Users/hy/CascadeProjects/aegisbrain/packages/policies/consumer/default.policy.json`
17
+
18
+ Useful ideas:
19
+
20
+ - Manifest integrity checks
21
+ - Blocked tool allowlist
22
+ - Declared risk-level validation
23
+ - Step-count limits
24
+ - Permission-scope audit
25
+ - Trust levels: `verified`, `scanned`, `untrusted`
26
+ - Security model language: default deny, fail closed, audit trail, separation of planning and execution
27
+
28
+ Best ClawGuard use:
29
+
30
+ - Add structured `manifest` checks when a skill has JSON metadata.
31
+ - Add trust-level output next to the numeric risk score.
32
+ - Add policy presets: `consumer`, `governed`, and later `enterprise`.
33
+
34
+ ### 2. ToolGovernor / Agent-Immune
35
+
36
+ Source:
37
+
38
+ - `/Users/hy/CascadeProjects/toolgovernor/src/agent_immune/core/output_scanner.py`
39
+ - `/Users/hy/CascadeProjects/toolgovernor/src/agent_immune/mcp_server.py`
40
+ - `/Users/hy/CascadeProjects/toolgovernor/tests/test_output_scanner.py`
41
+ - `/Users/hy/CascadeProjects/toolgovernor/docs/mcp_marketplaces.md`
42
+ - `/Users/hy/CascadeProjects/toolgovernor/SECURITY.md`
43
+
44
+ Useful ideas:
45
+
46
+ - Credential and PII detection patterns
47
+ - Base64, hex, data URI, JWT, and long-query exfiltration detection
48
+ - System-prompt leak heuristics
49
+ - Output scanning as a separate product surface
50
+ - MCP server packaging and marketplace checklist
51
+ - Stronger security policy disclosure language
52
+
53
+ Best ClawGuard use:
54
+
55
+ - Import the test-case ideas into JavaScript fixtures.
56
+ - Add an optional `scan-output` command later.
57
+ - Add MCP marketplace positioning once ClawGuard has an MCP server.
58
+
59
+ Security note:
60
+
61
+ - Token-looking local files exist in `toolgovernor` (`.mcpregistry_*`). They appear ignored by git status, but do not read or copy them into ClawGuard.
62
+
63
+ ### 3. Nexus Agent Immune Scanner
64
+
65
+ Source:
66
+
67
+ - `/Users/hy/CascadeProjects/nexus-agent/app/core/immune/scanner.py`
68
+ - `/Users/hy/CascadeProjects/nexus-agent/tests/test_mcp_proxy.py`
69
+ - `/Users/hy/CascadeProjects/nexus-agent/tests/test_audit_export.py`
70
+
71
+ Useful ideas:
72
+
73
+ - Unicode normalization for zero-width characters and confusables
74
+ - Multi-language prompt-injection patterns
75
+ - Session escalation tracking
76
+ - Tool-call boundary rule: block any non-pass verdict
77
+ - SIEM-style JSONL audit export tests
78
+ - MCP governance proxy tests
79
+
80
+ Best ClawGuard use:
81
+
82
+ - Add Unicode normalization before regex scanning.
83
+ - Add multi-language prompt-injection fixtures.
84
+ - Add JSONL report export later.
85
+ - Use the MCP proxy tests as inspiration for future MCP config/tool scanning.
86
+
87
+ ### 4. Sidekick-OS Governor
88
+
89
+ Source:
90
+
91
+ - `/Users/hy/CascadeProjects/Sidekick-OS/functions/src/governor/policyEngine.ts`
92
+ - `/Users/hy/CascadeProjects/Sidekick-OS/functions/src/governor/toolGate.ts`
93
+ - `/Users/hy/CascadeProjects/Sidekick-OS/functions/src/governor/auditLogger.ts`
94
+ - `/Users/hy/CascadeProjects/Sidekick-OS/functions/src/security/promptPolicy.ts`
95
+ - `/Users/hy/CascadeProjects/Sidekick-OS/.cursor/skills/firebase-iam-triage/SKILL.md`
96
+
97
+ Useful ideas:
98
+
99
+ - Policy actions: `REJECT`, `ESCALATE`, `INJECT_CONSTRAINT`, `REQUIRE_DUAL_APPROVAL`
100
+ - Tool-name to action-type mapping
101
+ - Hash-chained audit log
102
+ - Prompt role sanitization
103
+ - Real Cursor-style skill file to use as a safe/operational fixture
104
+
105
+ Best ClawGuard use:
106
+
107
+ - Add policy-action terminology to ClawGuard recommendations.
108
+ - Add a future `--policy governed` mode.
109
+ - Add the Firebase IAM skill as a safe fixture after removing project-specific identifiers if publishing publicly.
110
+
111
+ ### 5. Minister Governor / Covernor Platform
112
+
113
+ Source:
114
+
115
+ - `/Users/hy/CascadeProjects/minister-governor-platform/src/core/governor/policies/engine.ts`
116
+ - `/Users/hy/CascadeProjects/minister-governor-platform/src/config/policies.json`
117
+ - `/Users/hy/CascadeProjects/minister-governor-platform/src/core/policy/capability.registry.ts`
118
+ - `/Users/hy/CascadeProjects/minister-governor-platform/src/core/policy/schema.validator.ts`
119
+ - `/Users/hy/CascadeProjects/minister-governor-platform/src/db/audit.logger.ts`
120
+ - `/Users/hy/CascadeProjects/minister-governor-platform/tests/unit/policy-engine.spec.ts`
121
+ - `/Users/hy/CascadeProjects/minister-governor-platform/docs/STRATEGIC_OPTIONS.md`
122
+
123
+ Useful ideas:
124
+
125
+ - Capability registry that maps raw tools to high-level capabilities
126
+ - Policy engine with conditions and constraints
127
+ - Provenance-required policy for financial routing
128
+ - Dual approval for very high-risk actions
129
+ - Schema validation for LLM-proposed actions
130
+ - Serializable hash-chain audit logging
131
+
132
+ Best ClawGuard use:
133
+
134
+ - Add capability categories to scanner findings: filesystem, network, credential, shell, browser, finance, communication.
135
+ - Add policy recommendations like `block`, `approve_with_constraints`, `manual_review`, `dual_approval`.
136
+ - Use the unit tests as a pattern for policy-mode tests.
137
+
138
+ ### 6. Sidekick Studio Skills
139
+
140
+ Source:
141
+
142
+ - `/Users/hy/CascadeProjects/sidekick-studio/.cursor/skills/*/SKILL.md`
143
+ - `/Users/hy/CascadeProjects/sidekick-studio/.cursor/skills/security-auditor/SKILL.md`
144
+ - `/Users/hy/CascadeProjects/sidekick-studio/.cursor/mcp.json`
145
+ - `/Users/hy/CascadeProjects/sidekick-studio/packages/authz/src/policy.ts`
146
+
147
+ Useful ideas:
148
+
149
+ - Many real `SKILL.md` examples for fixture testing
150
+ - Security-auditor skill rubric
151
+ - MCP config with stdio and HTTP servers
152
+ - Workspace role/capability model
153
+
154
+ Best ClawGuard use:
155
+
156
+ - Build a fixture corpus of realistic benign skills.
157
+ - Add MCP config scanning for risky commands such as `npx -y`, broad external MCPs, and missing descriptions.
158
+ - Add role/capability language later for enterprise reports.
159
+
160
+ ### 7. A-S-FLC Security Guard
161
+
162
+ Source:
163
+
164
+ - `/Users/hy/CascadeProjects/a-s-flc-llm-enhancer/core/policy_guard.py`
165
+ - `/Users/hy/CascadeProjects/a-s-flc-llm-enhancer/tests/test_policy_guard.py`
166
+ - `/Users/hy/CascadeProjects/a-s-flc-llm-enhancer/training/security_query_bank.json`
167
+ - `/Users/hy/CascadeProjects/a-s-flc-llm-enhancer/SECURITY_ADAPTER.md`
168
+
169
+ Useful ideas:
170
+
171
+ - Deterministic pre-LLM guard framing
172
+ - Security query bank for evaluation data
173
+ - Scam, credential-harvesting, PII, and prompt-injection categories
174
+ - Good product language: keep secret handling and escalation in code, not model weights
175
+
176
+ Best ClawGuard use:
177
+
178
+ - Use as inspiration for fixture categories and docs.
179
+ - Add an evaluation corpus later, separate from unit tests.
180
+
181
+ ### 8. Khmer Chatbot Security Scripts
182
+
183
+ Source:
184
+
185
+ - `/Users/hy/CascadeProjects/khmer-chatbot-ai/security-check.py`
186
+ - `/Users/hy/CascadeProjects/khmer-chatbot-ai/quick-security-check.py`
187
+ - `/Users/hy/CascadeProjects/khmer-chatbot-ai/docs/security-checklist.md`
188
+
189
+ Useful ideas:
190
+
191
+ - Deployment-oriented checks for secrets, env files, Dockerfiles, and `.gitignore`
192
+ - Clear pass/fail CLI output
193
+ - Security checklist format
194
+
195
+ Best ClawGuard use:
196
+
197
+ - Add repository hygiene checks later: `.env`, service account keys, Dockerfile root user, missing `.gitignore`.
198
+ - Keep these separate from skill scanning so the MVP stays focused.
199
+
200
+ ### 9. Doc Intelligence MCP
201
+
202
+ Source:
203
+
204
+ - `/Users/hy/CascadeProjects/doc-intelligence-mcp/src/server.ts`
205
+ - `/Users/hy/CascadeProjects/doc-intelligence-mcp/package.json`
206
+ - `/Users/hy/CascadeProjects/doc-intelligence-mcp/AGENTS.md`
207
+ - `/Users/hy/CascadeProjects/doc-intelligence-mcp/API_REFERENCE.md`
208
+
209
+ Useful ideas:
210
+
211
+ - Real MCP server with 28 tools
212
+ - Tool inventory and descriptions
213
+ - Input schemas and tool metadata
214
+ - HTTP/SSE transport example
215
+
216
+ Best ClawGuard use:
217
+
218
+ - Use as a realistic MCP scanning fixture.
219
+ - Extract tool inventory patterns for future MCP risk reports.
220
+
221
+ ## Recommended Import Order
222
+
223
+ 1. Unicode normalization and extra prompt-injection fixtures from `nexus-agent`.
224
+ 2. Credential/output leak patterns and tests from `toolgovernor`.
225
+ 3. Manifest/trust-level checks from `aegisbrain`.
226
+ 4. Policy recommendation language from `minister-governor-platform` and `Sidekick-OS`.
227
+ 5. Real benign `SKILL.md` fixtures from `sidekick-studio`.
228
+ 6. MCP config scanning using `sidekick-studio/.cursor/mcp.json` and `doc-intelligence-mcp`.
229
+ 7. Hash-chained audit and JSONL report ideas after the CLI is stable.
230
+
231
+ ## What Not To Do
232
+
233
+ - Do not merge whole projects into ClawGuard.
234
+ - Do not add Python dependencies to the current Node CLI just to reuse Python logic.
235
+ - Do not copy token files, local environment files, or project-specific secrets.
236
+ - Do not make ClawGuard a full governance runtime yet.
237
+ - Do not chase enterprise approval flows before the scanner has excellent fixtures and demos.
238
+
239
+ ## Strongest Product Path
240
+
241
+ ClawGuard should become:
242
+
243
+ - `clawguard scan <skill-dir>`
244
+ - `clawguard scan-mcp <mcp.json>`
245
+ - `clawguard scan-output <text-file>`
246
+ - GitHub Action
247
+ - Web demo
248
+ - Explainable HTML/JSON report
249
+
250
+ The local codebase already contains enough material to make ClawGuard much stronger without inventing from scratch.
@@ -0,0 +1,53 @@
1
+ # MCP and Plugin Config Scanning
2
+
3
+ ClawGuard scans MCP and plugin config files as part of the normal `scan` command.
4
+
5
+ ## Supported Paths
6
+
7
+ Current paths:
8
+
9
+ - `.cursor/mcp.json`
10
+ - `.openclaw/mcp.json`
11
+ - `.openclaw/plugins.json`
12
+ - `mcp.json`
13
+ - `openclaw.plugin.json`
14
+
15
+ These paths matter because skills can be low-risk on paper while the tool layer they activate is powerful.
16
+
17
+ ## Checks
18
+
19
+ ClawGuard currently reports:
20
+
21
+ - Runtime package commands such as `npx`, `uvx`, and `pnpm dlx`.
22
+ - Unpinned package specs used by runtime package commands.
23
+ - Shell or dynamic execution through `bash -c`, `python -c`, `node -e`, and similar patterns.
24
+ - Secret environment injection such as `GITHUB_TOKEN`, `OPENAI_API_KEY`, or other token-like names.
25
+ - Broad filesystem access such as `$HOME`, `~/`, `/`, or user home paths.
26
+ - Remote URLs.
27
+ - Write-capable browser, email, calendar, Slack, and GitHub capabilities.
28
+ - Invalid JSON in recognized config files.
29
+ - OpenClaw plugin packages with missing `package.json` metadata.
30
+ - Missing ClawHub compatibility metadata in plugin package manifests.
31
+ - Local runtime code execution through `openclaw.extensions` or `openclaw.runtimeExtensions`.
32
+ - TypeScript plugin entries without matching compiled JavaScript runtime output.
33
+ - Sensitive host capabilities such as shell, process, and filesystem access.
34
+
35
+ ## Example
36
+
37
+ ```bash
38
+ npm run scan -- examples/risky-mcp-config
39
+ ```
40
+
41
+ Useful fixtures:
42
+
43
+ - `examples/safe-mcp-config`
44
+ - `examples/risky-mcp-config`
45
+ - `examples/openclaw-plugin-config`
46
+ - `examples/safe-openclaw-plugin`
47
+ - `examples/risky-openclaw-plugin`
48
+
49
+ ## Security Model
50
+
51
+ The scanner does not start MCP servers, install packages, or execute configured commands. It reads the config as data and reports risk signals.
52
+
53
+ This keeps ClawGuard safe to run on untrusted repositories and pull requests.