Skip to content

[2026.10.10-beta.5] Preserve filesystem policy in Gateway-built tools - #187307

Merged
RomneyDa merged 1 commit into
release/2026.10.10from
backport/fs-policy-2026.10.10
Oct 29, 2026
Merged

RomneyDa merged 1 commit into
release/2026.10.10from
backport/fs-policy-2026.10.10

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Scope

Focused backport of Agustin Rivera's #185094, source commit 3e0c610. Derive an omitted fsPolicy from the captured session/config policy before delegate and media tool construction. Preserve explicit policy overrides, session permission roots and read-only attachment roots. No approval/cancellation/revocation enforcement is removed.

Adaptation

Apply the same policy derivation in the existing preparation module and synchronous factory; preserve branch-local auth preparation ordering. Added an interception regression at the asynchronous delegate-preparation boundary.
The upstream unit tests use the existing branch-local config fixture shape; the historical inference fixture passes its dependency adapter to preserve route re-verification while keeping approval and persistence real. Additional factory regressions cover global and per-agent workspace restrictions plus explicit unrestricted overrides.

Validation

  • Local policy/media regressions: 12 policy + 13 media/preparation passed.
  • Core TypeScript check passed with the checkout-owned scripts/run-tsgo.mjs wrapper.
  • Source-only formatting and git diff whitespace checks passed.
  • Gateway tool-resolution suite: 19/19 passed, including real persistent writes, approval, cancellation, run revocation, precommit revocation and outside-workspace image denial.

Review gates

Draft only. Independent full-context review, required hosted checks, and release qualification remain outstanding. This does not claim ready-for-review, merge approval, or release inclusion. No version, dependency, lockfile, or release-validation changes.

