Skip to content

fix(claws): stop plugin installs when capability review changes - #147280

Open
giodl73-repo wants to merge 6 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/claw-plugin-consent
Open

giodl73-repo wants to merge 6 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/claw-plugin-consent

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes two fail-closed gaps in Claw-managed plugin installation:

  1. A Claw add preview could calculate effective grants from the loaded OpenClaw config, then apply without passing that config and reject an unchanged plan.
  2. Canonical installer exemptions for trusted official artifacts or current prior acceptance could skip the Claw plan owner's final capability comparison.

User Impact

Claw add and update now bind package identity, integrity, the complete declared capability surface, and effective grants to the reviewed plan. Apply uses the same loaded config as preview, independently re-probes the artifact, and requires the Claw owner callback even when ordinary plugin consent would be exempt.

Changed or revoked grants, changed declared capabilities, malformed evidence, or a denied owner review stop installation before final persistence. Direct plugin installation behavior is unchanged.

Why This Change Was Made

Claw plans need to cover channels, providers, tools, contracts, hooks, MCP servers, CLI surfaces, skills, dangerous config flags, and hook-sensitive effective grants. Preview records and hashes that evidence; apply revalidates it and only acknowledges canonical installer consent when the staged artifact review token and grants exactly match.

This adds an internal plugin-install callback, onPluginArtifactInspect, so Claw planning can inspect staged bytes before dry-run cleanup. Owner confirmation requested from @steipete / the plugin installer owner because this is a new semi-public installer seam.

The existing commit-time installer callback remains the final mutation boundary, including post-callback staged-artifact reinspection to close TOCTOU.

Evidence

  • Linux Claw package, provenance, runtime handoff, and package-update regressions: 75/75 passed.
  • Linux Claw CLI add/config propagation and inspect regressions: 38/38 passed.
  • Linux plugin capability-consent and managed-install suites: 52/52 passed.
  • Explicit denial proof:
    • Changed effective grants are rejected before plugin completion.
    • A trusted official artifact skips ordinary consent in the control case, but the identical clawManaged install invokes the owner callback, rejects denial, and never persists.
    • A previously accepted non-widening update still invokes the required Claw owner review.
  • All changed TypeScript files pass formatting and type-aware oxlint; git diff --check passes.
  • Independent correctness re-review: no blocking findings after correcting the official-exemption fixture.
  • Independent security review: no security vulnerabilities found.
  • Full deterministic travel-concierge public-lifecycle proof passed: inspect, preview, add, run, status, update, doctor, export, remove, final absence, and user-owned-state preservation.
  • The first removal attempt is retained as an infrastructure retry after Gateway reload convergence timed out; one bounded fresh retry passed.
  • The lifecycle proof used synthetic fixtures and a local OpenAI-compatible mock labeled openai/gpt-5.6-luna; it is not provider-live evidence and incurred no provider cost.

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: L maintainer Maintainer-authored PR labels Sep 13, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 14, 2026, 12:02 AM ET / 04:02 UTC (Revision 4).

ClawSweeper review

What this changes

Claw agent-package previews now record plugin capabilities and grants, and installation rejects changes to that reviewed evidence.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open: current main still lacks this consent binding, and both earlier code findings are addressed. No new actionable defect was found; installer-contract approval and final-effect authority proof remain unresolved.

Priority: P2
Reviewed head: 25f08a27d7692f871d4bdf1b7602c696191b991b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch addresses prior findings and adds meaningful filesystem coverage, but its complete authority boundary remains unproven.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: the reported lifecycle run and new real-filesystem archive tests are useful, but they do not demonstrate the Claw coordinator’s changed/revoked-grant rejection through the managed artifact and installation-record commits. The new tests directly wire the consent handler; the managed-install denial coverage mocks persistence. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: the reported lifecycle run and new real-filesystem archive tests are useful, but they do not demonstrate the Claw coordinator’s changed/revoked-grant rejection through the managed artifact and installation-record commits. The new tests directly wire the consent handler; the managed-install denial coverage mocks persistence. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 8 items Current main still needs the change: Fetched main retains the ordinary official/current-acceptance exemptions and the generic CLI consent callback; it does not contain this branch’s Claw-specific capability comparison.
Introduced authority boundary: The Claw installer compares the reviewed capability token and grants before acknowledging consent. Managed installation requires this callback for clawManaged requests, including otherwise exempt artifacts.
Earlier findings addressed: The add CLI passes its loaded config to preview and apply. Plugin preflight now returns installedPath, isolated capability inspection consumes that path, and package-update conflict promotion preserves it. These address the two concrete findings retained in the previous review.
Findings None None.
Security None None.

