Windows elevated sandbox fails with “spawn setup refresh” after Codex CLI update; unelevated sandbox works
What version of Codex CLI is running?
codex -- version 0.133.0
What subscription do you have?
ChatGPT Plus account using Codex CLI
Which model were you using?
gpt-5.4
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
Windows PowerShell launched from taskbar shortcut. No terminal multiplexer in use.
Codex doctor report
{
"schemaVersion": 1,
"generatedAt": "1779466710s since unix epoch",
"overallStatus": "ok",
"codexVersion": "0.133.0",
"checks": {
"app_server.status": {
"id": "app_server.status",
"category": "app-server",
"status": "ok",
"summary": "background server is not running",
"details": {
"control socket": "C:\\Users\\<USERNAME>\\.codex\\app-server-control\\app-server-control.sock",
"daemon state dir": "C:\\Users\\<USERNAME>\\.codex\\app-server-daemon",
"mode": "ephemeral",
"pid file": "C:\\Users\\<USERNAME>\\.codex\\app-server-daemon\\app-server.pid (missing)",
"settings": "C:\\Users\\<USERNAME>\\.codex\\app-server-daemon\\settings.json (missing)",
"status": "not running",
"update-loop pid file": "C:\\Users\\<USERNAME>\\.codex\\app-server-daemon\\app-server-updater.pid (missing)"
},
"remediation": null,
"durationMs": 0
},
"auth.credentials": {
"id": "auth.credentials",
"category": "auth",
"status": "ok",
"summary": "auth is configured",
"details": {
"auth file": "C:\\Users\\<USERNAME>\\.codex\\auth.json",
"auth storage mode": "File",
"stored API key": "false",
"stored ChatGPT tokens": "true",
"stored agent identity": "false",
"stored auth mode": "chatgpt"
},
"remediation": null,
"durationMs": 0
},
"config.load": {
"id": "config.load",
"category": "config",
"status": "ok",
"summary": "config loaded",
"details": {
"CODEX_HOME": "C:\\Users\\<USERNAME>\\.codex",
"config.toml": "C:\\Users\\<USERNAME>\\.codex\\config.toml",
"config.toml parse": "ok",
"cwd": "C:\\Users\\<USERNAME>",
"enabled feature flags": "shell_tool, shell_snapshot, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_suggest, plugins, plugin_hooks, in_app_browser, browser_use, browser_use_external, computer_use, plugin_sharing, image_generation, skill_mcp_dependency_install, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, personality, fast_mode, tui_app_server, workspace_dependencies",
"feature flag overrides": "none",
"feature flags enabled": "27",
"log dir": "C:\\Users\\<USERNAME>\\.codex\\log",
"mcp servers": "0",
"model": "gpt-5.4",
"model provider": "openai",
"sqlite home": "C:\\Users\\<USERNAME>\\.codex"
},
"remediation": null,
"durationMs": 0
},
"installation": {
"id": "installation",
"category": "install",
"status": "ok",
"summary": "installation looks consistent",
"details": {
"PATH codex #1": "C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\codex",
"PATH codex #2": "C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\codex.cmd",
"PATH codex entries": "2",
"current executable": "C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin\\codex.exe",
"install context": "npm (package C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc, bin C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin, resources C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-path)",
"managed by bun": "false",
"managed by npm": "true",
"managed package root": "C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex",
"npm update target": "C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex"
},
"remediation": null,
"durationMs": 196
},
"mcp.config": {
"id": "mcp.config",
"category": "mcp",
"status": "ok",
"summary": "no MCP servers configured",
"details": {},
"remediation": null,
"durationMs": 0
},
"network.env": {
"id": "network.env",
"category": "network",
"status": "ok",
"summary": "network-related environment looks readable",
"details": {
"proxy env vars": "none"
},
"remediation": null,
"durationMs": 0
},
"network.provider_reachability": {
"id": "network.provider_reachability",
"category": "reachability",
"status": "ok",
"summary": "active provider endpoints are reachable over HTTP",
"details": {
"ChatGPT base URL": "https://chatgpt.com/backend-api/ reachable (HTTP 403)",
"reachability mode": "ChatGPT auth"
},
"remediation": null,
"durationMs": 107
},
"network.websocket_reachability": {
"id": "network.websocket_reachability",
"category": "websocket",
"status": "ok",
"summary": "Responses WebSocket handshake succeeded",
"details": {
"DNS": "2 IPv4, 2 IPv6, first IPv6",
"auth mode": "chatgpt",
"connect timeout": "15000 ms",
"endpoint": "wss://chatgpt.com/backend-api/<redacted>",
"handshake result": "HTTP 101 Switching Protocols",
"model provider": "openai",
"models etag present": "true",
"provider name": "OpenAI",
"proxy env vars": "none",
"reasoning header": "false",
"server model present": "false",
"supports websockets": "true",
"wire API": "responses"
},
"remediation": null,
"durationMs": 914
},
"runtime.provenance": {
"id": "runtime.provenance",
"category": "runtime",
"status": "ok",
"summary": "running npm on windows-x86_64",
"details": {
"commit": "unknown",
"current executable": "C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin\\codex.exe",
"install method": "npm (package C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc, bin C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin, resources C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-path)",
"platform": "windows-x86_64",
"version": "0.133.0"
},
"remediation": null,
"durationMs": 0
},
"runtime.search": {
"id": "runtime.search",
"category": "search",
"status": "ok",
"summary": "search is OK (bundled)",
"details": {
"search command": "C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-path\\rg.exe",
"search command readiness": "file exists",
"search provider": "bundled"
},
"remediation": null,
"durationMs": 0
},
"sandbox.helpers": {
"id": "sandbox.helpers",
"category": "sandbox",
"status": "ok",
"summary": "sandbox configuration is readable",
"details": {
"approval policy": "OnRequest",
"codex-linux-sandbox helper": "none",
"execve wrapper helper": "none",
"filesystem sandbox": "restricted",
"network sandbox": "restricted"
},
"remediation": null,
"durationMs": 0
},
"state.paths": {
"id": "state.paths",
"category": "state",
"status": "ok",
"summary": "state paths and databases are inspectable",
"details": {
"CODEX_HOME": "C:\\Users\\<USERNAME>\\.codex (dir)",
"active rollout files": "305 files, 43287081 total bytes, 141924 average bytes",
"archived rollout files": "0 files, 0 total bytes, 0 average bytes",
"goals DB": "C:\\Users\\<USERNAME>\\.codex\\goals_1.sqlite (file)",
"goals DB integrity": "ok",
"log DB": "C:\\Users\\<USERNAME>\\.codex\\logs_2.sqlite (file)",
"log DB integrity": "ok",
"log dir": "C:\\Users\\<USERNAME>\\.codex\\log (dir)",
"sqlite home": "C:\\Users\\<USERNAME>\\.codex (dir)",
"state DB": "C:\\Users\\<USERNAME>\\.codex\\state_5.sqlite (file)",
"state DB integrity": "ok"
},
"remediation": null,
"durationMs": 5751
},
"terminal.env": {
"id": "terminal.env",
"category": "terminal",
"status": "ok",
"summary": "terminal metadata was detected",
"details": {
"color output": "enabled",
"stderr is terminal": "true",
"stdin is terminal": "true",
"stdout is terminal": "true",
"terminal": "unknown",
"terminal size": "120x30"
},
"remediation": null,
"durationMs": 0
},
"updates.status": {
"id": "updates.status",
"category": "updates",
"status": "ok",
"summary": "update configuration is locally consistent",
"details": {
"cached latest version": "0.133.0",
"check for update on startup": "true",
"last checked at": "2026-05-22T01:37:07.004640500Z",
"latest version": "0.133.0",
"latest version status": "current version is not older",
"npm update target": "C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex",
"update action": "npm install -g @openai/codex",
"version cache": "C:\\Users\\<USERNAME>\\.codex\\version.json"
},
"remediation": null,
"durationMs": 765
}
}
}
What issue are you seeing?
After accepting a Codex CLI update, the Windows elevated sandbox consistently fails before executing even a basic command.
The failure is:
windows sandbox failed: spawn setup refresh
This happens with Codex CLI 0.133.0 on Windows when running the elevated Windows sandbox. The same command using the unelevated Windows sandbox succeeds.
Codex doctor reports overallStatus: ok, including sandbox.helpers: ok and updates.status: current/latest version 0.133.0, so the installation and configuration appear healthy, but the elevated sandbox runtime path still fails.
This appears specific to elevated Windows sandbox execution, not the project workspace, because I reproduced it from a clean scratch directory outside my project.
What steps can reproduce the bug?
- Open Windows PowerShell.
- Create and enter a clean scratch directory outside any project workspace:
New-Item -ItemType Directory -Force D:\Codex_Sandbox_Diag | Out-Null
Set-Location D:\Codex_Sandbox_Diag
Get-Location
- Confirm Codex is installed and check versions:
where.exe codex
codex --version
npm view @openai/codex version
Observed output:
C:\Users\<USERNAME>\AppData\Roaming\npm\codex
C:\Users\<USERNAME>\AppData\Roaming\npm\codex.cmd
codex-cli 0.133.0
0.133.0
- Run a basic command through the elevated Windows sandbox:
codex -c windows.sandbox="elevated" sandbox windows cmd /c echo CODEX_ELEVATED_SANDBOX_TEST_OK
Observed output:
windows sandbox failed: spawn setup refresh
- Run the same basic command through the unelevated Windows sandbox:
codex -c windows.sandbox="unelevated" sandbox windows cmd /c echo CODEX_UNELEVATED_SANDBOX_TEST_OK
Observed output:
CODEX_UNELEVATED_SANDBOX_TEST_OK
- Optional sanity check: run Codex doctor:
codex doctor --json
Observed summary:
- overallStatus: ok
- codexVersion: 0.133.0
- sandbox.helpers: ok
- updates.status: latest version 0.133.0 / current version is not older
Result:
The elevated Windows sandbox fails before executing the command, while the unelevated Windows sandbox succeeds from the same clean scratch directory.
What is the expected behavior?
The elevated Windows sandbox should successfully execute the basic command and print:
CODEX_ELEVATED_SANDBOX_TEST_OK
Because the same command works in unelevated mode, I would expect elevated mode to either:
- run the command successfully, or
- return a clear actionable setup/configuration error explaining what Windows setting or permission needs to be repaired.
Instead, elevated mode fails before the command executes with:
windows sandbox failed: spawn setup refresh
Expected elevated command:
codex -c windows.sandbox="elevated" sandbox windows cmd /c echo CODEX_ELEVATED_SANDBOX_TEST_OK
Expected output:
CODEX_ELEVATED_SANDBOX_TEST_OK
Additional information
Additional notes:
This began after I accepted a Codex CLI update. I do not know whether the update caused the issue, but the timing is why I am reporting it as a possible regression.
The issue persists today with Codex CLI 0.133.0, which appears to be the latest available npm version.
Codex doctor reports overallStatus: ok. Relevant doctor checks include:
- codexVersion: 0.133.0
- config.load: ok
- installation: ok
- auth.credentials: ok
- sandbox.helpers: ok
- updates.status: ok / latest version 0.133.0 / current version is not older
The failure appears specific to elevated Windows sandbox execution:
- Elevated sandbox fails in both my project workspace and a clean scratch directory.
- Unelevated sandbox succeeds in both my project workspace and a clean scratch directory.
- PowerShell and cmd both failed under elevated sandbox during earlier troubleshooting.
- This does not appear to be caused by the project repo path.
Current workaround:
codex -c windows.sandbox="unelevated" --sandbox workspace-write --ask-for-approval untrusted
I have not used dangerous/no-sandbox mode.
I have not changed global Codex config.
I am avoiding broad changes and only using the unelevated workaround temporarily for narrow, explicitly authorized tasks.
Platform:
Microsoft Windows NT 10.0.26200.0 x64
Terminal:
Windows PowerShell launched from taskbar shortcut.
No terminal multiplexer in use.
23 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This looks very close to #24050, but your repro is useful because it shows the mode split the other way around: elevated fails while unelevated succeeds.
The failing layer is before the target command runs. In current source, sandboxed execution calls a setup refresh helper first; the user-facing
windows sandbox failed: spawn setup refreshmessage usually means Codex could not spawncodex-windows-sandbox-setup.exeor that helper exited before it could refresh the sandbox ACLs.A few checks that would help distinguish UAC/manifest detection from a stale/broken helper path:
If the log shows
os error 740, it is the same class as #24050: Windows is treating the setup helper as elevation-required, likely because the helper name containssetup.exeand lacks an explicitasInvokermanifest. If it shows a different error, the exact line aftersetup refresh: failed to spawn ...should point to the real cause.Your current workaround,
windows.sandbox=unelevated, is the right low-risk workaround while this is investigated. I would avoid switching to no-sandbox just to work around this.Product-side, I think two fixes would help:
requestedExecutionLevel level=asInvokermanifest incodex-windows-sandbox-setup.exeas suggested in #24050codex doctorrun or validate the setup-refresh spawn path directly, becausesandbox.helpers: okis too weak here: it says configuration is readable, but not that the helper can actually be spawned.Thanks. I checked the sandbox files locally.
I am not going to upload the full sandbox log because it contains private local paths and a lot of unrelated historical project/workspace entries.
Summary of what I found:
codex-windows-sandbox-setup.exeexists under my npm Codex install..codex\.sandboxdirectory.setup refresh: spawning ... codex-windows-sandbox-setup.exeentries followed bysetup binary completed.os error 740match in the searched output.Result:
And the matching unelevated test still succeeds:
Result:
So my case may be related to #24050, but I do not currently have the same
os error 740evidence from my local search output.Same here lots errors like below. Codex is unusable for me at the moment. Suggested workaround seems to be working but keeps asking for everything so still making the cli practically unusable
Adding a related Codex Desktop / Chrome browser-client data point.
Environment observed in Codex Desktop:
Symptom:
In Codex Desktop, attempting a lightweight Chrome Extension backend check through the bundled Chrome plugin browser-client caused the Node REPL kernel to exit before
agent.browsers.get("extension")/browser.user.openTabs()could be reached.Observed twice after a full PC reboot:
This happened after Chrome-side static checks passed. I did not read or include any tab URLs, tab titles, page contents, cookies, local storage, or profile data.
Why this seems relevant to this issue:
Most discussion here is about direct
codex ... sandbox windows ...CLI repros. This appears to be the samespawn setup refreshfailure surfacing inside Codex Desktop's browser-client / Node REPL path, so it can make the Chrome Extension backend look unavailable even when Chrome, the extension, and the native host manifest are healthy.Expected:
The Chrome backend bootstrap should either reach
openTabs()or return an actionable runtime / sandbox setup error. It should not look like a Chrome Extension install or native-host failure when those static checks pass.Adding one more data point that matches the
os error 740branch described above.Environment:
codex-cli 0.133.0Symptom:
Browser / Node REPL startup fails before any browser automation, target URL, or site-specific code runs.
A minimal Node REPL call fails with:
I reproduced the lower-level failure by invoking the bundled Codex CLI used by the Node REPL environment directly:
Expected:
Actual:
The sandbox log contains the concrete failure:
So this looks like the same class of failure described above: the sandbox setup refresh path cannot spawn
codex-windows-sandbox-setup.exebecause Windows treats that helper launch as elevation-required.Why this matters for Codex Desktop / Browser:
This failure surfaces before the browser-client can connect to the already-started browser backend. That can make Browser/Chrome/Node REPL look broken even when the browser backend, extension/static setup, and target URL are unrelated to the failure. The failing layer appears to be the sandboxed Node kernel setup through the bundled Codex CLI.
This also seems consistent with the proposed product-side fixes:
codex-windows-sandbox-setup.exean explicitasInvokermanifestcodex doctorvalidate the actual setup-refresh spawn path, not only that sandbox helper configuration is readableAdditional local result after re-testing on Windows Codex Desktop:
OpenAI.Codex_26.519.11010.0_x64__2p2nqsd0c76g026.519.81530codexcommand resolves to WindowsApps Desktop CLI path.CODEX_CLI_PATHare unset.node_replMCP env still has a tool-ownedCODEX_CLI_PATHunderC:\Users\n-kei\AppData\Local\OpenAI\Codex\bin\...\codex.exe, and that executable reportscodex-cli 0.133.0.Changing user config from:
to:
resolved the
node_repl kernel exited unexpectedly/windows sandbox failed: spawn setup refreshpath for the bundled browser runtime in this environment.After the change, capability-only checks succeeded:
node_replbaseline JS execution succeeded.setupBrowserRuntime({ globals: globalThis })succeeded using the bundled browser client.agent.browsers.list()returned both Chrome Extension and Codex In-app Browser backends.agent.browsers.get("extension")succeeded.extensionBrowser.user.openTabs()succeeded and returned a tab count. I did not print tab URLs, titles, page bodies, cookies, or session data.I also added
--isolatedto@playwright/mcp@0.0.68args to avoid persistedmcp-chromeprofile locks, but the sandbox-refresh fix above was specifically the[windows] sandbox = "unelevated"change.I’m seeing a related but slightly different failure mode on Codex CLI 0.134.0.
Environment:
10.0.26200.8457, x64systeminfo:OS Version: 10.0.26200 N/A Build 26200cmd /c ver:Microsoft Windows [Version 10.0.26200.8457]PowerShell: 7.5.5net session:There are no entries in the list.codex doctor: installation/auth/config/network/websocket/sandbox.helpers are OKContainers-DisposableClientVM): DisabledOne additional data point: the Windows Sandbox optional feature (
Containers-DisposableClientVM) is disabled on my machine, while Virtual Machine Platform and WSL are enabled. I’m not sure whether Codex’s native Windows sandbox is expected to depend on that Windows optional feature, but I’m including it because this issue appears to be in the Windows sandbox setup path.Minimal repro from a clean directory:
Observed CLI output:
However,
~/.codex/.sandbox/sandbox.logshows a lower-level setup refresh failure:I also verified that the setup helper exists and is runnable directly from the same elevated PowerShell session:
So the helper binary itself appears to be present and not globally blocked. Running it directly does not produce
ERROR_ELEVATION_REQUIRED (740); it reaches the helper’s own argument validation path.The
ERROR_ELEVATION_REQUIRED (740)only appears when Codex spawns the helper during setup refresh. This suggests the user-visibleCreateProcessAsUserW failed: 2may be a secondary/lossy surface error, while the more actionable root signal is the setup helper spawn failing withos error 740.Potentially useful diagnostics:
os error 740directly instead of the laterCreateProcessAsUserW failed: 2I’m not opening an unsolicited PR due to the contribution policy, but I’m happy to provide more logs or test a diagnostic patch if maintainers think it would help.
I think the real mismatch is that doctor is proving "config is readable" while the failing user path is "the setup-refresh helper can actually spawn." Those are very different checks.
If elevated mode depends on
codex-windows-sandbox-setup.exesurviving that setup-refresh spawn, doctor should exercise that exact path and print the helper binary, elevation context, and raw Win32 failure when it breaks. Otherwise users get an all-clear from doctor and then a runtime-only failure, which sends them chasing workspace ghosts instead of the helper path.Yes, I think that’s the right distinction.
In my case,
codex doctoralso made the environment look healthy, but the actual sandbox execution path failed later during setup refresh. The lower-level signal in~/.codex/.sandbox/sandbox.logwas:So I would split this into two related issues:
codex doctorchecks that the config/helper state is readable or inspectable, but it does not appear to exercise the actual setup-refresh path that spawnscodex-windows-sandbox-setup.exe.During real sandbox execution, Codex fails while spawning
codex-windows-sandbox-setup.exe. In my case, the lower-level Win32 signal isERROR_ELEVATION_REQUIRED (os error 740).I also verified that the helper binary exists and is directly runnable from the same elevated PowerShell session. Running it directly reaches its own argument validation path:
That makes the doctor/runtime gap more noticeable, because the failure only appears when Codex spawns the helper during setup refresh.
Additionally One more timeline detail from my local sandbox log: this was not failing from the beginning. At
2026-05-22 03:50:13, the setup-refresh path successfully spawnedcodex-windows-sandbox-setup.exeand reachedsetup binary completed. Starting at2026-05-22 04:44:22, the same setup-refresh path started failing withos error 740.I also checked file timestamps around that transition. There were no modified files under the npm package root between
2026-05-22 03:45and04:50, but under%USERPROFILE%\.codexI saw.sandbox-bin\codex-command-runner-0.133.0.execreated at03:49:48, a successful session around03:49/03:50, and a failing session starting at04:44.So this looks less like an environment that was broken from the beginning, and more like a setup-refresh/runtime state transition after a previously successful setup refresh.
A useful
doctorcheck should either exercise the setup-refresh path that spawnscodex-windows-sandbox-setup.exe, or at least report the helper path, elevation/integrity context, and raw Win32 error when that helper cannot be spawned.I also encountered the same problem. I started pwsh as an administrator, and then launched codex within it. The error message disappeared.
I don't know if there are any risks in using it this way.
The problem appears to be that, despite having a sandbox setup phase complete successfully in an elevated/UAC context, the _later_ actual execute command also tries to re-apply the sandbox setup. This fails, because it is not elevated and can't.
I'm guessing the solution is to either:
_or_
This also explains why @uyoufu's work around works, since in this case, the second setup will execute with elevation.
Relevant sandbox logs from an e2e test of my own software:
At
[permission-e2e][sandbox.log] [2026-05-28T09:22:40.506653700+00:00] read ACL run completedan elevated sandbox setup completesAt
[permission-e2e][sandbox.log] [2026-05-28 11:22:40.630 codex.exe] setup refresh: spawning C:the unelevated command runner/executor tries to install the sandbox _again_ and fails, because it did not ask for elevation.As a work around, running the entire thing elevated _seems_ safe, since the commands will still execute in the sandbox, even if the parent codex is elevated. _But_ I don't know if there are ways for codex to execute commands/processes outside the sandbox anyway? In that case this work around would massively increase the blast radius...
codex windows sandbox: spawn setup refresh problem persists on new version 0.134.0, fallback to 0.132.0 version problem solved.
This was useful for me too. Changing the user config from
[windows] sandbox = "elevated"to[windows] sandbox = "unelevated"and restarting fixed thenode_repl kernel exited unexpectedly/windows sandbox failed: spawn setup refreshissue, and restored both Chrome extension and in-app browser control.I’m seeing a very similar Windows elevated sandbox failure, now on Codex CLI
0.136.0, after extensive troubleshooting.Feedback ID from Codex:
no-active-thread-019e8b74-fe59-70c1-b2a1-39da9677aafEnvironment:
10.0.26200x64OpenAI.Codex 26.601.2237.00.136.0C:\Program Files\Git\cmd\git.exe,git version 2.51.0.windows.1C:\PRKC\acculynx-mcpAdding a cross-reference to a confirmed Codex Desktop /
node_repl/ Browser / Chrome recovery case: https://github.com/openai/codex/issues/25419#issuecomment-4639724031Summary: with
[windows] sandbox = "elevated", the AppDatacodex-windows-sandbox-setup.exehelper failed during setup refresh withos error 740. A per-user AppCompatRUNASINVOKERentry for the exact failing helper path restorednode_repl, the in-app Browser, and Chrome extension backend control without switching tounelevatedorno-sandbox.Caveat: this is path-keyed and should be user-approved because it is a persistent per-user compatibility override. If a Codex update changes the helper path/hash, the entry may need to be added for the new path. The linked comment includes a prompt users can give Codex to verify the exact failure and request approval before changing anything.
this is now fixed
@iceweasel-oai I retested after updating to
codex-cli 0.139.0.Correct Windows identity:
@roofpropaul
is now fixed in 0.140;
0.140.0-alpha.2
please wait 0.140
Confirmed the fix works for me when launching directly from
0.140.0-alpha.19.What I did:
codex-package-x86_64-pc-windows-msvc.tar.gzC:\Users\silve\Downloads\codex-alpha-test\rust-v0.140.0-alpha.19C:\Users\silve\Downloads\codex-alpha-test\rust-v0.140.0-alpha.19\bin\codex.exe```toml
[windows]
sandbox = "elevated"
sandbox_private_desktop = true
Validation succeeded inside elevated sandbox:
git status --porcelain=v1 -b returned ## main...origin/main
git rev-parse --is-inside-work-tree returned true
git rev-parse HEAD matched origin/main
No windows sandbox: spawn setup refresh
No CreateProcessAsUserW failed: 5
No os error 740
Caveat:
The normal PATH codex --version still resolves to stable 0.139.0.
Calling the alpha directly returned codex-cli 0.140.0-alpha.19.
The alpha codex --version command printed warnings about failing to clean up/create C:\Users\silve\.codex\tmp\arg0 PATH aliases due to access denied, but the command exited successfully and Git worked.
Additional data from a native Windows 11 10.0.26200 x64 machine on standalone Codex CLI 0.144.4:
codex doctor --jsonreportedoverallStatus: okandsandbox.helpers: ok.helper_unknown_error: setup refresh had errors.[windows] sandboxto"unelevated"reduced the same probe to 2.3 s with project-local TEMP and 3.5 s with normal TEMP.sandbox_moderemained"workspace-write"; a write outside the workspace was correctly denied (Access denied, about 4.0 s).apply_patchsucceeded twice, most recently in 20.599 s and 13.814 s. This is usable compared with the earlier 60–210 s behavior, but still much slower than raw filesystem writes.This suggests that
doctorchecking that the sandbox configuration/helpers are readable is not sufficient to detect the elevated setup-refresh failure. A real spawn/write/isolation probe would catch it.I am going to retest after updating from 0.144.4 to 0.144.5 and will post the post-update measurements separately.
Post-update result for Codex CLI 0.144.5 on the same Windows 11 machine:
Working path (
[windows] sandbox = "unelevated"):Forced elevated comparison, without changing the global config:
CreateProcessWithLogonW failed: 2The project-local TEMP case is a regression from 0.144.4 on this machine: it previously allowed elevated mode to start after about 22.3 s. In 0.144.5 both TEMP variants fail in elevated mode.
codex doctorstill reports overall OK / installation consistent, so a real elevated spawn probe is still needed to detect this state.Update-path note: built-in
codex updateinvoked Windows PowerShell and failed because the installer could not resolveGet-FileHash. Running the same officialhttps://chatgpt.com/codex/install.ps1through MSI PowerShell 7 completed the 0.144.5 installation successfully.Reproduced again on July 17, 2026 with a current Codex Desktop build:
26.715.2305.0codex-cli 0.145.0-alpha.18Microsoft Windows NT 10.0.26200.0 x64sandbox_mode = "workspace-write"With:
the first ordinary workspace read command did not reach PowerShell and had to be terminated after more than 30 seconds. During troubleshooting, six lingering
codex-windows-sandbox-setup.exeprocesses were present (both the packaged WindowsApps helper path and one LocalAppData helper path). The current test created another helper that did not exit automatically.The sandbox log reached the setup/ACL phase (helper spawned, workspace write ACE applied, read ACL run completed), but never logged
setup binary completed. No probe file was created, and the leftover setup helpers had to be terminated manually.After changing only the Windows implementation to:
and restarting Codex Desktop:
codex-windows-sandbox-setup.exeprocess count remained 0;danger-full-accesswas not needed.This looks like either a regression after the reported 0.140 fix or a separate elevated-helper hang after ACL work finishes. The issue is still reproducible in Desktop/bundled CLI
0.145.0-alpha.18. I can provide a sanitized sandbox-log excerpt and an in-product Feedback ID if useful.In-product Feedback ID:
019f6df6-f568-7122-8354-a33e5039658a