fix(mxc): PowerShell fails in the Windows node sandbox - #1147
Conversation
Add a secure-default, confirmed sandbox setting for Win32k-dependent tools such as PowerShell, wire it through node execution, and prove the local MCP and gateway paths. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 68c2f965-c837-4547-bb9b-75626d6725d4
Prove gateway-shaped PowerShell argv requests receive the structured fail-closed guidance when Windows UI access is disabled. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 68c2f965-c837-4547-bb9b-75626d6725d4
Retain the existing CI proof identifier while updating its behavior to validate PowerShell under the explicit Windows UI opt-in. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 68c2f965-c837-4547-bb9b-75626d6725d4
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 10, 2026, 9:00 PM ET / August 11, 2026, 01:00 UTC. ClawSweeper reviewWhat this changesThis PR adds a default-off, confirmed Node Sandbox setting that permits Win32k UI system calls so MXC-contained PowerShell and similar Windows tools can run. Merge readinessKeep open. The PR addresses the linked MXC command failure with credible current-head proof, but it introduces a malformed-direct-argv validation regression and requires explicit maintainer acceptance of a persisted Win32k boundary relaxation. Priority: P1 Review scores
Verification
How this fits togetherGateway and local MCP command requests enter the Windows node, which builds an MXC sandbox policy before starting a contained process and returning its result. The new setting controls whether that policy retains Win32k blocking or allows desktop UI APIs. flowchart LR
A[Gateway or local MCP command] --> B[Windows node]
B --> C[Sandbox settings snapshot]
C --> D{Windows UI APIs enabled?}
D -->|No| E[PowerShell fails closed]
D -->|Yes| F[MXC contained execution]
F --> G[Command result and diagnostics]
Decision needed
Why: This is a deliberate containment-policy change, not a purely mechanical bug repair, so the acceptable security posture needs maintainer intent. Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch deliberately relaxes an MXC containment boundary when an operator opts in, so explicit maintainer acceptance is needed despite its default-off confirmation flow. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the default-off confirmed opt-in, retain filesystem, network, clipboard, timeout, and command-approval controls, and repair the malformed-argv guard before a maintainer accepts the containment tradeoff. Do we have a high-confidence way to reproduce the issue? Yes. On an MXC-enabled Windows host, invoke direct-argv PowerShell through system.run while the default UI-deny policy is active; current main hardcodes that deny, and the PR provides a matching Gateway-to-node proof path. Is this the best way to solve the issue? Unclear. The default-off confirmed setting is a focused compatibility path with real runtime proof, but a maintainer must accept the broader UI boundary and the patch must preserve controlled handling of empty direct argv. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 582a44713860. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Resolve MXC command and testing documentation conflicts while preserving the current main approval proofs and the PowerShell UI-access proof. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 68c2f965-c837-4547-bb9b-75626d6725d4
|
Maintainer decision: accept the narrow, default-off, attended Win32k UI-access opt-in. Filesystem, network, clipboard, timeout, and command approvals remain enforced. Formal isolated MXC validation passed 17/17, and all required PR checks are green. |
Closes #1143
What Problem This Solves
Fixes an issue where users running common Windows commands such as PowerShell,
whoami, andtasklistthrough the Windows node would receive startup failures or empty output because the MXC sandbox always blocked Win32k system calls.Why This Change Was Made
Adds an explicit, secure-default Allow Windows UI APIs option to Node Sandbox settings. The option remains off by default, requires a confirmation dialog, keeps all presets UI-denied, and preserves filesystem, network, clipboard, timeout, and command-approval controls when enabled.
User Impact
Users can opt in to run PowerShell and other Win32k-dependent console tools inside MXC containment instead of disabling the sandbox entirely. When the option is off, gateway-shaped direct-argv PowerShell requests fail closed with actionable guidance.
Evidence
OPENCLAW_MXC_UI_OK, exit code 0, throughmxc-direct-appc.OPENCLAW_GATEWAY_MXC_UI_OK, exit code 0, after the normal Windows Allow Once prompt.contained=True,allowWindowsUi=True,uiAllowWindows=True, andcontainment=mxc.Change Type
Scope
winnodeValidation
.\build.ps1- passed; all product projects built and 46 Markdown files validated.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore- 3,638 passed, 32 gated integration tests skipped, 0 failed.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore- 2,249 passed, 0 failed..\scripts\validate-mxc-e2e.ps1- 17 passed, 0 failed. Required proofs reported: mirrored WSL-safe gateway port, PowerShell through real Gateway/Windows node/MXC, and denied writes to the tray data directory.python .agents\skills\autoreview\scripts\autoreview --mode branch --base origin/main- clean on merged head, no accepted/actionable findings.Real Behavior Proof
14073bf6..\scripts\validate-mxc-e2e.ps1; localwinnode system.run; raw gatewaynode.invokewithpowershell.exe -NoProfile -Command "Write-Output OPENCLAW_GATEWAY_MXC_UI_OK".Test Run Successful. Total tests: 17, Passed: 17; existing gateway payload{ stdout: "OPENCLAW_GATEWAY_MXC_UI_OK", stderr: "", exitCode: 0, success: true, durationMs: 638 }.executor=mxc-direct-appc,contained=True,uiAllowWindows=True, andcontainment=mxc.Security Impact
Yes, explain the risk and mitigation: the Win32k boundary is relaxed only after an attended confirmation. The setting defaults off, all presets force it off, and a persistent warning remains visible while enabled. Filesystem, network, clipboard, timeout, and command approvals remain enforced.Compatibility and Migration
false.Review Conversations