How this fits together

Claws package an agent’s workspace and shared requirements. Their preview and apply flow sends plugin requirements through OpenClaw’s canonical installer, which publishes artifacts and records installation state.

flowchart TD
  A[Claw package and operator config] --> B[Inspect plugin artifact]
  B --> C[Review capabilities and grants]
  C --> D[Confirm exact plan]
  D --> E[Installer compares staged evidence]
  E -->|Matches| F[Commit artifact and installation record]
  E -->|Changed or denied| G[Stop and request new preview]
Loading

Decision needed

Question Recommendation
Should the installer expose this dry-run artifact inspection callback and require Claw-owner acknowledgment even for otherwise consent-exempt installs? Approve the narrow installer contract: Approve metadata-only dry-run inspection and mandatory Claw review, subject to the outstanding final-effect and existing-install proof.

Why: The PR explicitly requests confirmation of a new installer seam and its authority contract; source review cannot supply that ownership decision.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: the reported lifecycle run and new real-filesystem archive tests are useful, but they do not demonstrate the Claw coordinator’s changed/revoked-grant rejection through the managed artifact and installation-record commits. The new tests directly wire the consent handler; the managed-install denial coverage mocks persistence. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The new dry-run inspection callback extends the installer contract; the requested owner confirmation remains outstanding, including how existing Claw update and resume flows handle newly required evidence.
  • Resolve merge risk (P1) - The automatic Claw acknowledgment crosses an installation-authority boundary, but recorded evidence does not yet show actual changed or revoked grants preventing both artifact publication and installation-record commits through the complete managed path.
  • Complete next step (P2) - Obtain installer-owner confirmation and add final-effect authority evidence before merge. Redacted terminal output or logs are sufficient; screenshots or recordings may help when they show the result. Remove secrets, private endpoints, and personal data. Updating the PR body should trigger re-review; otherwise ask a maintainer to comment @clawsweeper re-review.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +266, Tests +867. Total +1133 across 40 files.

View PR surface stats
Area Files Added Removed Net
Source 20 412 146 +266
Tests 20 917 50 +867
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 40 1329 196 +1133

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net +266 lines; tests and test support net +867 lines Production growth supports capability inspection and consent propagation; most added lines provide regression coverage and fixtures.

Merge-risk options

Maintainer options:

  1. Confirm the contract and prove rejection at commit (recommended)
    Obtain installer-owner agreement and recorded allowed-versus-revoked results through real Claw installation and existing-install update persistence.
  2. Pause pending an installer-owned contract
    Keep the branch open while the installer owner determines the supported inspection and acknowledgment interface.

Technical review

Best possible solution:

Keep capability inspection and final consent under the canonical installer, with an owner-approved callback contract and demonstrated preservation of existing installations when review becomes invalid.

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

Yes, from source: current main can skip the enclosing Claw review on official or previously accepted artifacts, and its plan does not bind the complete capability evidence. No runtime reproduction was executed.

Is this the best way to solve the issue?

Yes in structure: extending the canonical installer preserves one consent owner, and dry-run inspection serves a different lifecycle point from commit-time approval. Contract approval and complete authority proof remain necessary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c6c9d416327e.

Labels

