Skip to content

fix: preserve owner tool access after network reads - #194472

Merged
joshavant merged 5 commits into
openclaw:mainfrom
jason-allen-oneal:fix/nerfed-role-preassignment
Nov 10, 2026
Merged

joshavant merged 5 commits into
openclaw:mainfrom
jason-allen-oneal:fix/nerfed-role-preassignment

Conversation

@jason-allen-oneal

@jason-allen-oneal jason-allen-oneal commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

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 563502299d4245056f07912e4bb7311ed0f2a59d combines this head with fix: give root-aware recovery when file tools reject another repository #194473 at 2f9a8284def51bfe5375192456d3cc1d011e3b0a. 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, and turnTainted=true on both subsequent setup calls; independent disk state contains the assignment and the terminal receipt records sourceReplyDelivered=true. Run 29efc5b1-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 base e3a09aaba1f45ec3ff2eb4a0db4728286f53068d, 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 upstream e3a09aaba1f45ec3ff2eb4a0db4728286f53068d for 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 gateway cases 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-gate is blocked by enforced maintainer security approval, not a failing test. Current-head CI run 42514641318 at 3548ccde70c8d9f9e96f6a09c4f6261bf5e91de1 has completed successfully. The enforced openclaw/security-sensitive-review remains 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.

@clawsweeper

clawsweeper Bot commented Nov 7, 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 docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: XS labels Nov 7, 2026
@jason-allen-oneal
jason-allen-oneal marked this pull request as ready for review November 7, 2026 04:55
@clawsweeper clawsweeper Bot added the clawsweeper:intake:docs Preliminary submission classification; full source review pending. label Nov 7, 2026
@jason-allen-oneal
jason-allen-oneal marked this pull request as draft November 7, 2026 05:11
@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

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

  • Before: The network lookup taints the turn, preventing the subsequent owner-tool call despite unchanged administrator authority.
  • After: The assignment can complete while taint remains set and the administrator’s authority remains current.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused shared-owner repair with shipped-entry-point evidence and distinct final-effect denial controls; required approval and pending CI remain workflow gates.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The inspected historical shipped-Gateway trace exercises an authenticated administrator’s actual GitHub lookup through tainted delegation and persisted readback; unchanged production and regression files support reuse. The composed harness additionally proves source-grant revocation after validation prevents the config write, and non-owner exclusion occurs before dispatch. The unrelated automation-warning screenshots provide no evidence for this change.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An authorized owner’s request stops after a network lookup despite unchanged identity and administrator authority.
Reason: The patch restores consistency with existing explicit-owner admission, preserves downstream authorization, and adds no setting or alternate operation path.

Regression provenance

Possible 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
Reviewed head: a6e4d16bc6f3e03d44aed5d86f1a28e32e45b44c

Before merge

  • Await maintainer action - A maintainer must review head a6e4d16 and provide the enforced /allow-security-sensitive-change approval before merge.

Findings

None.

Agent review details

How this fits together

Agent 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]
Loading

Technical review

Best 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

  • Shared owner-tool taint veto changes intended behavior with a stated reason (56753f7: Preserve bounded operator custody across restart and scheduled continuations without treating retained authority as a new owner input.)
  • Retained-owner regression fixture keeps the original intent (56753f7: Exercise real outer-tool admission and retained-authority restrictions; this PR retains those controls and extends them to explicit owners.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Exact introduced patch: The production patch changes the taint veto and matching error selection in the existing shared owner-authority guard; it adds no parallel authorization owner. (src/security/dangerous-tools.ts:98, a6e4d16bc6f3)
  • Current main still contains the failure: Fetched main rejects every tainted call through hasGatewayOwnerToolAuthority before considering explicit owner attribution; its no-operator-authority denylist already permits explicit owners. (src/security/dangerous-tools.ts:97, 225d2f7d4f18)
  • Composed final-effect controls: The integration exercises real dispatch, delegated approval, validation, and config persistence: the active owner writes successfully, source-grant revocation after validation prevents persistence, and the non-owner cannot dispatch. Its supplied same-grant receipt limits attribution to composed revocation rather than receipt creation. (src/gateway/server-methods/system-agent-owner-write.integration.test.ts:139, a6e4d16bc6f3)
  • Human review correction addressed: fix: preserve owner tool access after network reads #194472 (review) correctly distinguishes non-owner tool exclusion from taint enforcement. The current body and evidence index acknowledge this; retained gateway cases independently cover taint at construction and execution. (src/agents/agent-tools.retained-owner.test.ts:30, a6e4d16bc6f3)
  • Inspectable historical live trace: The immutable historical-live-proof-37b5e05.md report records a shipped isolated Gateway, normally admitted administrator, HTTP 200 GitHub lookup, tainted delegation, successful config.set, separate setup readback, and independent disk verification preserving existing settings. Temporary raw captures are unavailable; the retained sanitized trace was inspected. (historical-live-proof-37b5e05.md, 0cc7f973d796)
  • Historical proof remains applicable: The production guard and both changed regression suites are byte-identical to the previous reviewed and live-proven head; the current evidence index separately reports focused validation after integration. (src/security/dangerous-tools.ts:98, a6e4d16bc6f3)

Likely related people:

  • Peter Steinberger: Raw commit 335b425 adds src/security/dangerous-tools.ts:79 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 335b425d2fd6; files: src/security/dangerous-tools.ts)

