Skip to content

feat: upgrade Windows node sandboxing to MXC 1.0 .NET SDK - #1726

Merged
karkarl merged 14 commits into
mainfrom
bkudiess-mxc-dotnet-migration
Oct 20, 2026
Merged

karkarl merged 14 commits into
mainfrom
bkudiess-mxc-dotnet-migration

Conversation

@bkudiess

@bkudiess bkudiess commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Makes Windows-node command containment easier to configure and more reliable, replacing the legacy executable bridge with the official MXC .NET SDK.

User Impact

Users can choose Strict, Balanced or Open, then edit preset and custom folders using No access / Read only / Read and write. Explicitly allowed children remain accessible below a user-denied parent; protected application and credential locations remain non-overridable.

Intentional security-policy change: Windows UI API compatibility is always available inside MXC. The default-off toggle and saved legacy restriction are retired. This removes optional Win32k syscall blocking, not command approvals, container desktop isolation, desktop-control/input-injection restrictions, or filesystem/network/clipboard policy.

Supported Windows requires BaseContainer with native protected-path denies and no host ACL augmentation. Only positively identified unsupported Windows permits visibly warned, approved uncontained compatibility execution, where sandbox restrictions are not enforced. Missing SDK components, uncertain probes, policy errors and execution failures block instead of downgrading. Turning off Run system tools blocks node system.run, not the Gateway's separate exec tool.

Maintainer repairs preserve approved multiline direct arguments, reject noncanonical combined/embedded cmd command switches, report eight occupied execution slots as a retryable capacity error rather than a sandbox denial, and protect .openclaw-companion cleanup state even under Open.

Known blocking compatibility failure: on the tested Windows ARM64 build 26710, renaming a file inside the SDK-created TEMP directory returns Access denied. This can break tools that rename temporary files. Current-head native proof reproduces microsoft/mxc#1204; no broad package-directory grant or custom TEMP workaround is introduced.

Why This Change Was Made

Use Microsoft.Mxc.Sdk 1.0.0 directly instead of extracting an npm-supplied executable and maintaining a custom transport. MxcRequestBuilder owns the complete SDK request, MxcCommandRunner owns process/cancellation/finalization lifetime, and MxcRequestContext supplies immutable logical/physical private-state protection. Legacy executors remain deleted.

The migration preserves captured output at deadlines, separates root exit from SDK finalization, admits verified Cloud Files directories, protects registered Store/Dev Companion state, and rejects invalid scratch roots before creating directories. Cleanup removes only the four historically shipped legacy MXC files. Build cleanup uses built-in Windows PowerShell instead of requiring PowerShell 7.

Main through a259c566 is integrated, including #1732 (fix: prevent intermittent credential reads and false handshake timeouts). Its Connection fixes and surviving release-gated TestHost helpers are preserved; obsolete legacy-executor tests are not restored.

Evidence

Current maintainer-validated head: 7d544445fe3cd5f1b671928b429ebbfe1b815780. Normal ARM64 build and required managed suites passed with GitVersion enabled.

  • Shared: 4,396 passed, 25 opt-in skips, zero failed. Tray: 4,149 passed, zero skips/failures. WinNode CLI: 129 passed. Focused Connection: 57 passed. Cleanup contracts: 31 passed.
  • The actual host-process pipe fixture ran 30 repetitions. Every owned child exited during cleanup; the maximum measured post-root-exit completion was 612 ms, within the unchanged three-second assertion.
  • New managed regressions cover multiline argv round trips, real approval-coordinator routing, embedded cmd rejection, healthy capacity saturation and immutable cleanup-root protection. Fake SDK and injected unsupported-Windows tests are not native containment proof.
  • Opus 5.5 and GPT-6 Astra independently cleared the substantive repair delta 65f52c6d..b611071f. Later teardown-only, comment-only and main-integration changes were directly inspected. This does not imply an independent full final-head review or clear runtime gates.
  • User-approved native-only SDK1 proof: 6 passed, 1 failed, zero skipped. BaseContainer admission, native protected-path denies without host ACL augmentation, PowerShell startup, output/deadlines, synthetic folder policy and descendant cleanup worked. The TEMP rename assertion failed.
  • Hosted CI run 38988623659, attempt 2: passed, including CI Gate, on unchanged merge source. Tray UI: 471 passed, 25 skipped; Functional UI: 19 passed; Accessibility: 23 passed, with zero failures. Attempt 1 aborted at the five-minute inactivity limit after the pre-bootstrap trace, with zero completed UI tests. One failed-jobs retry succeeded; no source change was made for that hang and its exact cause is not established.

User-directed hold until patched-Windows proof is available. Native TEMP compatibility fails despite green CI. Strict current-head Gateway/MXC, complete visible UI, signed upgrade and enforcing-SAC proof remain unverified. No TEMP workaround, proof waiver or 90% take-confidence claim is made.

Historical author evidence, not current-head maintainer proof

The author reported normal build, Shared 4,275 passed/25 gated skips, Tray 4,059 passed, five focused cases, exact legacy cleanup fixtures without PowerShell 7, diagram consistency and strict Gateway/MXC 18/18 without skips for source committed as 80d7b368. The underlying local review-fixes-validation bundle was not retrievable in this maintainer session. These reports are retained as historical author claims, not independently verified or current-head runtime evidence.

The author also disclosed a native TEMP rename failure at ancestor 06399086..., associated with microsoft/mxc#1204. The two historical allowlist cases tolerated a child-spawn limitation and establish approval decisions, not universal executable compatibility. None of these gaps is waived.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-wsl-mxc: SDK migration, permissions and process ownership. Native-only SDK1 proof is 6 passed / 1 failed / zero skipped, blocked on TEMP rename. Not verified / blocked: strict real Gateway/MXC proof still needs an approved resource lane.
  • windows-winui-interactive: Sandbox controls, folder editing, preset presentation and compatibility-toggle removal. Hosted UI/accessibility suites passed on merge source. Not verified / blocked: complete changed-state visual/interaction proof; the pool is not complete.
  • windows-11-arm64: normal ARM64 build and managed suites passed; native-only SDK1 proof is 6 passed / 1 failed. Not verified / blocked: TEMP compatibility and complete runtime/UI coverage; this pool is not complete.
  • windows-clean-installer-upgrade: legacy payload retirement and packaged private-state behavior. Not verified / blocked: exact signed candidate and approved resettable host.
  • windows-11-sac-on: official signed-artifact reputation. Not verified / blocked: enforcing-SAC host and exact signed candidate.
  • windows-wsl-gateway-e2e: real Gateway, node, containment, pairing and recovery. Not verified / blocked: strict current-head fixture execution. Native Gateway lifecycle is separate.

Validation

Validated exact head 7d544445fe3cd5f1b671928b429ebbfe1b815780, tree 651dd695d409db1bbb958f484b4232f97da1e12b, in a user-approved standalone checkout under ignored artifacts\v1726. Its copied .git and GitVersion mutex are independent of other worktrees. No version bypass was used for the following results.

OPENCLAW_REPO_ROOT pointed to that checkout. For the managed suites, all three tray data-root overrides used owned temporary directories; OPENCLAW_TRAY_LOCAL_DATA_DIR and all native/E2E opt-ins were unset. Fresh test projects were built normally with dotnet build <project> --verbosity minimal before the required --no-restore runs. The subsequent bounded native-only harness used its own synthetic roots and native opt-in, with no tray, WSL or Gateway lifecycle. $proofRoot below is the owned results directory.

Exact command Result
.\build.ps1 Passed: Shared, Cli, WinNodeCli, SetupEngine and WinUI; Debug win-arm64
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --logger "trx;LogFileName=shared-normal-7d544445.trx" --results-directory "$proofRoot" 4,396 passed, 25 opt-in skipped, zero failed
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --logger "trx;LogFileName=tray-normal-7d544445.trx" --results-directory "$proofRoot" 4,149 passed, zero skipped/failed
dotnet test .\tests\OpenClaw.WinNode.Cli.Tests\OpenClaw.WinNode.Cli.Tests.csproj --no-restore --logger "trx;LogFileName=winnode-normal-7d544445.trx" --results-directory "$proofRoot" 129 passed, zero skipped/failed
dotnet test .\tests\OpenClaw.Connection.Tests\OpenClaw.Connection.Tests.csproj --no-restore --filter "FullyQualifiedName~LocalAiApiCredentialStoreTests|FullyQualifiedName~OperatorScopeHelperTests|FullyQualifiedName~CredentialResolverTests" --logger "trx;LogFileName=connection-normal-7d544445.trx" --results-directory "$proofRoot" 57 passed, zero skipped/failed
dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore --filter "FullyQualifiedName~GatewayPackageCleanupTests|FullyQualifiedName~LegacyMxc" --logger "trx;LogFileName=setup-normal-7d544445.trx" --results-directory "$proofRoot" 31 passed, zero skipped/failed
.\scripts\validate-docs.ps1 Passed, 63 Markdown files
.\scripts\validate-agent-skills.ps1 Passed, 11 skills and 20 Markdown files
.\scripts\validate-mxc-userfolders-native.ps1 -ArtifactDirectory "$proofRoot\native-candidate" -SourceManifest "$proofRoot\source-manifest.json" -ResultsDirectory "$proofRoot\native-results-7d544445" Failed: 6 passed, 1 failed, zero skipped. SDK-created TEMP rename denied; all seven fixture cleanups succeeded
.\scripts\Invoke-CiTest.ps1 -Project tests\OpenClawTray.FunctionalUI.Tests -ResultsDirectory TestResults\FunctionalUI -TrxFileName OpenClawTray.FunctionalUI.Tests.trx -Runtime win-x64 Hosted attempt 2: 19 passed, zero skipped/failed
.\scripts\Invoke-CiTest.ps1 -Project tests\OpenClaw.Tray.UITests -ResultsDirectory TestResults\TrayUI -TrxFileName OpenClaw.Tray.UITests.trx -Runtime win-x64 -Filter "Category!=Accessibility&Category!=NativeOnboardingProof" -HangTimeoutSeconds 300 Hosted attempt 2: 471 passed, 25 skipped, zero failed
dotnet test tests\OpenClaw.Tray.UITests --no-build -c Debug -r win-x64 --verbosity normal --results-directory TestResults\Accessibility --logger "trx;LogFileName=Accessibility.trx" --filter Category=Accessibility Hosted attempt 2: 23 passed, zero skipped/failed

Earlier diagnostic runs in the original shared worktree exposed fixture-readiness and deferred-chat-card timing failures. Both cases passed isolated diagnostics and then the full normal suites above. Failure records remain retained; shared-host contention is plausible but not established as their root cause. The measured post-root-exit assertion was not widened.

Local evidence includes the normal build log, five managed TRX files, native TRX/JSON records, process-ownership evidence and an 840-file binary hash manifest. Manifest SHA256: 165DEF80A352FA7BB21CFC022BAB52A60520EBAEA0268976304322D24389E09B. All frozen binary hashes were unchanged after native proof. These are local retained records, not uploaded GitHub artifact links or hosted CI results.

Both hosted attempts tested merge source 6612d31a8bdfdd4b5aebd77ec550db8de9fe2e19, combining this head with main c2ce4f50. The successful retry artifact was downloaded and its TRX counts verified. The retained attempt 1 artifact contains no completed Tray UI tests, two interrupted tests and no memory dump. The fixture and interrupted audio/layout test files are unchanged by this PR. The CI harness intentionally retains sequence data instead of potentially secret-bearing dumps.

Real Behavior Proof

  • Environment tested: Windows ARM64 build 26710, .NET SDK 10.0.401, SDK dependency Microsoft.Mxc.Sdk 1.0.0. Ordinary managed tests and one explicitly approved, bounded native-only run used synthetic roots. SDK probe selected BaseContainer with NeedsDaclAugmentation=false and native deny-path support.
  • PR head or commit tested: 7d544445fe3cd5f1b671928b429ebbfe1b815780. Built Shared DLL SHA256: 80F845EAD11531E2CC900A6D93D9960FC9BDA0EEF5FECB5564072BF012EAFA4E. ARM64 app executable SHA256: E57F2112A5C4F223987078EF54D04BF7CCC89050D737926AD1914275413B0C3C. Product version embeds this exact SHA.
  • Exact steps or command run: the normal Shared command above executed the real child-process fixture with stdout, stderr and both inherited streams, ten repetitions each. Readiness was gated before releasing the root; completion was measured after its verified exit while the child remained alive.
  • Evidence after fix: copied aggregate from per-iteration process-cleanup records:
{"Iterations":30,"AllOwnedChildrenExited":true,"MaxPostRootExitMs":612}
  • Observed result: the host compatibility executor completed without waiting for descendant pipe EOF, retained short output and cleaned each PID/start-time-verified child. The unsupported-Windows verdict was injected for this test; this is not proof on an actually unsupported OS, native MXC, MCP, or Gateway-mediated execution.
  • Native-only run: product-mxc-031108ee63014a8a9ec3869d39b654a5, at the same frozen head. The six passing tests cover default PowerShell startup, stdout/stderr with nonzero exit, synthetic user-folder/protected-path policy, background-descendant cleanup after normal root exit, deadline output retention and default environment isolation. All 34 recorded native process identities were no longer live; all seven fixtures were removed; recorded fixture/ancestor ACLs and real appdata metadata were unchanged.
  • Native failure: NativeSdk_TempIsReadyForCreateRenameDeleteWithoutPayloadInitialization created and read its file, but rename in %LOCALAPPDATA%\Packages\sandbox.{guid}\AC\Temp returned Access is denied. The second read failed. A trailing echo made the command exit zero, but the content assertion correctly failed the test. The upstream maintainer response says the fix is in an end-of-October OS update; that fix is not verified on this host.
{"NativePassed":6,"NativeFailed":1,"NativeSkipped":0,"MatchingOwnedProcessesStillLive":0,"FixtureCleanupsPassed":7,"RealAppdataMetadataUnchanged":true}
  • Screenshot or artifact links verified? (Yes/No/N/A): Yes for both hosted UI artifacts above. Native records are retained locally with copied results here; no complete changed-state visual proof is attached.
  • Not verified or blocked: passing native TEMP compatibility; strict .\scripts\validate-mxc-e2e.ps1 without -AllowSkip; broad child-executable compatibility; current-head local MCP discovery/invocation; real Gateway path; visible UI; actual unsupported Windows and x64; signed install/upgrade/SAC; packaged private-state behavior; native Gateway lifecycle and complete setup/recovery. The one native-only grant is complete. It did not authorize tray/UI, WSL/Gateway, OS/package installation or SAC changes.

Security Impact

  • New permissions or capabilities? (Yes/No): Yes. Configurable per-folder No access/RO/RW and fixed Windows UI API compatibility change policy behavior.
  • Secrets or tokens handling changed? (Yes/No): No authentication/storage redesign in this migration. Immutable filesystem protection includes credentials, registered Companion state and host-executed .openclaw-companion cleanup state. Main's independent credential-read fixes are preserved.
  • New or changed network calls? (Yes/No): No new service endpoint. Network policy remains configurable for contained execution; unsupported-Windows host execution does not enforce it.
  • Command or tool execution surface changed? (Yes/No): Yes. SDK execution replaces the executable bridge. Approved argv, execution lifetime, bounded output and the positive-unsupported compatibility route are explicit.
  • Data access scope changed? (Yes/No): Yes. Presets use the current-user profile and OS-resolved personal folders, with editable overrides and immutable sensitive-root exclusions.
  • If any answer is Yes, explain the risk and mitigation: Win32k blocking is intentionally retired for ordinary Windows command compatibility. Contained execution retains desktop isolation, desktop/system-control restrictions, input-injection denial and clipboard/network/filesystem policy. Protected paths reject explicit descendant grants, including prospective cleanup state. No host DACL mutation, whole-drive grant or failure-triggered uncontained downgrade is introduced. The host exception requires positive unsupported-Windows evidence and a persistent warning; approvals still apply. Prelaunch denials and capacity errors do not claim applied containment.