Label justifications:

  • P2: This is a bounded correction to Claw-managed plugin consent without evidence of an urgent production outage.
  • merge-risk: 🚨 compatibility: The branch adds an installer inspection contract and requires evidence that existing update and resume flows previously omitted.
  • merge-risk: 🚨 security-boundary: Claw plan consent now automatically authorizes installation, so invalidated grants must be shown to stop the final persistent effects.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the reported lifecycle run and new real-filesystem archive tests are useful, but they do not demonstrate the Claw coordinator’s changed/revoked-grant rejection through the managed artifact and installation-record commits. The new tests directly wire the consent handler; the managed-install denial coverage mocks persistence. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current main still needs the change: Fetched main retains the ordinary official/current-acceptance exemptions and the generic CLI consent callback; it does not contain this branch’s Claw-specific capability comparison. (src/plugins/capability-consent.ts:290, c6c9d416327e)
  • Introduced authority boundary: The Claw installer compares the reviewed capability token and grants before acknowledging consent. Managed installation requires this callback for clawManaged requests, including otherwise exempt artifacts. (src/claws/packages.ts:471, 25f08a27d769)
  • Earlier findings addressed: The add CLI passes its loaded config to preview and apply. Plugin preflight now returns installedPath, isolated capability inspection consumes that path, and package-update conflict promotion preserves it. These address the two concrete findings retained in the previous review. (src/claws/plugin-capability-probe.ts:81, 25f08a27d769)
  • New filesystem coverage and remaining proof boundary: New archive tests exercise real artifact installation and preserve the previous payload on denial. They construct the consent handler directly, bypass the Claw coordinator and managed installation-record writer, and inspect an in-memory priorRecord rather than persisted records. This is useful regression coverage but does not establish the remaining full-path grant-revocation claim. (src/plugins/install.path.test.ts:72, 25f08a27d769)
  • Captured discussion and proof claims: The supplied complete body, under sourceRevision 2ceafa8eb52f414ef807524bb790893afc7aab1fe52696e82b99570d61e66b20, reports Linux regression results and a deterministic public lifecycle run, and explicitly requests installer-owner confirmation. It supplies no recorded full-path changed/revoked-grant result. Live review metadata contains zero reviews. (25f08a27d769)
  • Existing consent and recovery contract: The CLI documentation defines exact-plan consent, rejection after live configuration changes, and rebuilding a preview before retrying. This supports extending the existing owner rather than introducing another approval mechanism. Public docs: docs/cli/claws.md. (docs/cli/claws.md:365, 25f08a27d769)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • giodl73-repo: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide recorded allowed-versus-changed/revoked grant results through the Claw coordinator and real managed installer, including official artifacts, previously accepted updates, and persisted-record preservation.
  • Record installer-owner confirmation of the dry-run inspection contract.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-13T18:57:46.151Z sha 6c8fb2f :: needs real behavior proof before merge. :: [P1] Pass the reviewed configuration through Claw add apply
  • reviewed 2026-09-14T01:13:16.873Z sha 3f92eb7 :: needs real behavior proof before merge. :: [P1] Preserve installed-path context in isolated capability probes
  • reviewed 2026-09-14T01:59:30.825Z sha 3d27016 :: needs real behavior proof before merge. :: [P1] Preserve installed-path context in isolated capability probes

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 14, 2026
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

For the Claws Labs launch, the new draft stack appears to supersede this implementation rather than needing both changes merged independently:

  • OpenClaw #163296 stages plugin artifact inspection and requires Claw-owned capability consent even for an official or previously accepted plugin. Gateway Add/Update bind the acknowledgment to the reviewed plan.
  • Later stack commits check grants for every package-owned child plugin before commit. The integration tests exercise the Claw coordinator through the managed installer: a revoked grant blocks Add without an artifact or install record and blocks Update while preserving the previous artifact, record, and Claw reference.
  • The packaged local E2E run in #163307 then proves the positive path: reviewed Workflow Operator Add, a real Lobster task, reviewed plugin Update, and another real Lobster task.

Could @steipete or the current plugin-installer owner review and explicitly accept the onPluginArtifactInspect / clawManaged consent boundary in the replacement stack, especially #163296 and its later grant-hardening commits? We are keeping this PR open pending that decision; once accepted, we can coordinate closing it as superseded instead of merging two competing installer hooks.

This branch has not been deployed

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

Labels

cli CLI command changes 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants