Skip to content

improve: warn before non-ClawHub plugin installs - #102197

Merged
jesse-merhi merged 47 commits into
mainfrom
jesse/non-clawhub-untrusted-installs
Jul 14, 2026
Merged

jesse-merhi merged 47 commits into
mainfrom
jesse/non-clawhub-untrusted-installs

Conversation

@jesse-merhi

@jesse-merhi jesse-merhi commented Jul 8, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Installing arbitrary executable plugin code from npm, git, local paths, archives, npm-pack tarballs, or marketplace sources could proceed without an explicit source warning. Trusted OpenClaw-controlled sources and existing update flows should remain frictionless.

Why This Change Was Made

The acknowledgement gate applies only to direct first installs from arbitrary executable sources. Trust comes from OpenClaw-owned facts: ClawHub resolution, bundled plugin metadata (ID, local path, and npm package), and official catalog ID/package mappings. It is never inferred from a package-name prefix alone.

Provider selection and repair, doctor repair, setup/onboarding, updates, post-update convergence, macOS Codex onboarding, and other owner-controlled install paths remain trusted flows and do not receive this gate.

Crestodian follows an intentionally narrower rule: it can install only ClawHub, bundled, or official-catalog plugins. It refuses arbitrary executable sources before creating an approval proposal or invoking the installer and directs the operator to openclaw plugins install <spec> in a trusted shell.

User Impact

  • Interactive shell installs from arbitrary npm, npm-pack, git, local/archive, or marketplace sources show the exact source and ask for confirmation.
  • Noninteractive direct installs from those sources require --force.
  • --force confirms the source and keeps its existing overwrite meaning. With --link, it confirms the source without changing link/install mode.
  • --force does not bypass security.installPolicy or the remaining install safety checks.
  • ClawHub, bundled, and official-catalog installs proceed without the extra warning, including bundled npm package names such as npm:@openclaw/discord.
  • Existing tracked plugin updates proceed without the extra warning.
  • Chat installs accept ClawHub and OpenClaw-trusted packages normally. Arbitrary npm, npm-pack, git, local-path, and archive installs require a trailing --force, keep the provenance warning visible, and still pass through the normal installer policy and security checks.
  • Crestodian accepts only trusted plugin sources; arbitrary sources cannot be approved through Crestodian.
  • Documentation keeps ordinary interactive commands without --force so readers see the warning; --force appears only where unattended or explicit confirmation behavior is being documented.

What Changed

  • Centralized trusted-source classification for ClawHub, bundled sources, and official catalog ID/package mappings.
  • Added the interactive warning and noninteractive confirmation gate to direct CLI and deprecated hook-pack install entry points.
  • Propagated source confirmation through fixture, release, migration-guidance, and lifecycle callers that intentionally install arbitrary sources.
  • Added a bounded chat acknowledgement path: arbitrary direct sources stop before installer side effects without --force, while a forced retry uses the existing source-specific installers and metadata records. Crestodian remains trusted-source-only.
  • Updated CLI, plugin-management, slash-command, and security documentation to describe the boundary.

Net diff against the PR base: 42 files, 2,068 additions, 770 deletions. Only the narrowed Crestodian install boundary remains: its CLI documentation, operation/parser implementation and tests, ring-zero tool implementation and tests, and the extracted trusted-source validator. The earlier broad Crestodian rewrite is no longer part of this PR's net diff.

Evidence

Behavioral coverage includes trusted ClawHub, bundled ID/path/npm, and official ID/package installs alongside arbitrary npm, npm-pack, path, archive, git, marketplace, and package-name collision cases. Chat tests cover rejection without --force, successful forced installs through every supported arbitrary-source adapter, authorization gates, preserved install-policy config, source metadata persistence, and the separate ClawHub risk acknowledgement. Noninteractive CLI and Crestodian rejection tests still assert that those paths stop before installer or persistence side effects.

Terminal Screenshots

Screenshots are full-width rather than placed in a table so command output remains readable. Capture 6 was produced on the pre-merge chat implementation and rechecked against exact current head 181fabb4b2e19c30cb5ea6c4e8191667b3cab569; the merge and subsequent module extraction did not change its decisions. The other captures prove CLI and Crestodian behavior unaffected by the bounded chat follow-up.

1. Interactive arbitrary-source warning

A direct interactive install from an arbitrary local path displays the source warning and asks for confirmation before executing plugin code.

Interactive arbitrary-source warning

What this shows: The exact source and trust warning are visible before the user chooses whether to continue.

State: Isolated terminal install fixture; full-width crop preserves the warning and prompt.

2. Noninteractive arbitrary-source rejection

The same arbitrary install is rejected without a TTY and points to the shorter --force confirmation flag.

Noninteractive arbitrary-source rejection

What this shows: A noninteractive arbitrary local install stops and gives the exact --force recovery command.

State: Exact head a9699683d900, isolated state directory on Blacksmith Testbox tbx_01kxfc7ebma8fnmky5fvsqr4b4; full-width terminal transcript crop.

3. Force-confirmed install

An arbitrary local-path install succeeds when --force is supplied.

Force-confirmed arbitrary-source install

What this shows: The warning remains visible, then the reviewed plugin installs successfully under the shorter flag.

State: Exact head a9699683d900, isolated state directory on Blacksmith Testbox tbx_01kxfc7ebma8fnmky5fvsqr4b4; full-width terminal transcript crop.

4. Trusted bundled install

Bundled @openclaw/discord installs without a warning or confirmation flag.

Trusted bundled install

What this shows: OpenClaw-owned bundled package metadata bypasses the extra provenance prompt.

State: Isolated terminal install fixture; full-width crop preserves the complete command result.

5. Existing tracked plugin update

An already-tracked local-path plugin update remains frictionless and does not ask for confirmation again.

Tracked plugin update

What this shows: A tracked update follows the existing update path without a new first-install warning.

State: Isolated state directory with an existing install record; full-width terminal crop.

6. Chat install trust boundary

The real chat command handler blocks an arbitrary npm package without acknowledgement, installs the same package when the user appends --force, and still installs an OpenClaw-trusted package without extra friction.

Chat install trust boundary: blocked without force, forced third-party install, and trusted OpenClaw install

What this shows: Without --force, the arbitrary package is refused before installer side effects and the reply gives the exact retry. With --force, the same source installs in replacement mode while remaining classified as third-party and keeping the warning visible. The OpenClaw-trusted package still installs without the flag.

State: Captured from head 96e4ab2e9a4 on Blacksmith Testbox tbx_01kxff43r02jnzz9r2qsmqpxt5 using real handlePluginsCommand replies; rechecked on exact current head 181fabb4b2e1 by the 28-test chat install shard. The full-width crop keeps all three decisions readable.

7. Crestodian trusted-only boundary

The parser blocks an arbitrary npm package before proposal or installer execution and accepts the bundled Discord package as a typed plugin install.

Crestodian trusted-only boundary

What this shows: Crestodian remains a trusted-source-only surface rather than an approval path for arbitrary executable code.

State: Exact behavior from the narrowed Crestodian boundary; full-width terminal test crop.

