feat(plugin): add OpenClaw install gate - #35
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Codex review: found issues before merge. Reviewed July 29, 2026, 4:12 PM ET / 20:12 UTC. ClawSweeper reviewWhat this changesThis PR adds an Merge readinessKeep this member-authored draft open. The plugin’s central security promise depends on OpenClaw cold discovery of Likely related people: Priority: P2 Review scores
Verification
How this fits togetherClawScan runs configured scanners and emits a versioned gate artifact describing the scan result. The proposed OpenClaw plugin would register an install hook, invoke ClawScan on the staged installation candidate, and turn trustworthy artifact results into installation decisions. flowchart LR
Candidate[Staged skill or plugin] --> Hook[OpenClaw before-install hook]
Hook --> Plugin[ClawScan install-gate plugin]
Plugin --> Scan[ClawScan scanner run]
Scan --> Artifact[Versioned gate artifact]
Artifact --> Gate[Allow, warn, or block]
Gate --> Install[OpenClaw install or update]
Decision needed
Why: The PR intentionally depends on external host behavior that its current semver range does not prove is available, so maintainers must choose the supported release boundary before this security feature can be published. Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch is security-conscious, but its current host-version declaration can expose users to a non-invoked install gate and therefore an unenforced security boundary. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Wait for the cold Do we have a high-confidence way to reproduce the issue? No current released-host reproduction is available. Source and the PR’s own compatibility statement establish a high-confidence path: install this plugin on an allowed host lacking cold Is this the best way to solve the issue? No. The plugin architecture is a reasonable direction, but publishing against a broad host range before the required hook contract is released is not a safe solution; the minimum host version and end-to-end proof must follow the released contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ef760b176da7. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
f0a2669 to
735c244
Compare
|
/clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
What Problem This Solves
OpenClaw can enforce ClawScan policy before installing or updating a staged skill or plugin. The plugin maps trustworthy ClawScan artifacts to the host hook contract: pass continues silently, warnings become structured findings, blocks stop installation, and scanner/process/artifact failures fail closed.
Why This Change Was Made
ClawScan's declarative JSON gate policy had no OpenClaw runtime adapter. This adds a separate
@openclaw/clawscan-pluginpackage so loading the hook never imports the CLI wrapper's process-spawning code. It uses OpenClaw's bounded runtime command API and an exact-version dependency on the matching binary package.Runtime flow:
before_installprovider.clawscan-staticin Docker, or visibly degrades to static-only scanning when Docker is unavailable.clawscan-run-v1artifact and every selected scanner result.User Impact
openclaw plugins install @openclaw/clawscan-pluginexplicitly trusts and enables this config-free plugin. Alternate placement requiresopenclaw plugins enable clawscanand inclusion inplugins.allowwhen that allowlist is configured.activation.onHooks: ["before_install"]andactivation.onCapabilities: ["hook"].clawscan-staticin Docker. Ambient model-provider configuration and credentials are scrubbed before the scan command starts. SkillSpector still sends dependency names to OSV.dev for CVE lookup.Evidence
The packed release smoke built both scoped tarballs, installed them together, loaded the compiled plugin runtime, confirmed the plugin's exact
@openclaw/clawscanversion, resolved the packaged manifest/profile, and ran the installed CLI against the repository README.The final net diff contains 22 files with no branch-only churn. Review fixes preserve actionable scanner evidence, map production fired-rule fields to bounded host findings, fail closed on ambiguous npm publish-state responses, declare the narrow host activation hook, and prevent provider credentials from entering the scanner container.
Security / Trust Impact
Untrusted source material never controls config discovery. The plugin resolves explicit shipped and operator-configured paths through
api.resolvePath, compares their resolved identities before applying shipped-profile guarantees, forcesCLAWSCAN_SKILLSPECTOR_LLM=0, clears SkillSpector provider/model/key variables inherited from OpenClaw, bounds command output and returned finding fields, rejects incomplete or schema-incompatible scanner evidence, and blocks on malformed artifacts or expected execution failures.Checks
TMPDIR=/private/tmp go test -count=1 ./...TMPDIR=/private/tmp go vet ./...actionlinton all changed workflowsnode scripts/build-npm-package.mjs --version v0.0.0 --pack --smokemake release VERSION=v0.0.0-testgit diff --checkd8e57e3, head373a534, 22 net changed files, no branch-only churnfailed; the added manually triggered CI workflow requires both scanners to complete and the gate to pass.Implementation Notes
This is stacked on
jesse/openclaw-native-gate-policyatd8e57e3. OpenClaw host support is tracked in openclaw/openclaw#115197. Before the first registry release,@openclaw/clawscan-pluginmust receive the repository's documented one-time npm bootstrap publication sorelease.ymlcan become its sole trusted publisher.The PR remains draft because the stacked ClawScan policy and OpenClaw host PRs are not merged, the external npm bootstrap is outstanding, and the full local Docker self-scan is blocked by Docker storage.