Skip to content

fix(claws): block installs when reviewed access changes - #163300

Closed
Patrick-Erichsen wants to merge 11 commits into
codex/claw-1093-v2-06-artifact-trustfrom
codex/claw-1093-v2-07-access-guards
Closed

Patrick-Erichsen wants to merge 11 commits into
codex/claw-1093-v2-06-artifact-trustfrom
codex/claw-1093-v2-07-access-guards

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Publication Refresh: October 7

Layer 6/16. Previous: #163299 | Next: #163302. Published checkpoint: 513f3cf06bee.

The stack now includes 45 previously local follow-up commits in four additional draft PRs, ending at #166801 (9e653a8ed286). Fresh combined-tip checks passed: 100 backend tests and 13 built-UI browser tests with a mocked Gateway. Before/after review captures are attached. Evidence below that names 6765a8741e4 remains historical evidence for that revision, not a new real-ClawHub run or per-layer CI result.

The stack remains draft and its first layer conflicts with current main. Reconciliation, exact-head CI/review, and the existing release gates remain outstanding. No merge or deployment is authorized by this publication.

What Problem This Solves

An install can become unsafe if host policy or resource access changes after the user reviews a plan.

User Impact

Add/Update disclose exact effects and reject stale or newly blocked projections before committing scheduler, plugin, or config changes. The Agents header also opens catalog search directly.

Why This Change Was Made

The lifecycle rechecks persisted policy and ownership at the effect boundary, so a review is not treated as a permanent permission. Search remains a front door to the same Gateway plan, not a second installer.

Evidence

Access-drift, scheduler/reload, review-disclosure, and Agents-header regression tests are included. At final stack tip 6765a8741e4, pnpm check:changed and installable-tarball build/integrity passed. Installed-host screenshots show the top-right Agents search and a Workflow Operator review disclosing one plugin and the package audit; UI Add and a real Lobster task succeeded. With Labs off, UI hid catalog/Update while status/Remove stayed available, and reviewed Remove succeeded. The final packaged-host pass retained a second installed Claw and the Labs-off setting after a clean Gateway restart, with user-file hashes unchanged.

Release gate: Land the OpenClaw stack together only after ClawHub #3883 and local publish-to-real-task lifecycle proof.

@clawsweeper

clawsweeper Bot commented Oct 2, 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 app: web-ui App: web-ui gateway Gateway runtime size: XL labels Oct 2, 2026
@Patrick-Erichsen Patrick-Erichsen changed the title codex/claw 1093 v2 07 access guards fix(claws): block installs when reviewed access changes Oct 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. 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 Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Claws, versioned agent setups, gain install-time access checks, detailed lifecycle consent disclosures, and catalog search from the Agents header.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch has useful hardening and a resolved prior defect, but retains an event-loop defect and lacks the required authority-boundary proof.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Merge readiness

⛔ Blocked before merge - 6 items remain

This remains useful, distinct work in an active dependent stack. The prior Update comparison defect is resolved, but the synchronous Add migration read remains, and the available evidence does not establish final-effect rejection after authority or policy changes.

Priority: P2
Reviewed head: 513f3cf06bee40d522f7989d84d9dcc69a6b63a3

Before merge

  • Add real behavior proof - Authority-chain proof required: historical installed-host Add/task success and inspected later-stack screenshots provide positive lifecycle and disclosure evidence, but do not show the changed Gateway Add/Update owners rejecting revoked admin authority or persisted-policy drift before final I/O. Provide redacted production-path traces for allowed and nearest-forbidden authority, including successful access-changing Update; terminal output or logs are valid. Redact credentials, IP addresses, phone numbers, and private endpoints. Update the PR body for automatic re-review, or ask a maintainer to comment @clawsweeper re-review. No stored-data contract change was identified.
  • Prepare migration facts outside the synchronous Add guard (P2) - The new getter runs at Add's forward mutation boundaries, including worker admission and scheduler/plugin commit guards. readCurrentConfigForPolicyCheck synchronously calls readDeferredPluginMigrations, which opens SQLite and queries migration_runs on the Gateway event loop. This retains the prior blocking finding and can stall unrelated requests during database contention. Prepare migration facts asynchronously and pass them to the existing readCurrentConfigForPolicyCheckWithMigrations reader while preserving current disk-policy checks.
  • Resolve security concern: Revoked authority needs final-effect coverage - The branch carries reviewed access through asynchronous installation and activation. Existing mocked rejection cases and historical successful installs do not establish that revoked admin authority or changed persisted policy stops the real scheduler, plugin, and configuration owners before I/O.
  • Resolve merge risk - Final-effect rejection after admin revocation or persisted-policy drift remains unproven for the changed Add/Update path, including scheduler and plugin activation.
  • Resolve merge risk - The dependent stack still requires owner-coordinated reconciliation and its stated registry and publish-to-real-task gates before landing.
  • Complete next step - Repair the synchronous Add migration read through the stack owner, supply final-effect authority traces, and complete the recorded coordinated landing gates.

Findings

  • [P2] Prepare migration facts outside the synchronous Add guard — src/gateway/server-methods/claws-add.ts:130
  • [medium] Revoked authority needs final-effect coverage — src/claws/gateway-add-apply.ts
Agent review details

How this fits together

The Claws lifecycle turns reviewed agent packages into workspace files, plugins, configuration, and scheduled jobs. The Gateway checks consent and current authority before forwarding those changes to their owning subsystems.

flowchart TD
  A[Agent package] --> B[Gateway plan]
  B --> C[User consent review]
  C --> D[Current authority and policy checks]
  D --> E[Installation owners]
  E --> F[Agent configuration and resources]
  D --> G[Reject changed access]
