Skip to content

feat(windows): support secure operations without native addon - #476

Merged
steipete merged 10 commits into
mainfrom
codex/portable-windows-current-20260918
Sep 18, 2026
Merged

steipete merged 10 commits into
mainfrom
codex/portable-windows-current-20260918

Conversation

@steipete

@steipete steipete commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Windows installations without the optional native package cannot complete the security checks needed for credential reads and private-directory creation. This includes OpenClaw's npm recovery installs with optional dependencies omitted.

Allow secure reads, raw owner/DACL inspection, and private-directory creation to use fixed, readable PowerShell/C# package assets when native capabilities are unavailable in auto or off mode. Secure reads inspect the same inherited borrowed handle before reading content; private directories receive a protected DACL during exclusive handle-relative creation. Native remains preferred, require stays strict, and native operation failures never trigger a command retry.

The bridge respects normal execution policy and endpoint protection, limits command discovery to PowerShell's bundled system modules, and warns once per capability about startup overhead. Output and asynchronous settlement remain bounded. Unconfirmed process or creation outcomes are explicit and never authorize pathname cleanup. Installed-consumer checks verify package and helper hashes and compare canonical script locations, including Windows short-path aliases.

Validation on the final implementation:

  • pnpm check: 10,203 tests passed, with build, documentation, package/API checks, and whitespace checks passing. Node 22 focused checks passed 126 tests. Independent review found no actionable P0–P2 defects in the complete PR.
  • Windows CI package proof passed 78 installed-consumer security scenarios on each of Node 22.23.2 and 24.20.0, across npm and pnpm normal and optional-free installs. Receipts match commit 55e8b78c29e1cad049fed8a13cbf54dcfee09747 and verify native presence/absence, strict require, descriptor identity, denial before content, protected creation, and warning behavior.

No dependency versions or release metadata change.

@clawsweeper

clawsweeper Bot commented Sep 18, 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.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken 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 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 18, 2026, 2:23 PM ET / 18:23 UTC (Revision 8).

ClawSweeper review

What this changes

Adds packaged PowerShell/C# fallbacks for Windows secure reads, ownership and access-control inspection, and private-directory creation, with packaging checks, documentation, and regression coverage.

Merge readiness

⛔ Blocked before merge - 4 items remain

The fallback remains useful and absent from main. No concrete patch defect was found, but the earlier request for inspectable Windows security proof remains unresolved.

Priority: P2
Reviewed head: 55e8b78c29e1cad049fed8a13cbf54dcfee09747

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation and coverage are substantial, but unresolved security-boundary proof limits merge confidence.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: the body reports installed-package Windows Server 2022 runs exercising the new bridge on Node 22/24, but supplies no inspectable receipts for restricted-principal denial, unsafe-ACL rejection before subsequent reads, or failed-command process/handle and creation outcomes. The latest script-discovery and path-verification changes do not resolve that prior gap. 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 body reports installed-package Windows Server 2022 runs exercising the new bridge on Node 22/24, but supplies no inspectable receipts for restricted-principal denial, unsafe-ACL rejection before subsequent reads, or failed-command process/handle and creation outcomes. The latest script-discovery and path-verification changes do not resolve that prior gap. 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 9 items Repository policy: Read the complete root AGENTS.md, CONTRIBUTING.md, and SECURITY.md. No nested AGENTS.md or maintainer-notes directory was found. Applied the security-boundary, compatibility, regression-coverage, and changelog requirements; builds, tests, and autoreview helpers were not executed under the read-only contract.
Still necessary on main: Pinned main rejects secure Windows reads when the native descriptor capability is unavailable. The existing pathname-reporting fallback does not provide the required handle-bound admission.
Latest release retains native requirement: The supplied latest release, v0.15.0, still rejects private-directory creation without the native binding.
Findings None None.
Security None None.

How this fits together

fs-safe checks filesystem identity and permissions before applications consume sensitive files or use private directories. The Windows bridge supplies these checks when the optional native addon is unavailable.

flowchart TD
  A[Application filesystem request] --> B[Native capability and mode]
  B --> C[Native helper]
  B --> D[Packaged Windows scripts]
  B --> E[Strict mode rejection]
  C --> F[Handle identity and permission checks]
  D --> F
  F --> G[Verified read or private directory]
  F --> H[Fail closed]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: the body reports installed-package Windows Server 2022 runs exercising the new bridge on Node 22/24, but supplies no inspectable receipts for restricted-principal denial, unsafe-ACL rejection before subsequent reads, or failed-command process/handle and creation outcomes. The latest script-discovery and path-verification changes do not resolve that prior gap. 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 bridge transfers a readable handle across a process boundary and creates persistent filesystem permissions; inspectable results still need to establish restricted-principal denial and rejection before reads after ACLs become unsafe.
  • Resolve merge risk (P1) - If termination fails, the child may retain its inherited handle or finish directory creation after rejection; the reported Windows failure and cleanup outcomes remain unauditable.
  • Complete next step (P2) - Attach inspectable receipts from the reported Windows runs covering restricted-principal denial, unsafe-ACL rejection before reads, and failed-command process/handle and creation outcomes. Terminal output or logs count; screenshots or recordings are useful when they display those diagnostics. Redact credentials, private paths, IP addresses, phone numbers, and non-public endpoints. Update the PR body to trigger re-review; if it does not run, ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test growth Production +693/-139 (net +554); tests +1376/-75 (net +1301) The production growth implements the stated Windows bridge and shared validation; counts cover src/ and test/, excluding scripts and documentation.

Merge-risk options

Maintainer options:

  1. Attach the reported Windows receipts (recommended)
    Provide inspectable allowed and restricted-principal results, unsafe-ACL rejection before content reads, and failed-command process, handle, and directory outcomes.

Technical review

Best possible solution:

Preserve the shared handle-based admission policy and strict native mode, backed by auditable Windows evidence of equivalent access restrictions and bounded failure outcomes.

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

Not applicable as a bug reproduction: current main intentionally requires native support for these operations, and this PR adds a supported fallback.

Is this the best way to solve the issue?

Yes, structurally: borrowed-handle inspection and protected permissions at creation preserve the existing guarantees that pathname inspection cannot provide; runtime security proof remains incomplete.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded Windows capability improvement without evidence of an urgent current regression.
  • merge-risk: 🚨 security-boundary: Cross-process handle transfer and persistent directory permissions require inspectable evidence of restricted-principal denial and safe failure outcomes.
  • 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 body reports installed-package Windows Server 2022 runs exercising the new bridge on Node 22/24, but supplies no inspectable receipts for restricted-principal denial, unsafe-ACL rejection before subsequent reads, or failed-command process/handle and creation outcomes. The latest script-discovery and path-verification changes do not resolve that prior gap. 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:

  • Repository policy: Read the complete root AGENTS.md, CONTRIBUTING.md, and SECURITY.md. No nested AGENTS.md or maintainer-notes directory was found. Applied the security-boundary, compatibility, regression-coverage, and changelog requirements; builds, tests, and autoreview helpers were not executed under the read-only contract. (AGENTS.md:25, 55e8b78c29e1)
  • Still necessary on main: Pinned main rejects secure Windows reads when the native descriptor capability is unavailable. The existing pathname-reporting fallback does not provide the required handle-bound admission. (src/secure-file-windows.ts:168, f9bdae0f69de)
  • Latest release retains native requirement: The supplied latest release, v0.15.0, still rejects private-directory creation without the native binding. (src/private-directory.ts:28, 59f297b1d8d6)
  • Security boundary implementation: The bridge creates directories relative to retained parent handles with protected creation-time permissions, validates their identities, and cleans up through the created handle. Descriptor inspection uses the inherited handle; shared TypeScript validation checks its identity and ACL facts before content reads. (src/windows-security-bridge.cs:192, 55e8b78c29e1)
  • Bounded failure contract: Asynchronous command failure requests termination, allows one second for settlement, and reports unconfirmed process exit or creation outcomes. The documentation explicitly allows a surviving child to retain its inherited handle or finish creation after rejection; mocked settlement tests cover the receipt semantics. (src/windows-security-command.ts:149, 55e8b78c29e1)
  • Reported Windows runs and proof gap: The complete supplied body, captured under sourceRevision 6e054501d88bcd9488d473a5eec8a7f4e299ebe7f0c049fbe2aa8e911426c274, reports Windows Server 2022 x64 runs on Node 22.23.2 and 24.21.0, with 226 focused tests and 78 installed-consumer scenarios per version. It contains no transcript or artifact link for the reported restricted-principal and process/token/handle outcomes. The scratch directory is empty, and the discussion contains only bot comments.

Likely related people:

  • Peter Steinberger: Raw commit b338605 adds src/secure-file-windows.ts:174 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b338605c3d4d; files: src/secure-file-windows.ts)
  • RomneyDa: 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.

  • Attach the reported Windows receipts showing allowed behavior, restricted-principal denial, unsafe-ACL rejection before subsequent reads, and failed-command process/handle and creation outcomes.

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 (7 earlier review cycles)
  • reviewed 2026-09-18T15:31:38.884Z sha 24f401e :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-18T15:58:52.435Z sha a3e9136 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-18T16:12:13.056Z sha de37140 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-18T16:50:56.998Z sha d2cf551 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-18T17:22:28.206Z sha d2cf551 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-18T17:53:56.336Z sha 33b1dbd :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-18T18:07:01.610Z sha caf42ce :: needs real behavior proof before merge. :: none

@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 18, 2026
@steipete
steipete marked this pull request as ready for review September 18, 2026 18:30
@steipete
steipete requested a review from a team as a code owner September 18, 2026 18:30
@clawsweeper

clawsweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat(windows): support secure operations without native addon This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

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

Labels

merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

1 participant