Repository navigation
fix: preserve owner tool access after network reads - #194472
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR preserves explicit owners’ tool access after network reads while retaining current-authority, scope, policy, and inherited-authority restrictions. Example: An authenticated administrator asks the agent to look up GitHub user octocat and assign the contributor role.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it fixes a current owner-tool regression with a focused shared-guard change and no actionable code findings; current-head maintainer security approval remains required. Priority: P1 Before merge
FindingsNone. Agent review detailsHow this fits togetherAgent tool construction and execution consume sender attribution, admitted operator authority, and network taint; the shared guard controls eligibility before existing Gateway dispatch and operation-specific approval and persistence checks. flowchart LR
A[Owner request] --> B[Agent network lookup]
B --> C[Sticky turn taint]
C --> D[Shared owner tool guard]
D --> E[Gateway dispatch]
E --> F[Operation approval]
F --> G[Live authority check and persistence]
Technical reviewBest possible solution: Keep the narrow shared-guard fix and its distinct authority regressions, then complete the enforced security approval and current-head CI gates. Do we have a high-confidence way to reproduce the issue? Current-main source shows the unconditional taint veto on explicitly attributed admitted administrators; supplied base-failure evidence and the historical live trace support the reported path, but no target code was executed during this review. Is this the best way to solve the issue? The smallest complete fix is to limit the existing taint veto to inherited authority while preserving explicit owners’ current-grant and scope checks in the same shared owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 225d2f7d4f18. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +283, Other +4. Total +288 across 5 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (5 earlier review cycles)
Reviewed November 8, 2026, 1:55 PM ET / 18:55 UTC (Revision 6). |
|
|
@clawsweeper re-review The reviewed guidance-only head The actual outer-tool regression failed on the base and passes on this head (31 focused checks), with explicit-owner live authority retained after network observation while revocation, scopes, tool policy and inherited non-owner restrictions remain enforced. The PR body now records exact-base attribution for all three CI failures and does not claim a green gate. The model-driven end-to-end proof remains unverified: the isolated test’s outbound proxy rejected the API destination before inference or tool use. That limitation has not been removed or relabeled successful. Current-head maintainer security approval is also still outstanding. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review The requested real-agent behavior evidence is now in the PR body, on unchanged head A separately launched shipped Gateway used the existing native ChatGPT OAuth login and a normally authenticated administrator connection. Actual model inference performed the public GitHub lookup (HTTP 200, network provenance), then delegated the role assignment through The body includes timestamped sanitized tool evidence, both setup results, config readback, full-config comparison against the canonical writer's migration output, and clean shutdown. The first OAuth attempt's legitimate insufficient-scope denial and earlier API-only failures remain disclosed. No code changed; maintainer security approval and CI status are still separate. |
|
🦞👀 Re-review progress:
|
Yigtwxx
left a comment
There was a problem hiding this comment.
Since this needs a security-sensitive approval, I looked at what the new tests actually prove about taint, and at how the change sits next to the other owner paths. No production defect found; the guard change and the error selection use the same condition in both places (dangerous-tools.ts:98 and :126). One gap in the evidence, and one piece of context that may help the approval decision.
1. The integration test's non-owner row passes with the taint veto deleted
The PR body lists "Tainted non-owner: rejected before Gateway dispatch or inference" as integration evidence, and the ClawSweeper summary repeats it as proof that "tainted non-owners cannot dispatch". That row doesn't depend on taint. The tool under test is openclaw, which is not in retainedOperatorToolNames (only automations, gateway, plugins are), so resolveGatewayOwnerOnlyToolDenylist gates it for any senderIsOwner: false caller through the !retainedOperatorToolNames.has(name) clause. That decision is made at construction (system-agent-owner-write.integration.test.ts:152-168), while the turn is still clean; taint.observe(...) only runs afterwards at :171.
I checked this by deleting the veto outright on 37b5e05:
- if (turnTainted && senderIsOwner !== true) {
- return false;
- }| control (37b5e05) | veto deleted | |
|---|---|---|
system-agent-owner-write.integration.test.ts |
3 passed | 3 passed |
agent-tools.retained-owner.test.ts |
17 passed | 15 passed, 2 failed (tainted, tainted-later) |
(Windows 11, Node 24.22.1, scripts/test-projects.mts.)
So the only coverage that would catch someone removing the non-owner taint restriction is the unit suite (the tainted / tainted-later rows on the retained gateway tool). That's fine as far as it goes, but the integration test reads as if it covers it end to end. Either the non-owner row could go through a retained tool with an admitted operator grant (so taint is the only thing standing between it and dispatch, ideally paired with an untainted row that does dispatch), or the body could describe it as a non-owner gate rather than a taint check.
2. Context for the approval: explicit owners without an operator grant were never taint-gated
The owner-only gate only consults taint when the run carries admitted operator authority. ownerToolCurrentAssertion exists only when pluginExecutionAuthority is set (session-portal-target.ts:64), and the denylist's no-authority branch ignores turnTainted entirely (dangerous-tools.ts:144-147): for senderIsOwner === true it denies nothing. gateway-tool.ts:124 calls hasGatewayOwnerToolAuthority without passing taint at all. So before this PR, a tainted explicit owner was blocked only when they also held an admitted operator grant, which is the narrower and arguably more trusted case. This change brings that path in line with the rest rather than opening a new one.
The other side of that: the scenario the #193098 veto would have stopped (an owner asks the agent to summarize a page, and the page content asks for an owner-only tool call) is no longer stopped by this guard on any explicit-owner path. Whatever protection remains comes from the individual tool's own approval flow, not from taint. If that injection case is something the maintainers want closed, it needs a decision that covers all owner paths, for example requiring approval for owner-tool calls on a tainted turn, rather than this one guard. I don't think that should block the regression fix, but it seemed worth stating plainly before the approval.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Worked on by: - @jason-allen-oneal Co-authored-by: jason-allen-oneal <[email protected]> OpenClaw-Publication: b6a20ec2-c72c-4fc6-9181-422187183c3d
* docs: explain direct GitHub role preassignment requests * fix: preserve owner tool access after network reads * test: prove delegated owner authority through role writes * Publish fix/nerfed-role-preassignment Worked on by: - @jason-allen-oneal Co-authored-by: jason-allen-oneal <[email protected]> OpenClaw-Publication: b6a20ec2-c72c-4fc6-9181-422187183c3d --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: jason-allen-oneal <[email protected]>
What Problem This Solves
An explicitly authorized owner's setup request stops after a network lookup—for example, fetching a GitHub profile before assigning its role—even though the requester's identity and administrator authority are unchanged.
User Impact
A current administrator explicitly identified as the owner can continue the same request after a network read. Revoked authority, insufficient scopes, explicit tool policy, and taint restrictions on inherited non-owner authority remain enforced. Network results remain untrusted and turn taint remains set.
Why This Change Was Made
Confine the shared owner-tool taint veto to callers without explicit owner attribution, with matching error selection. This restores the existing explicit-owner semantics; it adds no setting, alternate role-assignment mechanism, or approval bypass. The shared guard covers owner tools, not just setup delegation. Downstream operation authorization remains responsible for permitted effects.
Evidence
New combined functional acceptance (November 10, 2026 UTC): clean merge
563502299d4245056f07912e4bb7311ed0f2a59dcombines this head with fix: give root-aware recovery when file tools reject another repository #194473 at2f9a8284def51bfe5375192456d3cc1d011e3b0a. In a task-owned VM, public session/chat APIs and a real model completed the original owner lookup → setup → persisted assignment → separate readback → delivered final in one human request. Persisted transcript records show explicit owner attribution, a real network result, andturnTainted=trueon both subsequent setup calls; independent disk state contains the assignment and the terminal receipt recordssourceReplyDelivered=true. Run29efc5b1-93ec-4cd2-85d1-ea62687d8451. The combined acceptance table in #194473 includes sanitized observations, contrasting allowed/denied workspace flows, exact parents/tree, and current CI/review gaps. Combined build and 57 focused tests passed. This is actual completion and delivery proof, not only improved diagnostics; it does not waive the security review.Published documentation update at
3548ccde70c8d9f9e96f6a09c4f6261bf5e91de1: added the shared owner-tool/network-taint contract to Tool permissions: explicit owner authority survives the lookup, taint stays sticky, external content stays untrusted, and existing policy, scopes, approval, and live-revocation checks remain enforced. Against exact review basee3a09aaba1f45ec3ff2eb4a0db4728286f53068d,git diff --check, targeted formatting and MDX checks pass; the standard internal-link audit reports 16,485 checked links and zero broken links. The optional anchor audit reports two unrelated errors in unchanged ACP setup/release documentation. No runtime tests or live-model proof were repeated for this docs-only update.Previously reviewed runtime head:
a6e4d16bc6f3e03d44aed5d86f1a28e32e45b44c. Integrated maintained upstreame3a09aaba1f45ec3ff2eb4a0db4728286f53068dfor actual CI failures, including the merged UI repair #194504. The five-file runtime/test patch is unchanged in this documentation update; no additional production/test changes or budget increases were made.Verification recorded for that runtime head: 34 focused tests passed (158.46s wall); the formerly failing browser scenario passed against a fresh production UI build (1 selected test, 134.56s wall). Test-line ratchet passes: 6,584,716 lines / 6,584,756 ceiling. The existing 52-line outer-tool regression and 231-line composed authority/persistence regression have matching allocations; they exercise different production boundaries.
Historical real-model proof at
37b5e053951bd8e60f187ff508a93d9787d070b0: shipped isolated Gateway, normally authenticated administrator, actual GitHub lookup, tainted setup delegation, persisted role assignment, separate setup readback, and independent disk readback. No extra prompt or taint clearing. This run was not repeated; 19 named authority/dispatch/approval/config boundary owners and regression files are byte-identical on that runtime head. This is not a claim that the entire runtime/dependency closure is unchanged.Proof correction requested in human review: the integration's non-owner row proves setup-tool exclusion independent of taint. Retained-owner
gatewaycases separately cover taint at construction and at execution. The integration proves active-owner persistence and denial after source-grant revocation following real validation; its same-grant source receipt is supplied by the fixture.Runtime-head ClawSweeper review: Diamond 5/6 overall, proof and patch, sufficient proof and no findings. The reviewer accepts the historical trace reuse and corrected non-owner attribution. Runtime-head CI completed successfully; the browser and test-line failures are resolved. At the inspected runtime head, the aggregate
openclaw/ci-gateis blocked by enforced maintainer security approval, not a failing test. Current-head CI run 42514641318 at3548ccde70c8d9f9e96f6a09c4f6261bf5e91de1has completed successfully. The enforcedopenclaw/security-sensitive-reviewremains pending; the aggregate gate is not green.Detailed historical execution evidence, prior failed attempts/CI, timings, provenance, and candidate hash mapping: immutable evidence index. The retained historical live report is available; its temporary raw captures are no longer present. No new live result has been reconstructed or claimed.
Contributor: @jason-allen-oneal.
Work sessions
Linked for team reference; these sessions aren’t public.