Compatibility and Migration

  • Backward compatible? (Yes/No): No, not in every policy detail. The Windows UI API restriction, old sandbox Off control and JSON-only SystemRunBlockHostFallbackWhenMxcUnavailable setting are retired. Their previous refusal behavior is not retained on positively unsupported Windows.
  • Config or environment changes? (Yes/No): Yes. Retired fields are ignored and omitted on save; NoAccess=3 preserves legacy Blocked=2. Invalid scratch roots fail before filesystem mutation. Build cleanup uses built-in Windows PowerShell; there is no permanent PATH or execution-policy change.
  • Migration needed? (Yes/No): Yes, handled by application/update paths; no manual credential migration is required.
  • If yes, list the exact upgrade steps: install/update normally. Exact-file cleanup removes only retired tools\mxc\{x64,arm64}\wxc-exec.exe and wslcsdk.dll payloads, preserving app-root SDK files, unknown files and user state. Existing folder customizations are preserved; onboarding initializes untouched policy once. Review retained conflicting grants. On unsupported Windows, disable Run system tools if uncontained node execution is unacceptable; Gateway-owned exec is a separate boundary. Downgrade behavior with No access has not been broadly validated.

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

Scoped local review findings were repaired and independently rechecked as described above. This update does not claim to resolve GitHub review threads. Runtime gates remain open.

bkudiess and others added 2 commits October 11, 2026 23:21
Replace the npm executable bridge with the official typed SDK, preserve command approvals and bounded process ownership, and add explicit unsupported-Windows compatibility. Apply user-folder permission presets, update onboarding probes, and retire obsolete upgrade payloads.

Co-authored-by: Copilot App <[email protected]>
Finalize the MXC SDK migration with per-folder access overrides, protected-state handling, reliable command output and scratch-root validation. Retire the Windows UI API toggle while preserving the remaining containment boundaries.

Co-authored-by: Copilot App <[email protected]>
@bkudiess bkudiess changed the title feat: modernize Windows node sandboxing and folder permissions feat: upgrade Windows node sandboxing to MXC 1.0 .NET SDK Oct 15, 2026
@bkudiess
bkudiess added this pull request to stack #1733 October 15, 2026 05:44
@bkudiess bkudiess added status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. and removed status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. labels Oct 15, 2026
Remove the onboarding InfoBar and its unused translations in all six locales.
Add a regression check while preserving capability controls and permission behavior.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 26fa7caf-f252-4aa7-8745-80cc78becd8f
@bkudiess bkudiess added status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. and removed status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. labels Oct 16, 2026
@bkudiess
bkudiess marked this pull request as ready for review October 16, 2026 04:51
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown

ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment @clawsweeper review. Please avoid repeated requests while a review is queued or running; agents should not request reviews automatically.

Use built-in Windows PowerShell for legacy payload cleanup.
Correct prelaunch approval-denial telemetry and align compatibility documentation.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 26fa7caf-f252-4aa7-8745-80cc78becd8f
@karkarl karkarl added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 16, 2026
…tely

Restore multiline direct argv, reject noncanonical combined cmd switches, and classify prelaunch saturation as node_busy without claiming applied containment.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f8285186-d7f5-4776-92ad-663771f5c96f
Preserve independent MXC payload retirement, isolated packaged-Gateway startup cleanup and both localization additions. Keep retired legacy executors removed.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f8285186-d7f5-4776-92ad-663771f5c96f
Protect prospective Companion cleanup state under Open and explicit grants. Reject embedded cmd command switches. Separate process fixture readiness from the bounded post-exit pipe assertion.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f8285186-d7f5-4776-92ad-663771f5c96f
Retry only Windows sharing violations for at most two seconds after owned fixture processes exit. Persistent cleanup failures and the post-root-exit drain deadline remain failures.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f8285186-d7f5-4776-92ad-663771f5c96f
Use vendor-neutral wording for the legacy MXC cleanup comment so App remains free of optional updater dependency names after main integration. No startup behavior changes.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f8285186-d7f5-4776-92ad-663771f5c96f
Integrate merged PR1732 without restoring the retired executor or its tests. Preserve both release-gated TestHost fixtures and inherited stream defaults; update drain-test inventory for the migrated runner.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f8285186-d7f5-4776-92ad-663771f5c96f
@karkarl karkarl added status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. and removed status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. labels Oct 16, 2026
@karkarl

karkarl commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Adversarial source review

Reviewed #1726 (feat: upgrade Windows node sandboxing to MXC 1.0 .NET SDK) at HEAD 7d544445fe3cd5f1b671928b429ebbfe1b815780, base and merge base a259c5668fe4658c26baff30940185c77e8f47a3. Both independent reviewers completed the full 126-file patch, affected callers/tests and prior-repair delta. Diagrams were assessed textually, not rendered. The earlier body-reported repair-delta review was not substituted for full coverage.

Coverage qualification: Astra reports every patch region read in full. Opus accounts for every region but describes targeted bodies/inventories for large or deleted test files. This is not a claim of identical line-by-line test coverage.

Actual reviewers: claude-opus-5.5, high, default context (3214578a-9cf0-4d85-a170-1336cc505716); gpt-6-astra, high, long_context (e2b60381-af23-485c-9cd5-bf4c7120337e). Both used the available read-only code-review type instead of unavailable rubber-duck. Identical actual launch prompt SHA256: 7922e856ca21d7e5cb7504f4bbdd21806feba717468ebf182bcab73b8c1e28f9. Full patch SHA256: 4cf80275c805458f956b4e35d53091dad494aca3106969bff893dadcde79e47f.

HIGH consensus

None. Astra found no significant source defects; this does not independently refute Opus's findings.

Issue Opus 5.5 GPT-6 Astra Fix Confidence
None not flagged not flagged N/A

LOW consensus, verified and disputed

Issue Opus 5.5 GPT-6 Astra Fix Confidence
F1: The resolved OPENCLAW_STATE_DIR approvals location is absent from immutable denies. New broad profile presets can expose relocated approval policy. MEDIUM not flagged 95%
F2: Build cleanup rejects any reparse ancestor before checking whether legacy payload exists, failing otherwise clean builds under junction/symlink paths. MEDIUM not flagged 80%
F3: Dev setup state under OPENCLAW_TRAY_LOCALAPPDATA_DIR\OpenClawTray-Dev is omitted from override protection. LOW not flagged 95%
F6: Folder-resolution warning says only commands using those folders are blocked, while the complete request is rejected. LOW not flagged 99%
F4: Scratch leftovers/cross-run access; disputed policy/robustness concern, not a new secrecy defect. LOW not flagged 60%
F5: Missing grant parents; unverified native behavior, not a demonstrated defect. LOW not flagged 70%

Source and scope: F1 protected roots, approvals path resolution and policy evaluation. F1 is expanded exposure through the new profile presets; explicit custom-folder exposure also existed in the baseline. Protect the authoritative resolved approvals location, not only its default. A native exploit was not executed.

F2 cleanup is mandatory from Build/Publish. Preserve no-follow deletion safety when fixing it. F3 local Dev path is narrower than the original two-override claim; active settingsDirectory is already protected. F6 request rejection contradicts SandboxPage_ScopeResolutionBlockedText.

Disputed/not retained: Opus F4 (LOW, scratch leftovers/cross-run access) is a robustness concern, but logged cleanup failure plus intentional broad profile access does not establish a new per-command secrecy violation. F5 (LOW, missing grant parents) extrapolates a deny-path comment to RO/RW native behavior without a verified contract. Keep that native test gap, not a demonstrated defect. Fix confidence if pursued: F4 60%, F5 70%. Intentional Win32k-toggle retirement and positive-unsupported-OS compatibility are not findings.

Validation and remaining gates

No tests or runtime operations were run by these reviewers. Published CI attempt 2 is green, including CI Gate. Downloaded hosted TRX reports verify Shared 4,414 passed, Tray 4,149, CLI 129, Tray UI 471, Functional UI 19 and Accessibility 23, with zero failed; totals include unexecuted cases. These are hosted results associated with this head, not the body's separate local counts or complete custom proof.

Actual SDK 1.0.0 README, package metadata and hash-verified generated PDB source were inspected. There is no shipped XML documentation. Handwritten wrapper internals and native policy enforcement remain partly unverifiable from those materials.

Keep the existing native hold: the body reports ARM64 build 26710 SDK proof 6 passed / 1 failed / zero skipped, failing TEMP rename (microsoft/mxc#1204). Green CI does not clear it. Passing patched-Windows TEMP proof, strict current-head Gateway/MXC, local MCP/winnode invocation, complete visible UI, actual x64/unsupported-Windows, packaged private state, signed upgrade/enforcing SAC and applicable setup/recovery proof remain outstanding.

Retain the declared pools: windows-wsl-mxc, windows-winui-interactive, windows-11-arm64, windows-clean-installer-upgrade, windows-11-sac-on and windows-wsl-gateway-e2e.

Recommendation: HOLD_FOR_AUTHOR. Address the retained source issues and obtain authorized patched-Windows/runtime proof. Take confidence: 50%. Confidence in retaining the hold: 95%. Fix confidence is a coordinator assessment, not model agreement or runtime proof.

@karkarl

karkarl commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

MXC runtime proof, October 19 and 20

Current update: the retained-capability revocation fix is published in 606041ac, with passing managed regressions and current strict WSL Gateway-to-node MXC proof (18/18, no skips). The SDK TEMP rename result is a documented upstream OS limitation, not by itself a required PR-code fix. GitHub currently reports merge conflicts, so this is not a blanket merge-ready claim. See the final revocation follow-up for current validation and limits. The earlier dated native results and screenshots below remain historical evidence; the missing installed-native app/profile was not recreated or retested.

Historical native tested head: 7d544445fe3cd5f1b671928b429ebbfe1b815780. Host: Windows build 26710, ARM64. Installed Store package: OpenClawFoundation.OpenClawGateway_rfcbke2p71se2, version 2026.10.400.0; Gateway payload 2026.10.4 at 383c124. The app executable hash matched the frozen head, and production package/listener attestation passed before native Gateway invocation.

Results

Check Result
Native Gateway -> paired Windows node -> system.run -> MXC Passed. Real node.invoke RPC, explicit Allow Once, successful command marker and granted-file read.
Existing read-only folder grant Passed. Read the synthetic canary under the existing C:\repos grant; creating another file there was denied. No folder grants were broadened.
Protected Companion state and ungranted path Passed. Reads of two task-created canaries were denied; their markers were absent from command output. The protected canary remained unchanged.
Local MCP discovery and invocation Passed. winnode --list-tools, system.which, connection diagnostics, and system.run. This is separate from the native Gateway RPC above.
Explicit command denial Passed. Selected Deny for a harmless marker command; the call returned UserDenied (user-denied).
Cancellation after native process creation Passed. Observed the exact contained process, sent MCP notifications/cancelled, received HTTP 204 and isError=true / cancelled, and verified that process exited.
Native SDK integration suite 6 passed, 1 failed, 0 skipped. Failure remains NativeSdk_TempIsReadyForCreateRenameDeleteWithoutPayloadInitialization: TEMP create/read works, rename returns Access is denied. The assertion correctly fails despite the shell's final exit code being zero.
Earlier strict WSL Gateway MXC suite at the same head 18 passed, 0 failed, 0 skipped. Rechecked the retained TRX; not rerun in this pass and not substituted for native Gateway proof.

The six passing native SDK cases cover PowerShell startup, stdout/stderr and nonzero exit, the four-scope synthetic folder/protected-path matrix, descendant cleanup, deadline handling, and isolated environment/TEMP creation. All seven fixture cleanup records passed; all 34 recorded native process identities were gone afterward, and real appdata metadata was unchanged.

Commands and observed native result

The native Gateway proof used the same RPC entry point as the repository's strict E2E suite:

& $packageQualifiedOpenClaw gateway call node.invoke `
  --params $rpc --json --expect-url 'ws://127.0.0.1:18789' --timeout 120000

$packageQualifiedOpenClaw was the installed Store family's qualified openclaw.exe alias. $rpc targeted the current paired node with command="system.run", canonical cmd.exe /d /s /c argv, a 10-second command deadline, synthetic canary paths, and a unique idempotency key. The convenience nodes invoke --command system.run form was rejected by this Gateway CLI before dispatch; the documented E2E RPC path above was used instead.

ok: true
stdout:
  PR1726_NATIVE_GATEWAY_MXC_OK
  PR1726_APPROVED_READ_CANARY
  PR1726_PROOF_FINISHED
stderr:
  Access is denied.
  Access is denied.
  Access is denied.
exitCode: 0
timedOut: false

The three denials were expected and checked independently against host-side canary state. App logs recorded the real node.invoke.request, an explicit approval, SDK probe/spawn, and exit. The spawn log reported requested=base-container, ro=3, rw=1, denies=16; its applied diagnostic was unknown, so this does not claim a separately reported applied-tier value.

Native suite command, using the already-built standalone validation checkout:

.\scripts\validate-mxc-userfolders-native.ps1 `
  -ArtifactDirectory $nativeRoot -SourceManifest $sourceManifest `
  -ResultsDirectory $nativeResults

Result: exit 1, 6/7 passed, as detailed above. All 168 frozen Shared test-output files matched their original-head hashes. Relevant native source/script files were unchanged. The separately preserved, uncommitted SetupEngine recovery fix was not loaded by this test project.

Current app screenshots

Connected installed native Gateway and active Windows node after command trust was established. The machine name is redacted:

Current PR build connected to the installed native Gateway with the Windows node active

Existing custom sandbox policy, including the read-only C:\repos grant used by the canary proof:

Current Node Sandbox UI showing the unchanged read-only folder grant

The harmless command approval immediately before choosing Deny:

Actual command approval dialog used for the explicit Deny proof

Captures include only the owned app windows, with outside-window borders cropped. No chat content, credentials, or tokens are published.

Cleanup and remaining gates

All three task-created canaries and the empty canary directory were removed. Temporary Local MCP enablement was restored to its original Off state. Sandbox/node settings and the exec-approval policy hash were unchanged. The user's connected app and native Gateway were left running; no Store lifecycle, system WSL, OS update, or source changes were performed.

Still not verified: successful TEMP rename on a patched/capable Windows host; live network/clipboard isolation permutations; the full permission/restart/kill-switch matrix; x64 native runtime, unsupported-Windows behavior, signed upgrade/private-state migration, and SAC proof. This evidence does not complete every declared proof pool or remove the existing merge hold.

October 20 follow-up: additional checks blocked before dispatch

At the same head, a fresh bounded proof window reverified the exact app process/start time/executable hash, isolated profile, installed Store package, production-attested native listener, and existing sandbox settings before input.

One normal UI action requested Local MCP enablement. The owned app log recorded server startup followed by SetMcpEnabled(false) about 0.4 seconds later. The CLI received connection refused, and a bounded listener-readiness check did not recover. UI and persisted settings both showed MCP Off. The cause is not established; this observation alone does not establish an MXC or UI regression. Automation stopped at the unexpected state-change boundary rather than retrying the toggle or restarting anything.

Additional check Actual result
Outbound network denial Blocked, not executed. A host-only TCP positive control to example.com:443 succeeded, but no contained network command was dispatched. The host control is not containment proof.
Clipboard read/write isolation with Clipboard None Blocked, not executed. No clipboard canary was set. No original clipboard content was read, saved, changed, or published.
System tools live OFF discovery and invocation kill switch Blocked, not executed. System tools was never toggled and remained On. No restart/persistence behavior was exercised.

Automated input and the runtime lane were released at 2026-10-20 03:24:32 UTC, ahead of the deadline. MCP was already back at its original Off baseline, so no restorative toggle was needed. System tools, node mode, sandbox grants/network/clipboard policy, and the exec-approval policy hash matched the baseline. The original app and production-attested native Gateway remained running. No task-owned probe process or pending operation remained.

The earlier successful native Gateway/MCP checks and three screenshots above remain evidence from the first pass, not results of this blocked follow-up. The native SDK result remains 6 passed, 1 failed, 0 skipped (TEMP rename), the retained strict WSL result remains 18 passed, 0 skipped, and all previously listed gaps and the merge hold remain.

October 20 second follow-up: network denial passes; live revocation gap found

Additional blocker: the System tools OFF setting did not revoke local MCP execution immediately. This is a measured capability-reload window, not evidence that the setting remains ineffective after reconnect completes, and not an exec-approval bypass.

A separate, freshly authorized window rebound the same app/head/profile/package/native listener. One focused keyboard activation of MCP stayed On, with successful owned winnode --list-tools reads across a bounded observation interval and successful system.which. This does not establish the cause of the earlier transient MCP shutoff. A proof-helper discovery argument error was corrected before any contained command was dispatched.

Check Result
Outbound network disabled Passed for the tested endpoint. Host TCP connection to 104.20.23.154:443 succeeded immediately before the contained test. The contained PowerShell probe used the identical numeric address/port and returned System.Net.Sockets.SocketException / AccessDenied, not DNS failure or timeout. No sandbox network grant was enabled.
Clipboard None Partial/inconclusive. Host write/readback of synthetic text succeeded. Contained PowerShell confirmed STA and loaded Windows Forms, but both clipboard read and write threw System.Runtime.InteropServices.ExternalException. The host clipboard sequence remained unchanged, and only the unchanged task canary was cleared. This establishes failed contained clipboard access and no observed host modification; the generic exception does not conclusively separate policy denial from a contained clipboard-backend failure.
System tools OFF: discovery Failed during live reload. With the setting persisted Off, tools/list still included system.run.
System tools OFF: invocation Failed during live reload. A new canonical cmd.exe /d /s /c "echo PR1726_KILL_SWITCH_F8285186" request returned that marker, exit code 0, timedOut=false, duration 229 ms, while both the UI toggle and persisted setting were Off.

The app log gives the following UTC sequence:

03:32:32.226  System tools OFF applied: CapabilityReload
03:32:33.944  MCP tools/call system.run
03:32:36.251  exec approval: allow, reason=approved, promptAttempted=True
03:32:36.286  MXC spawn
03:32:36.481  MXC exit 0
03:32:41.629  AttachClient rebuilt capabilities from the new settings
03:32:41.630  system capability registered with 4 commands instead of 6

The runner did not submit the approval in this kill-switch call; the log establishes that an approval occurred, not who supplied it. The finding is that the already-disabled command reached approval and execution. It does not claim execution without approval.

Source supports the observed approximately 9.4-second stale-capability window: SystemCapability captures includeRunCommands at construction and checks that captured value at invocation. ReconnectWithSyncedBrowserProxyForward starts reconnect asynchronously, while RefreshMcpOnlyCapabilities skips the immediate rebuild when a Gateway node client exists. AttachClient rebuilds later. Whether this gap predates this PR has not been established. No fix was deployed.

A new screenshot attempt was refused by the owned-window foreground guard, so no new image was captured or substituted. The evidence is copied UI state, persisted safe setting fields, discovery output, invocation output, and the timestamped trace. The original three screenshots above remain intact and do not depict this failure.

System tools was restored On, MCP restored Off, and sandbox/node settings plus the exec-policy hash matched their baseline. Clipboard cleanup used its unchanged sequence under an exclusive clipboard lock; original clipboard contents were never read or saved. The same app/native Gateway were preserved. Automated input ended at 03:34:57 UTC; the restoration-triggered reconnect finished capability registration at 03:34:58.240 and node registration at 03:35:00.322, confirmed afterward from logs. No pending task-owned operation remains.

The SDK 6 passed / 1 failed / 0 skipped TEMP result, retained strict WSL 18 passed / 0 skipped, full restart/persistence and clipboard-permutation gaps, and other platform/proof gaps remain. The live revocation failure is an additional blocker, not a replacement for the TEMP failure.

TEMP rename clarification: known upstream OS issue, fix awaiting rollout

The author's clarification is supported by microsoft/mxc#1204 (BaseContainer: rename not allowed in TEMP folder), which is closed. An MXC team member confirmed on September 21: "This issue is fixed in the upcoming OS updates. OS update (LCU) would be shipping end of October."

Treat the TEMP rename failure as a known upstream Windows limitation awaiting OS-update rollout, not a repository fix required from this PR. This supersedes the earlier wording treating that failure alone as a PR-code merge blocker. The observed result on the tested host remains 6 passed / 1 failed / 0 skipped; the upstream confirmation is not evidence that this host has received the fix or that the test now passes. The stated end-of-October timing is the upstream team's published expectation, not independently verified deployment availability.

The separate System tools live-revocation gap documented above is unaffected by this OS fix: an approved local MCP command executed after the toggle was Off and before capability reconstruction completed. That finding still needs resolution or an explicit maintainer risk decision; the TEMP clarification alone does not establish unconditional merge readiness.

System tools revocation follow-up (2026-10-20)

The retained-capability defect was reproduced with two isolated managed regressions before repair: local MCP still advertised system.run after a persisted Off transition, and a cached capability still accepted system.run.prepare. Both failed for those assertions, not for fixture initialization.

Published commit 606041ac fixes the stale permission snapshot. SystemCapability reads the current master permission during discovery and dispatch, after authorization, and at the runner's prelaunch revalidation boundary. NodeService supplies that predicate without waiting for Gateway reconnect. Re-enabling requires successful settings persistence; two additional red/green transaction regressions cover a pending enable and an enable that fails because another writer changed settings. Already-running processes are not terminated by this change.

Validation

  • .\build.ps1: passed.
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 4,400 passed, 0 failed, 25 ordinary-suite skips.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 4,154 passed, 0 failed, 0 skipped.
  • dotnet test .\tests\OpenClaw.WinNode.Cli.Tests\OpenClaw.WinNode.Cli.Tests.csproj --no-restore: 129 passed, 0 failed, 0 skipped.
  • Focused capability, approval, MCP, permission-persistence and wiring coverage: 126 Shared and 59 Tray tests passed with no skips.
  • .\scripts\validate-docs.ps1: passed, 63 Markdown files.

The first full Shared run and one bounded rerun hit a sharing violation in the existing process-identity fixture reader. The writer was already atomic. The test-only correction permits FileShare.Delete when reading the immutable published identity, preserving process identity checks, timeouts and all ten iterations per case. All 30 focused iterations and the same 30 iterations in the final full suite passed afterward. The original failures remain in the retained evidence.

Independent Copilot rubber-duck review identified the provisional-enable issue, which was corrected and covered by the transaction regressions. The shared Codex review helper failed authentication (HTTP 401); the fallback review is not represented as helper-isolated review, and its actual model was unavailable.

Real behavior proof and limits

.\scripts\validate-mxc-e2e.ps1 -NoBuild -RuntimeIdentifier win-arm64 passed 18/18, 0 failed, 0 skipped, without -AllowSkip or isolation-tier overrides. The script rebuilt the E2E project before execution. The run used the clean committed source and a frozen 596-file ARM64 app payload on Windows build 26712. All frozen hashes and the file count remained unchanged afterward.

The suite contains seven fixture-backed Gateway/MXC cases and eleven port-allocation cases. It exercised a new real WSL Gateway, paired Windows node and SDK-backed MXC command path, not the browsing/mock Gateway fixture. Copied current-run diagnostics:

gateway system.run payload: exitCode=0; stdout=OPENCLAW_GATEWAY_SYSTEM_RUN_MXC_OK; stderrLength=0
MXC denied-write payload: exitCode=1; stdoutLength=47; stderrLength=19; fileExists=False
[mxc] operation=spawn requested=base-container applied=unknown ro=2 rw=1 denies=18
[mxc] operation=exit applied=unknown exit=0 timedOut=False

TRX interval: 15:29:35 to 15:36:18 UTC. The proof-owned OpenClawE2E-26225229 distro, tray/keepalive processes and all three isolated data roots were removed. Cleanup and unchanged baseline runtimes were verified before releasing the lane at 15:37:37 UTC. No desktop input was used. This provides current windows-wsl-mxc / WSL Gateway path evidence, not blanket completion of those pools or the native/interactive pools.

The exact live native Off-toggle scenario was not rerun. Its retained-reference and pending-approval failure modes are covered by the new managed regressions; the strict WSL pass verifies real command/containment behavior on the patched build.

The former installed-native app/profile was absent at retest admission. It was not recreated, so this is not a rerun of that installed-native session. Earlier screenshots and the native SDK TEMP result (6 passed, 1 failed) remain historical evidence from their recorded source/host. The upstream OS-fix clarification above remains applicable; none of the managed results claim a newer OS fix is installed or that an entire custom proof pool is complete.

After publication, GitHub reports this PR as conflicting with its base (mergeable=false, mergeable_state=dirty). This patch was pushed normally; no conflict repair or merge was performed. Passing local validation does not remove that separate merge-readiness blocker.

Read live permission for retained capabilities and approval/prelaunch revalidation. Publish grants only after settings persistence, while honoring revocation immediately. Cover stale references and pending approvals, and allow immutable fixture identity reads to share atomic rename handles.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f8285186-d7f5-4776-92ad-663771f5c96f
Preserve persisted system-run revocation alongside encrypted-key recovery. Keep retired executors removed and preserve nonparallel coverage in the replacement runner tests.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f8285186-d7f5-4776-92ad-663771f5c96f
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednuget/​microsoft.mxc.sdk@​1.0.09510088100100

View full report

@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Priority Alert  (click "▶" to expand/collapse) Action
Low priority
Low adoption: nuget microsoft.mxc.sdk

Location: Package overview

From: src/OpenClaw.Shared/OpenClaw.Shared.csproj → nuget/[email protected]

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore nuget/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

@bkudiess bkudiess closed this Oct 20, 2026
@bkudiess bkudiess reopened this Oct 20, 2026
@bkudiess bkudiess closed this Oct 20, 2026
@bkudiess bkudiess reopened this Oct 20, 2026
karkarl and others added 2 commits October 20, 2026 13:57
Preserve persisted System tools permission reset alongside the incoming explicit Gateway URL provenance reset. Keep both encrypted-key recovery fields and all existing SDK migration changes.

Local execution remains deferred under shared-host scheduling. This merge is pushed to obtain new-head hosted CI; prior local readiness failures and current-head strict MXC proof remain unresolved gates.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f8285186-d7f5-4776-92ad-663771f5c96f
Cover absent and explicit saved Gateway URLs while preserving full snapshot equality for every other setting and independent NoAccess/Blocked assertions. Verify the saved JSON and reloaded URL provenance instead of expecting an unsaved setup default to survive persistence.

Hosted CI at 5fb3bff reproduced the old assertion failure. Local execution remains deferred under shared-host scheduling; new-head CI and mandatory local validation are still required.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: f8285186-d7f5-4776-92ad-663771f5c96f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants