Check ClawHub trust before plugin and skill installs#81364
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reintroduces the ClawHub exact-release trust check in the plugin install/update pipeline, ensuring ClawHub security data is consulted before any ClawHub download and that risky releases require explicit acknowledgement (interactive or via --acknowledge-clawhub-risk), while preserving the existing local dangerous-code scanner behavior.
Changes:
- Add a typed ClawHub package security/trust response parser and wire
fetchClawHubPackageSecurity()intoinstallPluginFromClawHub()as a fail-closed trust gate. - Thread risk-acknowledgement options (
acknowledgeClawHubRisk/onClawHubRisk) through plugin update/sync flows and expose--acknowledge-clawhub-riskonplugins install,plugins update, andopenclaw update. - Update tests and docs to cover the new trust/acknowledgement behavior and CLI surface area.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/plugins/update.ts | Forwards ClawHub risk acknowledgement options through plugin update/sync calls into ClawHub installs. |
| src/plugins/update.test.ts | Adds coverage asserting acknowledgement options are forwarded in dry-run and live update paths. |
| src/plugins/clawhub.ts | Introduces trust fetching + risk classification + acknowledgement gate before ClawHub downloads. |
| src/plugins/clawhub.test.ts | Adds tests for risky vs stale/pending trust behavior and fail-closed security fetch failures. |
| src/infra/clawhub.ts | Reworks security response types and adds runtime parsing/validation for the security endpoint payload. |
| src/infra/clawhub.test.ts | Updates security endpoint tests and adds malformed-response rejection coverage. |
| src/commands/onboarding-plugin-install.ts | Adds an interactive onboarding prompt handler for ClawHub risk acknowledgements. |
| src/commands/onboarding-plugin-install.test.ts | Verifies onboarding passes an onClawHubRisk function into ClawHub install calls. |
| src/commands/doctor/shared/missing-configured-plugin-install.ts | Captures and propagates ClawHub trust warnings into doctor repair warnings output. |
| src/cli/update-cli/update-command.ts | Adds interactive/non-interactive handling and plumbing for risk acknowledgement during post-update plugin work. |
| src/cli/update-cli/shared.ts | Extends update command options with acknowledgeClawHubRisk. |
| src/cli/update-cli.ts | Adds --acknowledge-clawhub-risk option wiring to the update CLI and normalizes commander option casing. |
| src/cli/update-cli.test.ts | Adds tests asserting acknowledgement flag forwarding and propagation into resume/spawn flows. |
| src/cli/plugins-update-command.ts | Wires CLI flag into plugin update runner via shared ClawHub risk acknowledgement option resolver. |
| src/cli/plugins-install-command.ts | Wires CLI flag into explicit ClawHub installs via shared acknowledgement option resolver. |
| src/cli/plugins-cli.update.test.ts | Adds a test verifying plugins update --acknowledge-clawhub-risk forwards into update logic. |
| src/cli/plugins-cli.ts | Adds --acknowledge-clawhub-risk to plugins install/update subcommands and normalizes commander casing. |
| src/cli/plugins-cli.install.test.ts | Adds a test verifying plugins install ... --acknowledge-clawhub-risk forwards into ClawHub install. |
| src/cli/clawhub-risk-acknowledgement.ts | New shared helper to decide whether to prompt vs require explicit acknowledgement for CLI flows. |
| docs/tools/plugin.md | Documents --acknowledge-clawhub-risk for plugins install/update and clarifies semantics. |
| docs/cli/update.md | Documents --acknowledge-clawhub-risk for post-update ClawHub plugin sync. |
| docs/cli/plugins.md | Documents --acknowledge-clawhub-risk for installs/updates with explanatory accordion sections. |
| CHANGELOG.md | Adds a changelog entry describing the restored ClawHub trust check and new acknowledgement flag. |
|
Codex review: needs maintainer review before merge. Reviewed June 26, 2026, 4:19 AM ET / 08:19 UTC. Summary PR surface: Source +2726, Tests +4591, Docs +46, Other +21. Total +7384 across 74 files. Reproducibility: not applicable. this is a security policy/feature PR, not a current-main bug report. The PR supplies terminal screenshot proof for the new blocked and acknowledged CLI paths, and those screenshots were inspected. Review metrics: 3 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this only after maintainers explicitly accept the fail-closed rollout, trusted-source bypass semantics, production ClawHub metadata contract, and persisted/client-contract upgrade behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a security policy/feature PR, not a current-main bug report. The PR supplies terminal screenshot proof for the new blocked and acknowledged CLI paths, and those screenshots were inspected. Is this the best way to solve the issue? Unclear until maintainer sign-off: the shared trust helper is a maintainable implementation shape, but the best rollout depends on owner acceptance of fail-closed behavior, trusted-source bypasses, and production ClawHub metadata support. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9a735bea03f6. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +2726, Tests +4591, Docs +46, Other +21. Total +7384 across 74 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
2f49add to
0a50497
Compare
a12424f to
72eeb99
Compare
9176df8 to
51bb24b
Compare
395d20d to
0412c78
Compare
2d15333 to
f47d460
Compare
19e4880 to
288b308
Compare
288b308 to
d04764c
Compare
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Merged via squash.
|
Summary
OpenClaw now checks ClawHub trust before installing or updating community plugins and skills, and blocks malicious or ClawHub-blocked releases before download. Suspicious community releases require explicit acknowledgement.
Official ClawHub publishers and bundled OpenClaw sources bypass ClawHub risk prompts and built-in install friction. That covers official ClawHub plugins, ClawHub skills whose publisher metadata includes
owner.official: true(the NVIDIA fixture proves this path), and bundled OpenClaw plugins/skills such asopenclaw/kitchen-sinkandpeekaboo. Operator-ownedsecurity.installPolicystill runs for these sources so local admin allow/block policy is preserved.What Changed
channel: "official"/isOfficial: truesources install/update without ClawHub risk prompts, dependency-denylist scans, or before-install hooks. Operatorsecurity.installPolicystill runs.owner.official: true,owner.channel: "official",owner.isOfficial: true,skill.channel: "official", orskill.isOfficial: truemarks the default ClawHub skill source as official. The gatewayskills.detailschema now preserves those fields for clients.security.installPolicystill runs.Behavior Matrix
--acknowledge-clawhub-risk.security.installPolicystill runs; dependency-denylist and before-install hook friction is bypassed.security.installPolicystill runs; dependency-denylist and before-install hook friction is bypassed.security.installPolicystill runs; dependency-denylist and before-install hook friction is bypassed.Proof
Behavioral proof at PR head
491b6d1d525fdad51f5d2d5d1eb52c64fbf8825c:--acknowledge-clawhub-riskthe same release installs or updates.channel: "official"/isOfficial: true; install succeeds with no ClawHub warning, while operator policy remains callable and built-in denylist/hook friction is skipped.owner: { handle: "nvidia", displayName: "NVIDIA", official: true }fortao-setup-nvidia-gpu-host; the test asserts ClawHub security verdicts are not fetched and the install source is recorded as{ kind: "clawhub", authority: "official", mutable: false, network: true }.openclaw/kitchen-sinkplugin and bundledpeekabooskill fixtures assert operator install policy is still called once, while dependency-denylist and before-install hook surfaces are not called.SkillsDetailResultSchemanow accepts the official skill/publisher metadata fields, so schema-validating gateway clients can receive the same trust signal that the install/update path consumes./verifySkill Card-only failures such ascard.missingas non-security metadata when the security status is clean, so clean owner-qualified skills do not require risk acknowledgement only because a generated Skill Card is missing.card.missingcompatibility path is accepted, so--acknowledge-clawhub-riskcannot turn a missing exact-release verdict into an install.security.installPolicywhile bypassing only ClawHub risk prompts and built-in dependency/hook friction.Production ClawHub rollout note:
owner.official. This OpenClaw PR consumes and preserves the field; ClawHub must expose it on skill detail/search responses for live official skill publishers to bypass friction in production.Screenshots
These GitHub-hosted terminal screenshots are visual proof for the CLI prompt and block/acknowledgement states. The local proof generator was rerun at current PR head and regenerated the same 16-scenario transcript set; the images below remain the reviewer-visible screenshots for those states.
Plugin install screenshots
Plugin malicious release blocked before download
Plugin suspicious release blocked without acknowledgement
Plugin suspicious release succeeds with acknowledgement
Plugin community clean install succeeds
Plugin official/source-linked clean install succeeds
Skill install screenshots
Skill malicious release blocked before download
Skill suspicious release blocked without acknowledgement
Skill suspicious release succeeds with acknowledgement
Skill community clean install succeeds
Skill official/source-linked clean install succeeds
Plugin update screenshots
Plugin update blocks malicious latest release
Plugin update blocks suspicious latest release without acknowledgement
Plugin update allows suspicious latest release with acknowledgement
Skill update screenshots
Skill update blocks malicious latest release
Skill update blocks suspicious latest release without acknowledgement
Skill update allows suspicious latest release with acknowledgement
Verification
Reviewer-checkable behavior:
user-attachmentsscreenshots through the normal PR comment attachment UI. The local transcript/screenshot generator was rerun at the current head; the visible terminal states remain the same for the screenshot-covered scenarios.Latest-head automated checks:
node .artifacts/clawhub-install-trust/run-proof.cjspassed at PR head491b6d1d525fdad51f5d2d5d1eb52c64fbf8825cand regenerated the 16-scenario plugin/skill trust command transcript.node scripts/run-vitest.mjs src/plugins/install-security-scan.runtime.test.ts src/plugins/clawhub.test.ts src/skills/lifecycle/clawhub.test.ts packages/gateway-protocol/src/schema/agents-models-skills.test.tspassed: 170 tests across 2 shards. This is the final official/bundled bypass proof for bundled OpenClaw plugin/skill sources, official ClawHub plugins, NVIDIA-shaped official ClawHub skill publishers, and the gateway metadata schema.node scripts/run-vitest.mjs src/cli/update-cli.test.ts src/cli/clawhub-risk-acknowledgement.test.ts src/cli/skills-cli.commands.test.ts src/cli/plugins-cli.install.test.ts src/cli/plugins-cli.update.test.ts src/commands/onboarding-plugin-install.test.tspassed after conflict resolution: 446 tests across 2 shards.node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfopassed.node scripts/run-oxlint-shards.mjs --threads=8passed after the channel response type cleanup.git diff --check HEADpassed.491b6d1d525fdad51f5d2d5d1eb52c64fbf8825c; current base isorigin/main 81e53202f25f.Earlier broader proof on this PR branch (before the rebase replay; latest-head focused proof above covers the conflict-touched and official/bundled install-bypass surfaces):
node scripts/run-vitest.mjs src/plugins/install-security-scan.runtime.test.tspassed: 6 tests.node scripts/run-vitest.mjs packages/gateway-protocol/src/schema/agents-models-skills.test.ts src/gateway/server-methods/skills.search-detail.test.ts src/gateway/server-methods/skills.clawhub.test.ts src/cli/plugins-cli.install.test.ts src/plugins/install-security-scan.runtime.test.ts src/plugins/clawhub.test.ts src/skills/lifecycle/clawhub.test.ts ui/src/ui/controllers/skills.test.ts ui/src/ui/views/skills.test.tspassed: 373 tests across 5 shards.node scripts/run-vitest.mjs src/cli/clawhub-risk-acknowledgement.test.ts src/cli/plugins-cli.update.test.ts src/cli/skills-cli.commands.test.ts src/cli/update-cli.test.ts src/commands/doctor/shared/missing-configured-plugin-install.test.ts src/commands/onboarding-plugin-install.test.ts src/plugins/update.test.ts src/cli/update-cli/post-core-plugin-convergence.test.ts src/commands/codex-runtime-plugin-install.test.tspassed: 497 tests across 4 shards.node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src.tsbuildinfopassed.pnpm docs:listpassed after the docs scope update.pnpm docs:check-mdxpassed: 680 files.pnpm docs:check-linkspassed: 4,561 internal links, 0 broken links.pnpm format:docs:checkpassed: 665 files.Not run:
pnpm checkand Crabbox/Testbox were not rerun in this checkout.owner.officialon skill metadata responses.