Loading

Technical review

Best possible solution:

Keep consent enforcement in the existing Gateway and installation owners, using prepared migration facts and verified rejection before final side effects.

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

Yes, source establishes the remaining defect: Add forward guards call the synchronous policy reader, which queries SQLite migration state. No runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Yes, checking reviewed access at the existing effect owners is appropriate; prepare migration facts asynchronously rather than querying SQLite inside each synchronous guard.

Full review comments:

  • [P2] Prepare migration facts outside the synchronous Add guard — src/gateway/server-methods/claws-add.ts:130
    The new getter runs at Add's forward mutation boundaries, including worker admission and scheduler/plugin commit guards. readCurrentConfigForPolicyCheck synchronously calls readDeferredPluginMigrations, which opens SQLite and queries migration_runs on the Gateway event loop. This retains the prior blocking finding and can stall unrelated requests during database contention. Prepare migration facts asynchronously and pass them to the existing readCurrentConfigForPolicyCheckWithMigrations reader while preserving current disk-policy checks.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Repair and prove the coordinated stack (recommended)
    Have the stack owner remove synchronous migration queries from Add guards, propagate the repair, and demonstrate current-authority rejection through the real installation owners.

Security

Needs attention: The changed authority boundaries need production final-effect rejection evidence; no concrete exploit or supply-chain regression was established.

Evidence

Security concerns:

  • [medium] Revoked authority needs final-effect coverage — src/claws/gateway-add-apply.ts
    The branch carries reviewed access through asynchronous installation and activation. Existing mocked rejection cases and historical successful installs do not establish that revoked admin authority or changed persisted policy stops the real scheduler, plugin, and configuration owners before I/O.
    Confidence: 0.9

What I checked:

  • Pinned introduction and clean checkout: Reviewed the introduced merge-base-to-head changes at the supplied original head. The supplied test merge is stale and cannot establish what merging onto current main would remove. The checkout remained clean. (513f3cf06bee)
  • Remaining synchronous Add read: The introduced runtime getter calls readCurrentConfigForPolicyCheck at forward mutation guards. That reader synchronously loads deferred migration records; readDeferredPluginMigrations opens existing SQLite state and executes synchronous migration_runs queries. (src/gateway/server-methods/claws-add.ts:130, 513f3cf06bee)
  • Existing prepared-facts reader: The configuration owner already exposes readCurrentConfigForPolicyCheckWithMigrations, which accepts prepared migration facts and rereads disk policy without querying migration state. (src/config/io.runtime.ts:268, 513f3cf06bee)
  • Prior Update finding resolved: The current Update callback distinguishes after-agent-commit checks and compares both actual current and desired access against the reviewed desired digest. The updater propagates that phase to scheduling and provenance persistence, addressing the prior post-commit comparison finding. (src/claws/gateway-update-apply.ts, 513f3cf06bee)
  • Authority-boundary coverage: Gateway handlers compose current client authority with scheduler and plugin commit guards. Added tests exercise callback rejection using mocked lifecycle, scheduler, and plugin owners; they supplement, but do not establish, production final-effect rejection. (src/gateway/server-methods/claws-add.test.ts:349, 513f3cf06bee)
  • Inspected visual evidence: Inspected both downloaded before/after images linked from fix(claws): review verified manifests and respect host plugin policy #166798. They visibly show lifecycle action disclosure and later grouped-manifest disclosure with synthetic data. Their recorded revisions are later stack checkpoints, and the images do not show authority revocation, policy-drift rejection, or final-I/O observations.

PR surface

Source +1254, Tests +2735. Total +3989 across 62 files.

View PR surface stats
Area Files Added Removed Net
Source 34 1480 226 +1254
Tests 28 2806 71 +2735
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 62 4286 297 +3989

Review metrics

Metric Value Why it matters
Production versus test growth production net +1,254 lines; tests net +2,735 lines Production growth supports the stated consent disclosures and effect-boundary enforcement, with substantial regression coverage.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is bounded experimental lifecycle hardening with a concrete remaining defect, without evidence of an urgent shipped-user regression.
  • merge-risk: 🚨 security-boundary: Changed consent and authority checks need final-effect proof that revoked authority cannot reach installation or activation.
  • merge-risk: 🚨 availability: The introduced Add guard repeatedly performs synchronous SQLite migration reads on the Gateway event loop.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

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

  • Prepare migration facts outside Add's synchronous mutation guards.
  • Show successful access-changing Update and rejection after admin revocation or persisted-policy drift before final I/O.
  • Complete the recorded coordinated stack landing gates.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-02T06:14:23.641Z sha 26a9707 :: needs real behavior proof before merge. :: [P1] Compare committed policy after the Update agent write | [P2] Prepare migration facts outside the synchronous Add guard
  • reviewed 2026-10-02T11:08:51.954Z sha 26a9707 :: needs real behavior proof before merge. :: [P1] Compare committed policy after the Update agent write | [P2] Prepare migration facts outside the synchronous Add guard

Reviewed October 7, 2026, 7:25 PM ET / 23:25 UTC (Revision 3).

@Patrick-Erichsen
Patrick-Erichsen force-pushed the codex/claw-1093-v2-07-access-guards branch from 26a9707 to 513f3cf Compare October 7, 2026 23:15
@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Oct 7, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Closing as superseded: #171623 replaced the Claws plan/review/update/remove lifecycle with a one-way Add operation, and main no longer has the lifecycle modules this layer changes. Any hardening here that still matters should be redone against the new Add flow.

Closed by Roboclaw at the author's request after an audit of his open PRs. The branch is kept, so this can be reopened if needed.

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

Labels

app: web-ui App: web-ui gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. 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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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