Windows Desktop 26.715.31925: elevated sandbox cannot start shell; unelevated starts but has write/arg0 failures
What version of the Codex App are you using?
26.715.31925
What subscription do you have?
ChatGPT subscription (exact tier omitted)
What platform is your computer?
Windows, Microsoft Windows NT 10.0.26200.0
Summary
On Codex Desktop 26.715.31925, the elevated Windows sandbox was unable to start shell commands at all. Switching only the Windows sandbox implementation to unelevated restored basic PowerShell execution.
However, the unelevated path is still only partially functional:
- basic PowerShell commands, pipelines, subprocess launch, workspace reads, and DNS work;
- filesystem writes to the advertised writable workspace root fail with
Access is denied; - outbound HTTPS from the sandbox fails through Schannel;
- nonzero child exit codes are not preserved exactly by the shell helper;
- both the PATH CLI and Desktop-configured CLI warn that stale
arg0directories cannot be cleaned and PATH aliases cannot be created due to access denial.
This appears related to the recurring elevated Windows sandbox/helper regression reported in #24098, #24259, #24490, #24963, and #25280.
Runtime versions
Two different Codex binaries are present:
PATH CLI:
codex-cli 0.144.6
Desktop-configured internal CLI:
codex-cli 0.145.0-alpha.18
The internal Desktop CLI is configured under %LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exe.
Both binaries currently print warnings similar to:
WARNING: failed to clean up stale arg0 temp dirs: Access is denied. (os error 5)
WARNING: proceeding, even though we could not create PATH aliases: Access is denied.
path: "%USERPROFILE%\.codex\tmp\arg0\codex-arg0..."
Configuration
The configuration that currently allows basic shell startup is:
sandbox_mode = "workspace-write"
[windows]
sandbox = "unelevated"
[sandbox_workspace_write]
network_access = true
The workspace is trusted.
Before switching to unelevated, the configuration used:
[windows]
sandbox = "elevated"
In that mode, the shell helper did not reach PowerShell at all. The exact raw error from the earlier elevated session is no longer available, and no %CODEX_HOME%\.sandbox\sandbox.log file currently exists.
Steps to reproduce
- Install or update Codex Desktop to
26.715.31925on Windows. - Configure:
```toml
sandbox_mode = "workspace-write"
[windows]
sandbox = "elevated"
[sandbox_workspace_write]
network_access = true
```
- Fully restart Codex Desktop.
- Start a task in a trusted local workspace.
- Ask Codex to run a minimal shell command:
``powershell``
Write-Output "sandbox-ok"
- Observe that the elevated sandbox/helper does not start the shell.
- Change only:
``toml``
[windows]
sandbox = "unelevated"
- Fully restart Codex Desktop and repeat the command.
- Observe that basic shell execution now succeeds.
- Run a workspace write probe and observe
Access is denied, despiteworkspace-writeand the workspace root being advertised as writable.
Additional environment detail
TEMP and TMP point to a RAM-disk directory. Its ACL was inspected and grants Modify to Authenticated Users and FullControl to application-package groups. The same write failure also occurs on the normal local workspace drive, and the persistent arg0 warning targets %USERPROFILE%\.codex\tmp\arg0, not the RAM disk. Therefore the RAM disk may amplify temp/cache symptoms but does not explain the elevated helper being unable to start the shell.
Expected behavior
- The preferred elevated Windows sandbox should start the requested shell command.
workspace-writeshould allow writes inside the declared workspace root.network_access = trueshould permit outbound HTTPS.- The helper should create/clean its
arg0aliases or emit an actionable diagnostic identifying the ACL or sandbox identity that blocks them. - If elevated setup is unavailable, Codex should detect and report the exact failed setup stage instead of leaving the shell unusable.
Actual behavior
- Elevated sandbox: shell does not start.
- Unelevated sandbox: basic shell execution works, but workspace writes and several helper capabilities remain broken.
- Desktop uses
codex-cli 0.145.0-alpha.18internally while the separately installed PATH CLI is0.144.6. codex doctor-style configuration checks are insufficient if they do not perform a real sandboxed spawn/write probe.
Related issues
- #24098
- #24259
- #24490
- #24963
- #25280
- #31776
- #34039 (same Desktop build/internal CLI family, different runtime regression)
No project files, usernames, credentials, or private logs are included in this report.
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Confirming the same elevated/unelevated failure trap on a newer Codex Desktop build.
Environment
26.715.4045.010.0.26200, x64sandbox_mode = "workspace-write"Elevated sandbox
With:
a minimal shell command failed before PowerShell started:
Results:
C:\tmpas the working directoryhelper_unknown_error: setup refresh had errorssetup_error.jsonreported the same code/messageSetNamedSecurityInfoW failed: 87Unelevated sandbox
I changed only the Windows sandbox implementation:
and fully restarted Codex Desktop.
Results:
C:\tmpapply_patchcould create a new probe fileapply_patchupdate of that existing file failed with:This matches the trap described here: elevated cannot start the shell, while unelevated restores basic shell execution but breaks normal patch/update workflows. It is also related to #34088, except the suggested workaround there (switching back to elevated) is not usable in this environment because elevated sandbox setup itself fails.
I restored
sandbox = "elevated"after the test. No project data, sensitive local paths, or raw logs are included.Corroborating evidence from a current Windows 11 x64 installation:
WARNING: failed to clean up stale arg0 temp dirs: Access is denied. (os error 5)
WARNING: proceeding, even though we could not create PATH aliases: Access is denied. (os error 5)
Please treat this as a lifecycle/diagnostic issue rather than a generic user-permission problem: cleanup and alias creation should either complete atomically or report the exact operation, path, process/handle, and effective authority that blocked them. No account, project, credential, or private-path data is included.
Corroborating this on a newer CLI with an isolated development-worker reproduction.
Environment
0.147.010.0.26200.0, x64[windows] sandbox = "elevated"--sandbox workspace-write--ask-for-approval never --ephemeral --ignore-user-config --ignore-rulesMinimal direct reproduction
From a fresh standalone PowerShell process, with parent-task Codex permission variables removed:
The prompt asks Codex to create one tiny text file inside the worktree.
Observed result:
A separate run with normal user config loaded reached the shell path and logged:
That run subsequently used a configured MCP filesystem tool to create the file outside the failed shell sandbox. I removed the file and do not count that as acceptance; it also demonstrates why the worker reproduction disables user config and MCP tools.
Controls and isolation
This appears to be the same elevated Windows sandbox/helper failure rather than a Git, project-trust, ACL, OneDrive, or application-adapter problem. A portable PowerShell reproducer and JSONL evidence are retained locally.
Adding a consolidated related-issue map after a broader follow-up search. The categories below are intentional: they distinguish direct/near-duplicate behavior from adjacent symptom branches, and do not assert that every report has one proven root cause.
1. Direct / near-duplicate elevated↔unelevated Windows sandbox failures
0.145.0-alpha.18).spawn setup refresh; unelevated works.codex doctor; host/escalated commands still work.ShellExecuteExW ... 1223/ “parameter is incorrect”); unelevated works.node_repl/ browser path fails at Windows sandbox setup refresh.CreateProcessAsUserW 1312), unelevatedapply_patchupdate/delete fails on split writable roots.apply_patchwith split roots.apply_patchfailure:cannot enforce split writable root sets directly; refusing to run unsandboxed.CreateProcessAsUserW 1312) and enters repeated retries.2. Split writable-root /
apply_patchbranchapply_patchto fail before reading the workspace file and pushing agents toward shell rewrites.view_imagefails on an authorized workspace image because the same split-root sandbox construction fails before the file is read.apply_patch.:workspaceprofile creates the same unsupported split-root shape; not Desktop-only.helper_unknown_error: setup refresh had errors.3. ACL / setup-helper / lifecycle branch
apply_patchfail after initially succeeding.SetNamedSecurityInfoW failed: 5).codex-windows-sandbox-setup.exelaunch fails from WindowsApps context.codex doctorcan remain green.helper_unknown_error: setup refresh had errorson file reads /git logwhile host PowerShell works.CodexSandboxOnline/Offline, after which setup refresh fails until ownership is repaired.SetNamedSecurityInfoW failed: 5; changing ownership restores operation.helper_unknown_error, while unelevated works.<special>:slash_tmp→C:\tmp; inability to stamp its ACL aborts setup for an otherwise writable workspace.SetNamedSecurityInfoW failed: 5.26.715.4045.0): create works, modifying an existing file fails through the sandbox helper.SetNamedSecurityInfoW failed: 87; useful comparison for the error-87 path, though the underlying filesystem differs from the local NTFS reproduction here.4. Schannel / network branch
The original report also notes outbound HTTPS failure under the sandbox. Closely related reports include:
SEC_E_NO_CREDENTIALS.network_access = truebut sandbox networking fails after ACL/setup errors.curl/Schannel fails withSEC_E_NO_CREDENTIALSwhile the host works.5. Usage / retry consequences
setup refresh had errorsretries and substantial token consumption.6. Same build/runtime family, but different primary regression
apply_patchwrapper/argument path failure, adjacent but not identical to setup-refresh/split-root failure.This issue family now spans multiple Codex/Desktop versions and several independent reporters. The strongest recurring pattern is not merely “Windows permissions”: it is a mismatch between the advertised/effective permission profile and what the selected Windows sandbox backend can actually initialize and enforce, followed by incomplete diagnostics, fallback pressure, or repeated retries.
For clarity, current backend usage/reset-credit reports such as #37934 are not included above as the same root cause. There is not yet evidence connecting that server-side 429/reset-credit behavior to this Windows sandbox family. #34575 and #37613 are the evidence-backed bridge from sandbox failure to quota/usage impact.
Temporary Aug 11 current-incident watchlist
Adding a short current-day corroboration set while reports are still arriving. This is intentionally provisional and does not assert one common root cause. I am separating the strongest Windows sandbox/execution overlaps from adjacent transport, usage, and persisted-state failures.
A. Strongest current Windows sandbox / execution overlap
26.803.10989.0: Windows setup loops; elevated setup does not complete; runner logsSetFileAttributesW ... Access is denied; switching tounelevatedstill leaves evenwhoamifailing withAccess is denied. This is a very close continuation of the “no healthy Windows sandbox mode” family documented here.CreateProcessWithLogonW failed: 267, sandbox traversal denied, andapply_patchfilesystem-helper failures while the same path works outside the sandbox. This extends the same command-start / filesystem-helper boundary to another Windows filesystem shape..gitowned byCodexSandboxOffline, after which normal Git clients and Codex project detection reject the repository until ownership is repaired. This is important because it shows sandbox identity/ACL behavior can persist into user-visible repository state rather than remaining a transient command failure.EPERMwhile touching the local OpenAI/Codex runtime path and can then enumerate zero apps/windows. Different tool surface, but another current Windows runtime/permission failure in the same desktop family.B. Current transport / retry / incomplete-turn symptoms
26.803.10989.0: frequentReconnecting 5/5, long stalls, and incomplete work; reporter explicitly notes usage being consumed during the failed/reconnecting runs.stream disconnected before completionon ordinary Codex use.0.147.0: WebSocket reset triggers an advertised HTTPS fallback, but the active turn still terminates instead of recovering. This is cross-platform and therefore not evidence for the Windows sandbox root cause, but it is relevant to the current failure/retry surface and incomplete-turn handling.C. Current usage/reset visibility failures
/backend-api/wham/rate-limit-reset-creditsreturns429and the client repeatedly retries; reproduced in both desktop and web.Usage limit resets — Couldn't load usage limit resets.D. Adjacent persisted-state integrity report
local-projectsregistry from 12 entries to 0 and mirrors the same empty state into.bak, while the project roots and thread data still exist. This is not a sandbox duplicate, but it is relevant to current Windows Desktop state-integrity behavior because a derived/managed state surface becomes authoritative enough to hide valid underlying state.For this issue, the highest-confidence new links are #37940, #37919, #37965, and #37932. The reconnect/usage/state reports above are included as contemporaneous context only. I would not merge their root causes into #34179 without stronger evidence.