…spaceOnly reaches the delegate and media tools (#185094)

* fix(agents): derive fsPolicy for Gateway-built OpenClaw tools so workspaceOnly reaches the delegate and media tools

* test(gateway): prove workspace policy at delegation and media sinks

Backport adaptation (#185094): Resolve policy in branch-local preparation and synchronous assembly while retaining existing auth preparation ordering. Keep branch-local policy unit fixtures; wire the historical inference test dependency fixture and add factory-level restriction/override regressions.

(cherry picked from commit 3e0c610)

Co-authored-by: RomneyDa <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: M labels Oct 29, 2026
@RomneyDa
RomneyDa marked this pull request as ready for review October 29, 2026 04:34
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 29, 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. labels Oct 29, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR derives omitted filesystem policy before constructing Gateway-backed delegation and media tools.

Example: A Gateway caller has tools.fs.workspaceOnly=true and requests logging.level=debug through the openclaw tool.

  • Before: The omitted filesystem policy can classify delegation as Full Access and allow the change without approval.
  • After: The configured restriction reaches delegation, so the change waits for approval.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused repair appears correct, but inspectable authority-boundary execution evidence is missing for the backport.
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.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Configured workspace restrictions can fail to govern Gateway-built administrative delegation and local media reads.
Reason: The maintainer-authored backport restores an existing permission contract without adding settings, defaults, or a competing executor.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this maintainer-authored backport restores configured filesystem restrictions on the release branch, and source review found no concrete introduced correctness defect.

Priority: P1
Reviewed head: 3539c028eea3f79bd340a42d8b96938bfa5ad3d3

Before merge

  • Add real behavior proof - Authority-chain proof required: configuration/session policy flows through the factories into private delegate authority and media roots; the added harness covers allowed, restricted, cancelled, and revoked callers through real approval and persistence owners, but this PR supplies passing-test summaries rather than inspectable final-effect execution output. Provide redacted terminal output or logs for the reviewed backport, removing API keys, IPs, phone numbers, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Resolve security review attention item - Source review found no introduced bypass, but branch-specific final-effect execution evidence remains unverified.
  • Resolve merge risk - Before merge, the PR owner must substantiate final-effect enforcement on this branch adaptation: restricted delegation must not write before approval, and revoked authority must not write after preparation.

Findings

None.

Tests

  • Low-value test src/agents/openclaw-tools.media-workspace.test.ts: Remove the added delegate-spy interception test: it asserts internal argument shape and deliberately stops before behavior, while the Gateway final-effect harness already exercises asynchronous construction.
  • Missing end-to-end proof: Supply redacted execution output from the branch-adapted production-path harness showing permitted writes, approval-gated writes, revocation before persistence, and outside-root media denial; a failing release-base control is not shown.
Agent review details

How this fits together

Gateway and skill callers construct shared agent tools; captured session and configuration policy governs delegated administrative changes and local media access.

flowchart TD
  A[Gateway or skill caller] --> B[Shared tool preparation]
  C[Session and configuration policy] --> B
  B --> D[Filesystem policy resolver]
  D --> E[Delegate approval owner]
  D --> F[Media access owner]
  E --> G[Persistent configuration writer]
  F --> H[Allowed local files]
Loading

Technical review

Best possible solution:

Retain the shared policy derivation and existing effect owners, then qualify the backport with inspectable final-effect results.

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

The release-base factory omits policy derivation while delegation interprets absent workspace restriction as potentially Full Access; current main contains the repair, and no reproduction was executed during this read-only review.

Is this the best way to solve the issue?

The backport addresses the missing producer input in both construction paths while preserving explicit overrides, session precedence, attachment exceptions, and existing approval enforcement.

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Record the existing boundary harness results (recommended)
    The PR owner should supply redacted execution output showing allowed and forbidden persistent effects, precommit revocation, and media denial on the reviewed backport.

Provenance checked

  • Delegate automatic approval keeps the original intent (6187bd6: Effective Full Access should apply permitted delegated changes automatically while workspace-restricted runs remain subject to approval.)
  • Filesystem configuration precedence keeps the original intent (878b4e0: Unify global and per-agent workspace-only resolution.)
  • Task-workspace media access keeps the original intent (2433b00: Carry task working directory and filesystem policy into shared media resolution while preserving workspace boundaries and attachment handling.)
  • Asynchronous tool preparation keeps the original intent (00be453: Prepare authentication asynchronously through its worker-backed owner while retaining synchronous SDK compatibility.)

Testing

Proof path: in-process harness.

Security

Needs attention: Source review found no introduced bypass, but branch-specific final-effect execution evidence remains unverified.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 878b4e0 adds src/agents/tool-fs-policy.ts:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 878b4e0ed7cf; files: src/agents/tool-fs-policy.ts)

PR surface

Source +61, Tests +398. Total +459 across 8 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 4 62 1 +61
Tests 4 399 1 +398
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 461 2 +459

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +62/-1; tests/support +399/-1 Production growth supplies shared derivation at both factories; most test growth exercises distinct approval, revocation, persistence, and media contracts.

Root-cause cluster

Relationship: same_root_cause
Canonical: #185094
Summary: This PR backports the same omitted-filesystem-policy repair from main to the release branch.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P1: The target release branch can omit configured workspace restrictions when constructing delegation and media tools.
  • add merge-risk: 🚨 security-boundary: The changed policy input controls automatic administrative writes and local-file disclosure; branch-specific final-effect execution evidence is not inspectable.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P1: The target release branch can omit configured workspace restrictions when constructing delegation and media tools.
  • merge-risk: 🚨 security-boundary: The changed policy input controls automatic administrative writes and local-file disclosure; branch-specific final-effect execution evidence is not inspectable.
  • 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.

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.

Reviewed October 29, 2026, 12:40 AM ET / 04:40 UTC.

@RomneyDa RomneyDa changed the title [release/2026.10.10] Preserve filesystem policy in Gateway-built tools [2026.10.10-beta.5] Preserve filesystem policy in Gateway-built tools Oct 29, 2026
@RomneyDa
RomneyDa merged commit 08ee21d into release/2026.10.10 Oct 29, 2026
220 of 226 checks passed
@RomneyDa
RomneyDa deleted the backport/fs-policy-2026.10.10 branch October 29, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M 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