You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For hook-based lifecycle integration with OpenClaw:
270
+
For native plugin-based lifecycle integration with OpenClaw:
271
271
272
272
```bash
273
-
# Install and enable hook pack
274
-
openclaw hooks install clawvault
275
-
openclaw hooks enable clawvault
273
+
# Install ClawVault and allow the plugin
274
+
npm install -g clawvault
275
+
openclaw config set plugins.allow '["clawvault"]'
276
+
openclaw config set plugins.slots.memory clawvault
277
+
278
+
# Configure the plugin
279
+
openclaw config set plugins.entries.clawvault.config.vaultPath ~/memory
280
+
openclaw config set plugins.entries.clawvault.config.allowClawvaultExec true
276
281
277
282
# Verify
278
-
openclaw hooks list --verbose
279
-
openclaw hooks check
283
+
openclaw doctor
280
284
clawvault compat
281
285
```
282
286
283
-
The hook automatically:
284
-
-Detects context death and injects recovery alerts
285
-
- Auto-checkpoints before session resets
286
-
-Provides `--profile auto` for context queries
287
+
The plugin can automatically:
288
+
-Detect context death and inject recovery alerts
289
+
- Auto-checkpoint before session resets
290
+
-Provide structured memory tools and lifecycle-driven recall
287
291
288
292
### MEMORY.md vs Vault
289
293
@@ -351,27 +355,29 @@ clawvault compat
351
355
352
356
## OpenClaw Setup (Canonical)
353
357
354
-
If you want hook-based lifecycle integration, use this sequence:
358
+
If you want native OpenClaw plugin integration, use this sequence:
355
359
356
360
```bash
357
361
# Install CLI
358
362
npm install -g clawvault
359
363
360
-
# Install and enable hook pack
361
-
openclaw hooks install clawvault
362
-
openclaw hooks enable clawvault
364
+
# Enable the native plugin slot
365
+
openclaw config set plugins.allow '["clawvault"]'
366
+
openclaw config set plugins.slots.memory clawvault
367
+
368
+
# Configure the plugin
369
+
openclaw config set plugins.entries.clawvault.config.vaultPath ~/memory
370
+
openclaw config set plugins.entries.clawvault.config.allowClawvaultExec true
363
371
364
372
# Verify
365
-
openclaw hooks list --verbose
366
-
openclaw hooks info clawvault
367
-
openclaw hooks check
373
+
openclaw doctor
368
374
clawvault compat
369
375
```
370
376
371
377
Important:
372
378
373
-
-`clawhub install clawvault` installs skill guidance, but does not replace hook-pack installation.
374
-
-After enabling hooks, restart the OpenClaw gateway process so hook registration reloads.
379
+
-`clawhub install clawvault` installs skill guidance, but does not replace native plugin configuration.
380
+
-Legacy `openclaw hooks install ...` / `openclaw hooks enable ...` flows are compatibility-only guidance for older deployments and should not be your primary install path.
375
381
376
382
## Minimal AGENTS.md Additions
377
383
@@ -489,8 +495,8 @@ vault/
489
495
-`qmd` is optional; in-process BM25 search is available without it
490
496
- if you want fallback compatibility, ensure `qmd --version` works in the same shell
491
497
- Hook/plugin not active in OpenClaw:
492
-
- run `openclaw hooks install clawvault`
493
-
- run `openclaw hooks enable clawvault`
498
+
- run `openclaw config set plugins.allow '["clawvault"]'`
499
+
- run `openclaw config set plugins.slots.memory clawvault`
Copy file name to clipboardExpand all lines: SECURITY.md
+17-25Lines changed: 17 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Security Model: ClawVault OpenClaw Plugin
2
2
3
-
This document explains the security posture of the OpenClaw plugin (`hooks/clawvault/handler.js`), why child process execution exists, and how risk is constrained.
3
+
This document explains the security posture of the native OpenClaw plugin (`openclaw.plugin.json` + `dist/openclaw-plugin.js`), why child process execution exists, and how risk is constrained.
4
4
5
5
## Threat Model
6
6
@@ -22,7 +22,7 @@ This document explains the security posture of the OpenClaw plugin (`hooks/clawv
22
22
23
23
## Why child process execution is required
24
24
25
-
The plugin integrates with the existing `clawvault` CLI as the compatibility contract with OpenClaw hooks.
25
+
The plugin integrates with the existing `clawvault` CLI for selected lifecycle features such as recovery, context injection, checkpointing, and observation workflows.
26
26
`clawvault context` and related commands may invoke `qmd` for retrieval/search. This is required for semantic/BM25 lookup and cannot be replaced by static in-process data access without duplicating core CLI behavior.
27
27
28
28
Security controls are applied around this execution path instead of removing it:
@@ -33,18 +33,16 @@ Security controls are applied around this execution path instead of removing it:
33
33
34
34
## Execution hardening controls
35
35
36
-
`hooks/clawvault/integrity.js` implements:
37
-
-`resolveExecutablePath(...)`
38
-
Resolves an absolute executable path (explicit path or PATH search), rejects non-executable targets.
39
-
-`sanitizeExecArgs(...)`
40
-
Enforces array-based argv and rejects null-byte arguments.
41
-
-`verifyExecutableIntegrity(...)`
42
-
Optional SHA-256 verification for pinned binary integrity.
36
+
`src/plugin/integrity.ts` implements:
37
+
-`resolveExecutablePath(...)`
38
+
-`sanitizeExecArgs(...)`
39
+
-`verifyExecutableIntegrity(...)`
43
40
44
-
`hooks/clawvault/handler.js` enforces:
45
-
-`shell: false` for all `execFileSync` calls.
46
-
- No string-concatenated command lines.
47
-
- Execution only when `allowClawvaultExec=true`.
41
+
The native plugin runtime enforces:
42
+
-`shell: false` for child-process execution paths
43
+
- no string-concatenated command lines
44
+
- execution only when `allowClawvaultExec=true`
45
+
- manifest-based configuration validation before runtime load
> **Built for [OpenClaw](https://openclaw.ai)**. Canonical install: npm CLI + native plugin enablement via `plugins.allow` and `plugins.slots.memory`.
19
19
20
20
## Security & Transparency
21
21
22
22
**What this skill does:**
23
23
- Reads/writes markdown files in your vault directory (`CLAWVAULT_PATH` or auto-discovered)
24
24
-`repair-session` reads and modifies OpenClaw session transcripts (`~/.openclaw/agents/`) — creates backups before writing
25
-
- Provides an OpenClaw **hook pack**(`hooks/clawvault/handler.js`) with lifecycle events (`gateway:startup`, `gateway:heartbeat`, `command:new`, `session:start`, `compaction:memoryFlush`, `cron.weekly`). Hook is opt-in and must be installed/enabled.
25
+
- Provides a native OpenClaw **memory plugin**via `openclaw.plugin.json` + `dist/openclaw-plugin.js`, plus legacy hook-compatible guidance for older deployments. Native plugin enablement is opt-in.
26
26
-`observe --compress` makes LLM API calls (Gemini Flash by default) to compress session transcripts into observations
27
27
28
28
**Environment variables used:**
@@ -32,25 +32,25 @@ An elephant never forgets. Structured memory for OpenClaw agents.
32
32
33
33
**No cloud sync — all data stays local. No network calls except LLM API for observe compression.**
34
34
35
-
**This is a full CLI tool, not instruction-only.** It writes files, registers hooks, and runs code.
35
+
**This is a full CLI tool, not instruction-only.** It writes files, registers the native OpenClaw memory plugin, and runs code.
36
36
37
-
**Auditability:** the published ClawHub skill bundle includes `SKILL.md`, `HOOK.md`, and `hooks/clawvault/handler.js` so users can inspect hook behavior before enabling it.
37
+
**Auditability:** the published package ships `openclaw.plugin.json` and `dist/openclaw-plugin.js` so users can inspect plugin metadata and runtime behavior before enabling it.
38
38
39
39
## Install (Canonical)
40
40
41
41
```bash
42
42
npm install -g clawvault
43
-
openclaw hooks install clawvault
44
-
openclaw hooks enable clawvault
45
-
46
-
# Verify and reload
47
-
openclaw hooks list --verbose
48
-
openclaw hooks info clawvault
49
-
openclaw hooks check
50
-
# restart gateway process
43
+
openclaw config set plugins.allow '["clawvault"]'
44
+
openclaw config set plugins.slots.memory clawvault
45
+
openclaw config set plugins.entries.clawvault.config.vaultPath ~/my-vault
46
+
openclaw config set plugins.entries.clawvault.config.allowClawvaultExec true
47
+
48
+
# Verify
49
+
openclaw doctor
50
+
clawvault compat
51
51
```
52
52
53
-
`clawhub install clawvault` can install skill guidance, but does not replace explicit hook pack installation.
53
+
`clawhub install clawvault` can install skill guidance, but does not replace explicit native plugin configuration.
node -e "const fs=require('fs');const p='hooks/clawvault/handler.js';console.log(fs.existsSync(p)?p:'hook file not found in current directory')"
70
-
openclaw hooks info clawvault
68
+
# 4) Enable the native memory plugin explicitly
69
+
openclaw config set plugins.allow '["clawvault"]'
70
+
openclaw config set plugins.slots.memory clawvault
71
+
openclaw config set plugins.entries.clawvault.config.vaultPath ~/my-vault
71
72
72
-
# 5) Enable only after review
73
-
openclaw hooks enable clawvault
74
-
openclaw hooks check
73
+
# 5) Verify before working
74
+
openclaw doctor
75
+
clawvault compat
75
76
```
76
77
77
78
## Setup
@@ -104,6 +105,10 @@ clawvault sleep "PR review + type guards" --next "respond to CI" --blocked "wait
104
105
clawvault doctor
105
106
```
106
107
108
+
## Legacy Hook Compatibility
109
+
110
+
If you still operate an older hook-pack-based OpenClaw deployment, treat it as legacy compatibility mode rather than the primary install flow. Prefer the native plugin path above for new installs.
111
+
107
112
## Reality Checks Before Use
108
113
109
114
```bash
@@ -332,7 +337,7 @@ Backups are created automatically (use `--no-backup` to skip).
332
337
-**Inbox backlog warning** — process or archive inbox items
333
338
-**"unexpected tool_use_id" error** — run `clawvault repair-session`
334
339
-**OpenClaw integration drift** — run `clawvault compat`
335
-
-**Hook enable fails / hook not found** — run `openclaw hooks install clawvault`, then `openclaw hooks enable clawvault`, restart gateway, and verify via`openclaw hooks list --verbose`
340
+
-**Plugin not active** — run `openclaw config set plugins.allow '["clawvault"]'`, `openclaw config set plugins.slots.memory clawvault`, confirm `plugins.entries.clawvault.config.vaultPath`, then verify with`openclaw doctor` and `clawvault compat`
336
341
-**Graph out of date** — run `clawvault graph --refresh`
337
342
-**Wrong context for task** — try `clawvault context --profile incident` or `--profile planning`
Copy file name to clipboardExpand all lines: docs/clawhub-security-release-playbook.md
+11-14Lines changed: 11 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# ClawHub Security Release Playbook
2
2
3
-
This playbook captures what kept the ClawHub/OpenClaw security review stable for `clawvault` and what repeatedly caused "suspicious" regressions.
3
+
This playbook captures what kept the ClawHub/OpenClaw security review stable for `clawvault` and what repeatedly caused suspicious regressions.
4
4
5
5
## Goal
6
6
7
-
Keep ClawHub scanner classification at least `Benign` by ensuring bundle metadata, SKILL frontmatter, and shipped files stay consistent.
7
+
Keep ClawHub scanner classification at least `Benign` by ensuring bundle metadata, SKILL frontmatter, plugin manifest metadata, and shipped files stay consistent.
8
8
9
9
## Known-good frontmatter contract
10
10
@@ -19,21 +19,19 @@ For `openclaw` and `metadata.openclaw`, use only documented fields:
19
19
20
20
-`emoji`
21
21
-`requires.bins`
22
-
-`requires.env` (can be `[]` if no required env vars)
23
-
-`install` (installer spec array)
22
+
-`requires.env`
23
+
-`install`
24
24
-`homepage`
25
25
26
-
Avoid non-spec keys inside `openclaw` metadata (for example ad-hoc fields such as `env_optional`), because strict scanners may treat the metadata block as invalid and fall back to "no requirements/install spec".
27
-
28
26
## Bundle composition
29
27
30
28
Always publish a minimal auditable bundle:
31
29
32
30
-`SKILL.md`
33
-
-`hooks/clawvault/HOOK.md`
34
-
-`hooks/clawvault/handler.js`
31
+
-`openclaw.plugin.json`
32
+
-`dist/openclaw-plugin.js`
35
33
36
-
If the hook file is not present in the published bundle, scanners flag a visibility/supply-chain concern.
34
+
If the native manifest or built plugin entrypoint is not present in the published bundle, scanners and operators lose the cheap metadata path that OpenClaw uses for discovery and config validation.
37
35
38
36
## Required pre-publish checks
39
37
@@ -42,7 +40,8 @@ If the hook file is not present in the published bundle, scanners flag a visibil
- human docs in SKILL (`Install (Canonical)`, safe install flow)
44
42
3. Confirm `source` and `homepage` fields are present and accurate.
45
-
4. Confirm hook paths referenced in SKILL exist in the bundle.
43
+
4. Confirm `package.json#openclaw.plugin` and `package.json#openclaw.extensions` point to files that exist in the bundle.
44
+
5. Run `clawvault compat` against the release workspace to verify package metadata, manifest, and extension alignment.
46
45
47
46
## Publish + verify workflow
48
47
@@ -57,8 +56,6 @@ If the hook file is not present in the published bundle, scanners flag a visibil
57
56
58
57
## If scanner regresses
59
58
60
-
If warning text mentions mismatch between registry metadata and SKILL/docs:
61
-
62
59
1. Compare scanner claim to frontmatter values first.
63
60
2. Remove unsupported keys from metadata block.
64
61
3. Re-publish patch version with normalized metadata.
@@ -68,8 +65,8 @@ If warning text mentions mismatch between registry metadata and SKILL/docs:
68
65
69
66
Even with clean metadata, this skill can still receive cautionary language because it:
70
67
71
-
- runs lifecycle hooks,
68
+
- runs lifecycle-aware memory automation,
72
69
- reads/modifies OpenClaw session files,
73
70
- and relies on external CLI packages (`clawvault`, `qmd`).
74
71
75
-
That caution is expected and should be addressed with transparent docs, explicit safe-install guidance, and auditable shipped hook code.
72
+
That caution is expected and should be addressed with transparent docs, explicit safe-install guidance, and auditable shipped plugin metadata/runtime code.
Copy file name to clipboardExpand all lines: docs/openclaw-plugin-usage.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,9 @@ See the [README](../README.md#openclaw-integration) for canonical installation s
8
8
9
9
```bash
10
10
npm install -g clawvault
11
-
openclaw hooks install clawvault
12
-
openclaw hooks enable clawvault
11
+
openclaw config set plugins.allow '["clawvault"]'
12
+
openclaw config set plugins.slots.memory clawvault
13
+
openclaw config set plugins.entries.clawvault.config.vaultPath ~/my-vault
13
14
```
14
15
15
16
## MEMORY.md vs Vault: Understanding the Relationship
@@ -161,7 +162,7 @@ openclaw config set plugins.entries.clawvault.config.maxContextResults 6
161
162
openclaw config set plugins.entries.clawvault.config.contextProfile planning
162
163
```
163
164
164
-
See [HOOK.md](../hooks/clawvault/HOOK.md) for all configuration options.
165
+
The native plugin manifest is shipped at [openclaw.plugin.json](../openclaw.plugin.json). Use `clawvault compat` to verify the package metadata, manifest, and built extension stay aligned.
165
166
166
167
## Workflow Integration
167
168
@@ -202,12 +203,12 @@ If MEMORY.md and vault conflict, instruct the agent to trust `clawvault wake` ou
202
203
203
204
### Context injection not working
204
205
205
-
1. Verify hook is enabled: `openclaw hooks list --verbose`
206
-
2. Check vault path: `openclaw config get plugins.entries.clawvault`
207
-
3. Run compatibility check:`clawvault compat`
206
+
1. Verify the plugin is allowed and selected: `openclaw config get plugins.allow` and `openclaw config get plugins.slots.memory`
207
+
2. Check plugin config: `openclaw config get plugins.entries.clawvault`
0 commit comments