Windows sandbox setup helper triggers UAC installer detection (os error 740)
What happened?
On Windows, non-elevated sandboxed tool execution started failing before the command itself was launched. Even trivial commands such as rg --version or cmd /c ver failed with:
windows sandbox: spawn setup refresh
The sandbox log showed the underlying failure:
setup refresh: spawning C:\Users\vision\AppData\Local\Microsoft\WinGet\Links\codex-windows-sandbox-setup.exe (...)
setup refresh: failed to spawn C:\Users\vision\AppData\Local\Microsoft\WinGet\Links\codex-windows-sandbox-setup.exe: 请求的操作需要提升。 (os error 740)
os error 740 is Windows reporting that the requested operation requires elevation.
Environment
- OS: Windows 10.0.26200.8457
- Codex CLI:
codex-cli 0.133.0 - Install source: WinGet package
OpenAI.Codex0.133.0 - Package release:
rust-v0.133.0 - Config had
[windows] sandbox = "elevated"
Reproduction
After installing/updating Codex 0.133.0 from WinGet, run any sandboxed command from Codex without require_escalated, for example:
rg --version
cmd /c ver
Expected: command runs in the Codex Windows sandbox.
Actual: command fails before launch with windows sandbox: spawn setup refresh.
Diagnosis
The target exists and is signed:
C:\Users\vision\AppData\Local\Microsoft\WinGet\Links\codex-windows-sandbox-setup.exe
-> C:\Users\vision\AppData\Local\Microsoft\WinGet\Packages\OpenAI.Codex_Microsoft.Winget.Source_8wekyb3d8bbwe\codex-windows-sandbox-setup.exe
Authenticode signature verified as valid.
The failure appears to be caused by Windows UAC installer detection: the helper filename contains setup.exe, and the binary did not appear to have an embedded requestedExecutionLevel manifest. Windows therefore treated it as requiring elevation and CreateProcess returned error 740.
Workaround that confirmed the diagnosis
Embedding an asInvoker manifest into codex-windows-sandbox-setup.exe fixed the issue locally:
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
After embedding the manifest, the same non-elevated sandboxed commands succeeded:
cmd /c ver
rg --version
The sandbox log then showed successful setup refresh:
setup refresh: processed 3 write roots (read roots delegated); errors=[]
SUCCESS ... rg --version
Suggested fix
Please embed an explicit application manifest into codex-windows-sandbox-setup.exe, likely with:
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
Alternatively, rename the helper so it does not match Windows installer-detection heuristics, but an explicit manifest is probably safer.
10 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I can confirm this on another Windows machine with the npm-installed Codex package, not WinGet, so the issue does not appear to be specific to the WinGet link/package layout.
Environment observed:
IsElevatedAdmin: False)codex-cli 0.133.0%APPDATA%\npm\node_modules\@openai\codex\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\codex-resources\codex-windows-sandbox-setup.exeread-onlyandworkspace-writedanger-full-accessdid not fail, consistent with it skipping setup refreshThe sandbox log showed the same underlying error before the requested command executed:
I also reproduced it outside the agent/session layer with a direct non-elevated
CreateProcess-style launch:Result:
A byte-string scan of the installed helper did not find
requestedExecutionLevel,asInvoker,requireAdministrator,requestedPrivileges, ortrustInfo. That matches the installer-detection diagnosis in this issue. The v0.133.0 source pathcodex-rs/windows-sandbox-rs/src/setup.rsalso explicitly says refresh should not request elevation before launching this helper viaCommand::new(...).status(), so the failure is occurring below the tool/session caller and before the requested shell command starts.We are also affected by this on the latest version 0.133.0, confirmed by installation via Scoop.
same issue since 0.133 update. can confirm -s danger-full-access works fine
{
"schemaVersion": 1,
"generatedAt": "1779581178s since unix epoch",
"overallStatus": "warning",
"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>\\Documents\\Codex\\2026-05-23\\execution-error-io-custom-kind-other",
"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",
"feature flag overrides": "workspace_dependencies=false",
"feature flags enabled": "26",
"log dir": "C:\\Users\\<USERNAME>\\.codex\\log",
"mcp servers": "0",
"model": "gpt-5.5",
"model provider": "openai",
"sqlite home": "C:\\Users\\<USERNAME>\\.codex"
},
"remediation": null,
"durationMs": 0
},
"installation": {
"id": "installation",
"category": "install",
"status": "warning",
"summary": "npm-managed launch could not inspect npm global root",
"details": {
"PATH codex #1": "c:\\path\\codex.cmd",
"PATH codex #2": "C:\\Program Files\\WindowsApps\\OpenAI.Codex_26.513.4821.0_x64__2p2nqsd0c76g0\\app\\resources\\codex",
"PATH codex #3": "C:\\Program Files\\WindowsApps\\OpenAI.Codex_26.513.4821.0_x64__2p2nqsd0c76g0\\app\\resources\\codex.exe",
"PATH codex entries": "3",
"current executable": "C:\\dev\\node\\node-v22.18.0-win-x64\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin\\codex.exe",
"install context": "npm (package C:\\dev\\node\\node-v22.18.0-win-x64\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc, bin C:\\dev\\node\\node-v22.18.0-win-x64\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin, resources C:\\dev\\node\\node-v22.18.0-win-x64\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-resources, path C:\\dev\\node\\node-v22.18.0-win-x64\\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:\\dev\\node\\node-v22.18.0-win-x64\\node_modules\\@openai\\codex",
"npm root -g failed": "program not found"
},
"remediation": null,
"durationMs": 33
},
"sandbox.helpers": {
"id": "sandbox.helpers",
"category": "sandbox",
"status": "ok",
"summary": "sandbox configuration is readable",
"details": {
"approval policy": "Never",
"filesystem sandbox": "restricted",
"network sandbox": "enabled"
},
"remediation": null,
"durationMs": 0
},
"runtime.provenance": {
"id": "runtime.provenance",
"category": "runtime",
"status": "ok",
"summary": "running npm on windows-x86_64",
"details": {
"commit": "unknown",
"current executable": "C:\\dev\\node\\node-v22.18.0-win-x64\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin\\codex.exe",
"platform": "windows-x86_64",
"version": "0.133.0"
},
"remediation": null,
"durationMs": 0
},
"updates.status": {
"id": "updates.status",
"category": "updates",
"status": "warning",
"summary": "npm update target could not be inspected",
"details": {
"cached latest version": "0.133.0",
"latest version": "0.133.0",
"latest version status": "current version is not older",
"npm root -g failed": "program not found"
},
"remediation": null,
"durationMs": 509
}
}
}
Adding another confirmed repro that closely matches this issue.
Environment:
10.0.262000.135.0v24.12.0, npm11.12.15.1.26100.8521[windows] sandbox = "elevated"From a clean scratch folder, host process launch works:
But the direct elevated Windows sandbox probe fails before the requested command starts:
The underlying sandbox log line is:
The unelevated fallback does not work on this machine either:
I also did a bounded read-only inspection of the local helper without launching it. The helper path shape is:
Observed helper facts:
x64 / AMD64 (0x8664)requestedExecutionLevel,asInvoker,requestedPrivileges, ortrustInfostrings found in a basic ASCII/UTF-16 string scansetup,install, andupdateThe local result supports the same general diagnosis as this issue: normal setup refresh is trying to launch a helper that Windows classifies as elevation-required, and because Codex launches it through
CreateProcess-style semantics, it fails withERROR_ELEVATION_REQUIRED/740before the command can run.One nuance: Microsoft currently documents UAC Installer Detection as applying to 32-bit executables without a requested execution level, while my local helper is AMD64. So I do not want to overclaim that the filename alone is the entire mechanism in this specific repro. Still, the practical fix direction looks the same:
requestedExecutionLevel level="asInvoker" uiAccess="false"manifest.setup.exe-named binary.codex sandbox setup --elevated.codex doctorrun the same minimal sandbox spawn path used by normal commands, because doctor can otherwise look healthy while direct sandbox probes fail.I have a sanitized diagnostic zip with logs, probe results, helper inspection, and UAC references, but I will share that privately with OpenAI Support rather than attach local environment details publicly here.
the v0.137.0 seems to have solved it? Did not notice those errors any more.
I’m seeing a related Windows Computer Use failure on Codex Desktop as well.
Environment:
C:\Users\AdministratorInitial failure:
windows sandbox failed: spawn setup refreshstdout_eofos error 740while spawning:C:\Users\Administrator\AppData\Local\OpenAI\Codex\bin\fb2111b91430cb17\codex-windows-sandbox-setup.exeWorkaround applied:
RUNASINVOKERfor the setup helper path above.os error 740disappeared.setup refresh: processed 1 write roots (read roots delegated); errors=[]setup binary completedRemaining failure:
Computer Use native pipe path is unavailablecomputer-use notify config ensure finished platform=win32 reason=missing-helper-path status=skippedcomputer-use native pipe startup failed errorMessage="Windows Computer Use helper paths are unavailable"computer_use_native_pipe_thread_config_skipped platform=win32 reason=not-readyAdditional check:
C:\Users\Administrator\.codex\plugins\cache\openai-bundled\computer-use\26.602.40724C:\Users\Administrator\.codex\plugins\cache\openai-bundled\computer-use\latest -> 26.602.40724latest:C:\Users\Administrator\.codex\plugins\cache\openai-bundled\computer-use\latest\node_modules\@oai\sky\bin\windows\codex-computer-use.exemissing-helper-pathand does not start the Computer Use native pipe.So
RUNASINVOKERfixes the 740 part, but the app still cannot resolve/start the Computer Use helper paths afterward.I can reproduce this from the VS Code extension build
openai.chatgpt-26.602.71036-win32-x64.In my case the failing helper is shipped inside the VS Code extension:
SHA256: C1FE23AAAC3439F73CEA122BA703ECE302ACA5BB356CAB8C7FAEB894DF69CC30
HasRequestedExecutionLevel: False
HasAsInvoker: False
HasRequireAdministrator: False
Normal VS Code + [windows] sandbox="elevated"
→ setup refresh fails before command execution with:
setup refresh: failed to spawn ... codex-windows-sandbox-setup.exe:
La operación solicitada requiere elevación. (os error 740)
VS Code launched as Administrator + [windows] sandbox="elevated"
→ setup refresh succeeds
→ sandboxed commands show SUCCESS
UAC:
EnableLUA=1
ConsentPromptBehaviorAdmin=5
ConsentPromptBehaviorUser=3
PromptOnSecureDesktop=1
Sandbox users exist:
CodexSandboxOffline Enabled=True
CodexSandboxOnline Enabled=True
Codex firewall rules exist and are enabled:
codex_sandbox_offline_block_outbound
codex_sandbox_offline_block_loopback_udp
codex_sandbox_offline_block_loopback_tcp
@iceweasel-oai Can you please provide a link to where this was resolved?
I was experiencing same issue with Codex in VS Code on version 26.601.20914-win32-x64. After upgrading to 26.609.30741-win32-x64, the problem is completely gone.
codex-windows-sandbox-setup.exeno longer requires administrator privileges.