PR surface

Source +1, Tests +283, Other +4. Total +288 across 5 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 3 2 +1
Tests 2 296 13 +283
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 4 0 +4
Total 5 303 15 +288

Preflight source

Source 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

Metric Value Why it matters
Production versus test growth Production +3/-2; tests +296/-13 The regression growth covers distinct construction, execution, policy, scope, and post-validation revocation boundaries without adding production scaffolding.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: Current main interrupts authorized administrator workflows after an ordinary network lookup.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 (5 earlier review cycles)
  • reviewed 2026-11-07T05:11:53.967Z sha ac0c596 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-07T06:13:42.164Z sha bbe4e8c :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-07T06:46:18.176Z sha 37b5e05 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-07T06:52:54.797Z sha 37b5e05 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-07T07:12:53.088Z sha 37b5e05 :: blocked before merge. :: none

Reviewed November 8, 2026, 1:55 PM ET / 18:55 UTC (Revision 6).

@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation gateway Gateway runtime labels Nov 7, 2026
@jason-allen-oneal jason-allen-oneal changed the title docs: explain direct GitHub role preassignment requests fix: preserve owner tool access after network reads Nov 7, 2026
@jason-allen-oneal
jason-allen-oneal marked this pull request as ready for review November 7, 2026 05:31
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Maintainer security review required

This external contributor PR changes sensitive security components. A maintainer must review these changes before merging.

Current SHA: 3548ccde70c8d9f9e96f6a09c4f6261bf5e91de1

These sensitive security changes were made:

  • src/security/dangerous-tools.ts: Controls product security checks or trust decisions. Check whether the change weakens detection, protection, or remediation.

After reviewing the changes, post a new PR comment containing only approval commands, each on its own line:

/allow-security-sensitive-change

A later push requires a fresh approval comment.

@jason-allen-oneal

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The reviewed guidance-only head ac0c596b119fda07d8f5f4d6beabb3240414dd71 has been replaced by runtime head bbe4e8c663d4031bfd162b60a0bac9faa1d67b4a; the documentation/tool-description changes were removed. Please assess the current runtime change and its applicable proof requirements.

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.

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. and removed clawsweeper:intake:docs Preliminary submission classification; full source review pending. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 7, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 7, 2026
@jason-allen-oneal

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The requested real-agent behavior evidence is now in the PR body, on unchanged head 37b5e053951bd8e60f187ff508a93d9787d070b0.

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 openclaw while turnTainted remained true. The setup tool completed config.set, a second setup call read it back, and independent disk verification confirmed octocat: contributor alongside the preserved existing mapping. agent.wait returned ok, with no reroute or additional user prompt. No production Gateway or real-account permissions were changed, and no credentials were copied.

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.

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 7, 2026

@Yigtwxx Yigtwxx 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.

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.

@jason-allen-oneal

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 8, 2026
Worked on by:
- @jason-allen-oneal

Co-authored-by: jason-allen-oneal <[email protected]>
OpenClaw-Publication: b6a20ec2-c72c-4fc6-9181-422187183c3d
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation security Security documentation labels Nov 8, 2026
@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Nov 10, 2026
@joshavant
joshavant merged commit f47754a into openclaw:main Nov 10, 2026
137 of 142 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawtributors PR from a clawtributor docs Improvements or additions to documentation gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. security Security documentation security-review-required security-sensitive-changed size: M status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants