Windows sandbox 0.146.0: physical standalone package reaches SpawnChild but CreateProcessAsUserW fails with error 2
Summary
On an official Windows standalone installation, the native sandbox cannot start even a harmless child process.
The PATH shim initially exhibits the helper-resolution problem already reported in #32655. However, unlike the reproductions in that issue, invoking the physical 0.146.0 release binary with its matching codex-resources directory available still fails later during SpawnChild:
CreateProcessAsUserW failed: 2
The setup helper, command-runner copy, and ACL setup all complete before the failure.
Environment
- Codex CLI:
0.146.0 - Installation: Windows standalone package
- Package architecture:
x86_64-pc-windows-msvc - Registry
ProductName:Windows 10 Pro DisplayVersion:25H2- OS build:
26200.8973 - Sandbox mode tested:
unelevated codex doctor: 17 checks OK, 0 failures
The failure occurs before model execution.
Minimal reproduction
Run from ordinary PowerShell:
$releaseRoot = Join-Path $env:USERPROFILE `
'.codex\packages\standalone\releases\0.146.0-x86_64-pc-windows-msvc'
$codex = Join-Path $releaseRoot 'bin\codex.exe'
$resources = Join-Path $releaseRoot 'codex-resources'
$cmd = Join-Path $env:SystemRoot 'System32\cmd.exe'
$originalPath = $env:Path
try {
$env:Path = "$resources;$originalPath"
& $codex sandbox windows `
-c 'windows.sandbox="unelevated"' `
-- $cmd /d /c `
'echo CODEX_WINDOWS_SANDBOX_OK'
Write-Host "SANDBOX_EXIT_CODE=$LASTEXITCODE"
}
finally {
$env:Path = $originalPath
}
Expected behavior
The sandbox should execute the harmless command and return:
CODEX_WINDOWS_SANDBOX_OK
SANDBOX_EXIT_CODE=0
Actual behavior
The setup stage succeeds, including locating/copying the command runner and completing the ACL work. The requested child process never starts:
windows sandbox: runner failed during SpawnChild:
CreateProcessAsUserW failed: 2
The sandbox command exits with code 1.
Additional tests
The same failure occurs when:
cmd.exeis supplied through its absoluteSystem32path.- Windows PowerShell 5.1 is supplied through its absolute path.
windows.sandbox_private_desktop=falseis set.- The physical release binary is used instead of the PATH shim.
- The matching release
codex-resourcesdirectory is prepended toPATH.
Confirmed:
codex-windows-sandbox-setup.exeexists and executes.codex-command-runner.exeexists, is found, and is copied.- The command targets exist and run outside the sandbox.
- The standalone and AppX resource copies inspected were identical.
codex doctorreports a healthy installation but does not detect this child-process launch failure.
The sandbox log also contains an Access denied warning involving C:\Users\Default, but I cannot establish whether that warning causes the CreateProcessAsUserW failure.
Relationship to #32655
Issue #32655 covers helper discovery through the Windows PATH shim. Its reported workaround or use of the physical package binary allows sandbox execution to succeed.
In this environment, correcting helper discovery allows setup to progress, but the physical package still fails during SpawnChild. This therefore appears to be an additional failure after the #32655 helper-resolution stage.
A sanitized sandbox.<date>.log can be supplied if needed. No files from .sandbox-secrets will be shared.
1 Comment
I can reproduce this on a newer Codex build and have submitted diagnostics through
/feedback.Feedback thread ID:
01a01b5b-c626-7190-ba8f-a8a3ed11c414Environment:
0.148.026200Current reproduction:
elevated->CreateProcessAsUserW failed: 2unelevated-> same errorC:\Windows\System32\cmd.exe-> same errorwindows.sandbox_private_desktop=false-> same error/setup-default-sandboxwas rerun successfully; after restarting Codex without session overrides, elevated mode was restored but the same error persistsThis is not PowerShell-specific:
cmd.exefails identically.Historical local sandbox logs provide a useful regression boundary:
OpenAI.Codex 26.803.10989.0/codex-command-runner 0.147.0-alpha.6.6-> sandbox commands completed withSUCCESS.OpenAI.Codex 26.810.4967.0.OpenAI.Codex 26.810.4967.0/codex-command-runner 0.148.0-alpha.9-> sandbox commands no longer completed successfully.0.148.0continues to reproduce the failure.The
C:\Users\Defaulthide usersAccess Denied warning does not appear sufficient to explain the regression, because the same warning was present on 2026-08-14 while sandbox commands were still completing successfully.Setup helper execution, command-runner resolution/copy, and ACL refresh complete before the child-process failure.
I can provide sanitized sandbox logs for the working 0.147 and failing 0.148-alpha periods if useful.