Verification

  • Blacksmith Testbox tbx_01kxfattj7jd8yr0pnf83j3k3m: 382 focused tests passed across four Vitest shards, covering CLI, deprecated hooks, chat installs, and Docker/release scripts.
  • Blacksmith Testbox tbx_01kxfc7ebma8fnmky5fvsqr4b4: actual CLI help exposes one --force; an arbitrary install rejects without it and succeeds with it. The remaining database, sidecar, import-cycle, webhook, and pairing guards passed after the first long-running lease completed.
  • Blacksmith Testbox tbx_01kxff43r02jnzz9r2qsmqpxt5 on head 96e4ab2e9a4: 34 focused chat install/management tests passed; the three-case real-handler proof harness passed; core and core-test tsgo, targeted oxlint, and the 699-file Markdown lint passed.
  • Blacksmith Testbox tbx_01kxfmvybjyc351g83ybvkjgqk on the pre-merge feature tree: 129 focused tests passed across chat installs, Crestodian operations/tooling, and the deprecated hooks alias. The changed-file gate passed conflict markers, the TypeScript LOC ratchet, formatting, SDK/package guards, and all five typecheck lanes before the Testbox's own temporary Node binary disappeared mid-lint.
  • Fresh Blacksmith Testbox tbx_01kxfnznqpheqsmd310hx28498: exact changed-TypeScript lint passed across 22 files with zero warnings and zero errors after the expired runner was replaced.
  • Blacksmith Testbox tbx_01kxgqrd66gy7ajcmdv8hdqwpg on exact current head 181fabb4b2e1: 314 focused tests passed across CLI install planning/behavior, chat installs, Crestodian operations/tooling, and the deprecated hooks alias; the exact unused-export gate also passed.
  • git diff --check and targeted oxfmt passed.
  • .agents/skills/autoreview/scripts/autoreview --mode uncommitted --engine codex --model gpt-5.6-sol --thinking codex=high --stream-engine-output completed on the final extraction with no accepted or actionable findings (0.99 confidence). The whole merged PR tree had already completed the same Codex-high review loop cleanly. No Claude reviewer and no xhigh reasoning were used.
  • Earlier focused Crestodian proof on Testbox tbx_01kxab98a25wmqv7qknqz0hvg4 passed 94 tests across its operation and ring-zero tool shards.

No graphical product UI changed; the requested visual proof is terminal-only.

@jesse-merhi
jesse-merhi requested a review from a team as a code owner July 8, 2026 13:56
Copilot AI review requested due to automatic review settings July 8, 2026 13:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes security Security documentation size: L maintainer Maintainer-authored PR labels Jul 8, 2026
@clawsweeper

clawsweeper Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 14, 2026, 8:23 AM ET / 12:23 UTC.

Summary
The PR centralizes plugin-source trust classification, adds acknowledgement gates for arbitrary executable installs in CLI and chat flows, restricts Crestodian installs to trusted sources, and updates related documentation and validation fixtures.

PR surface: Source +338, Tests +922, Docs +38, Other 0. Total +1298 across 42 files.

Reproducibility: not applicable. This PR introduces a new install-consent and trusted-source policy rather than repairing behavior already defined as broken.

Review metrics: 3 noteworthy metrics.

  • Acknowledgement surfaces: 3 user-facing surfaces changed. CLI, chat commands, and Crestodian now enforce related but deliberately different executable-source trust rules.
  • Arbitrary source classes: 6 classes gated. npm, npm-pack, git, local path/archive, and marketplace installs now require acknowledgement outside trusted mappings.
  • Public flag semantics: 1 existing flag broadened. --force changes from replacement authorization to both provenance acknowledgement and replacement behavior.

Stored data model
Persistent data-model change detected: persistent cache schema: src/plugins/bundled-install.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Obtain explicit plugin-install/security owner approval for the trust taxonomy and --force upgrade semantics.
  • [P2] Refresh onto current main and rerun focused exact-head proof, including the required direct Codex-source check.

Risk before merge

  • [P1] Existing unattended npm, git, local-path, archive, npm-pack, and marketplace first-install workflows will stop until callers add --force, making this an intentional compatibility break requiring owner approval.
  • [P1] The existing --force flag gains two meanings—source acknowledgement and overwrite—which may create lasting CLI ambiguity for users and integrations.
  • [P1] The classifier establishes a security boundary where ClawHub, bundled metadata, and official-catalog mappings bypass the warning; maintainers must explicitly own that taxonomy and its future maintenance.
  • [P1] The branch is behind current main, so exact-head conflict resolution and focused proof must be refreshed before landing.
  • [P1] The Codex migration-guidance touch still requires the repository-mandated direct sibling Codex-source confirmation before merge.

Maintainer options:

  1. Approve and land the trust contract (recommended)
    Merge after a plugin-install/security owner explicitly accepts the trusted-source taxonomy, dual-purpose --force behavior, exact-head refresh, and Codex check.
  2. Split consent from replacement
    Revise the public interface to use a dedicated source-acknowledgement flag while preserving the established overwrite meaning of --force.
  3. Pause the policy change
    Keep current install behavior until maintainers agree on a stable trust taxonomy and unattended-upgrade contract.

Next step before merge

  • Route this PR to a plugin-install/security owner for the permanent trust-boundary and public CLI compatibility decision, followed by exact-head validation.

Maintainer decision needed

  • Question: Should arbitrary executable plugin sources fail closed without acknowledgement while ClawHub, bundled metadata, and official-catalog mappings bypass the warning, with --force serving as both acknowledgement and overwrite authorization?
  • Rationale: This deliberately changes a shipped CLI and automation contract while defining which executable sources OpenClaw treats as trusted, so implementation correctness cannot substitute for owner intent.
  • Likely owner: steipete — Recent current-main history most strongly connects this person to plugin installation security, lifecycle, and review decisions.
  • Options:
    • Approve the proposed boundary (recommended): Adopt the centralized taxonomy and dual-purpose --force contract after an exact-head refresh and required Codex-source check.
    • Separate acknowledgement from overwrite: Keep the centralized taxonomy but introduce a dedicated provenance acknowledgement flag so --force retains its existing replacement meaning.
    • Defer fail-closed enforcement: Limit the change to warnings until maintainers choose a permanent cross-surface trust and noninteractive-install contract.

Security
Cleared: No concrete patch-level security or supply-chain regression was found; the implementation blocks side effects before acknowledgement and does not bypass existing install-policy checks.

Review details

Best possible solution:

Retain the centralized classifier and pre-side-effect gates, but merge only after a plugin-install/security owner approves the trust taxonomy and flag semantics, the branch is refreshed onto current main, and the Codex-specific guidance gate is satisfied.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR introduces a new install-consent and trusted-source policy rather than repairing behavior already defined as broken.

Is this the best way to solve the issue?

Unclear pending owner intent: centralized classification and pre-side-effect rejection are maintainable, but the permanent trust taxonomy and reuse of --force are product and security contract choices.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 244401317507.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is normal-priority security hardening with broad but bounded impact on plugin installation workflows.
  • merge-risk: 🚨 compatibility: Existing unattended arbitrary-source installs fail until callers add --force, and the existing flag's public meaning changes.
  • merge-risk: 🚨 security-boundary: The PR determines which executable plugin sources bypass warnings and which require acknowledgement or are refused.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The supplied terminal screenshots and exact-head Testbox evidence directly demonstrate the changed CLI, chat-handler, trusted-source, update, and Crestodian behavior after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied terminal screenshots and exact-head Testbox evidence directly demonstrate the changed CLI, chat-handler, trusted-source, update, and Crestodian behavior after the fix.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The supplied terminal screenshots and exact-head Testbox evidence directly demonstrate the changed CLI, chat-handler, trusted-source, update, and Crestodian behavior after the fix.
Evidence reviewed

PR surface:

Source +338, Tests +922, Docs +38, Other 0. Total +1298 across 42 files.

View PR surface stats
Area Files Added Removed Net
Source 16 817 479 +338
Tests 12 1172 250 +922
Docs 6 57 19 +38
Config 0 0 0 0
Generated 0 0 0 0
Other 8 22 22 0
Total 42 2068 770 +1298

What I checked:

  • Current main behavior: Current main still treats --force as replacement behavior, rejects its use with --link, and has no equivalent arbitrary-source acknowledgement gate, so the PR remains materially necessary if maintainers approve the policy. (src/cli/plugins-install-command.ts:1373, 244401317507)
  • Central trust classifier: The PR introduces one shared classifier based on ClawHub resolution, bundled metadata, and official-catalog mappings rather than package-name prefixes alone. (src/plugins/install-provenance.ts:1, 46c15fbb8f14)
  • CLI acknowledgement gate: Interactive arbitrary-source installs warn and prompt, while noninteractive installs fail before execution unless acknowledged with --force. (src/cli/non-clawhub-install-acknowledgement.ts:14, 46c15fbb8f14)
  • Chat acknowledgement boundary: The chat parser accepts only a trailing --force, and the extracted install handler rejects arbitrary sources before installer or persistence side effects when acknowledgement is absent. (src/auto-reply/reply/plugins-commands.ts:43, 46c15fbb8f14)
  • Crestodian boundary: Crestodian validates plugin specifications before proposals or execution and permits only ClawHub, bundled, or official-catalog sources. (src/crestodian/plugin-install.ts:3, 46c15fbb8f14)
  • Upgrade-sensitive contract: The PR broadens the existing --force flag from overwrite behavior to provenance acknowledgement and makes unattended arbitrary-source first installs fail closed without it. (src/cli/plugins-cli.ts:173, 46c15fbb8f14)

Likely related people:

  • steipete: Recent current-main history connects this person to plugin installation security, allowlist handling, and lifecycle behavior across the central install command and tests. (role: recent plugin install reviewer and merger; confidence: high; commits: 0608fe3e8, 7d2b092e8, 6bcfe43a1; files: src/cli/plugins-install-command.ts, src/cli/plugins-cli.install.test.ts, src/plugins/install-security-scan.ts)
  • vincentkoc: Recent history connects this person to install planning, fallback resolution, and related plugin installation tests on current main. (role: recent plugin install contributor; confidence: medium; commits: ad2517437, bab403b48, caba69bf1; files: src/cli/plugin-install-plan.ts, src/cli/plugins-install-command.ts, src/cli/plugins-cli.install.test.ts)
  • shakkernerd: Recent merged work touched plugin install command behavior, lifecycle handling, and adjacent regression coverage. (role: adjacent plugin lifecycle contributor; confidence: medium; commits: a48ab6b1b, be1d1d415, c19cf7113; files: src/cli/plugins-install-command.ts, src/cli/plugins-cli.install.test.ts, src/plugins/install.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (36 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-11T15:02:22.302Z sha 7cc844d :: needs maintainer review before merge. :: none
  • reviewed 2026-07-11T15:20:19.253Z sha 7cc844d :: needs maintainer review before merge. :: none
  • reviewed 2026-07-11T15:27:53.081Z sha 7cc844d :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T05:28:25.603Z sha 5ddf3ba :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T10:34:45.925Z sha 46c15fb :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T10:57:06.431Z sha 46c15fb :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T11:18:52.655Z sha 46c15fb :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T11:50:43.651Z sha 46c15fb :: needs maintainer review before merge. :: none

@jesse-merhi jesse-merhi self-assigned this Jul 8, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 8, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: googlechat Channel integration: googlechat channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: tlon Channel integration: tlon channel: zalo Channel integration: zalo channel: zalouser Channel integration: zalouser labels Jul 8, 2026
…rusted-installs

# Conflicts:
#	docs/cli/crestodian.md
#	src/agents/tools/crestodian-tool.test.ts
#	src/agents/tools/crestodian-tool.ts
#	src/crestodian/operations.test.ts
#	src/crestodian/operations.ts
…rusted-installs

# Conflicts:
#	src/agents/tools/crestodian-tool.ts
#	src/cli/hooks-cli.test.ts
#	src/plugins/bundled-sources.ts
@jesse-merhi

Copy link
Copy Markdown
Member Author

Merged via squash.

Thanks @jesse-merhi!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes docs Improvements or additions to documentation extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security Security documentation size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants