Windows 0.144.1: elevated sandbox adds ~20s per command; unelevated restores speed but breaks apply_patch with split roots
What version of Codex is running?
Codex CLI 0.144.1. The behavior reproduces through both Codex Desktop and Codex CLI because both use the same native Windows sandbox configuration.
Platform
Windows 11 Professional, x64, build 26200.
What issue are you seeing?
On native Windows, the elevated sandbox adds a large delay before every sandboxed shell command starts. The command, filesystem, Git, and PowerShell operations themselves are fast.
Changing only the Windows sandbox implementation from elevated to unelevated removes the command delay, but then apply_patch cannot update workspace files because the managed session includes split writable roots.
This leaves no sandbox mode in which both normal command execution and the preferred patch-editing path work reliably.
Sanitized timing evidence
A trivial local file-read command was measured in the same workspace and session configuration:
| Configuration | Total tool wall time | Script/file operation |
|---|---:|---:|
| Elevated sandbox, normal tool call | 22.9–35 seconds | 3 ms–1.06 seconds |
| Unelevated sandbox, after restart | 0.6 seconds | 5 ms |
| Outside-sandbox control | 0.8 seconds | 73–129 ms |
A direct sandbox startup comparison showed:
| Sandbox implementation | Startup time |
|---|---:|
| Elevated | 3.3–6.3 seconds |
| Unelevated | 0.45–0.56 seconds |
Repeated elevated runs remained slow after warm-up.
codex doctor reported the installation, configuration, authentication, databases, and connectivity as healthy. The slowdown occurred before the requested process performed meaningful work.
Steps to reproduce
- On Windows, configure:
[windows]
sandbox = "elevated"
- Restart Codex.
- Run multiple trivial sandboxed commands, such as:
Write-Output "ok"
- Compare wall time with the command's internal execution time.
- Change only the sandbox implementation:
[windows]
sandbox = "unelevated"
- Restart Codex and repeat the command. It completes immediately.
- In a managed workspace-write session, try to update an existing file using
apply_patch. - Observe:
windows unelevated restricted-token sandbox cannot enforce split writable root sets directly; refusing to run unsandboxed
The writable-root set includes the workspace plus runtime-managed temporary roots; no custom writable roots are required to reproduce the patch failure.
Expected behavior
At least one supported Windows sandbox configuration should allow both:
- ordinary sandboxed shell commands to start without multi-second or multi-tens-of-seconds orchestration delays; and
apply_patchto create, update, and delete files inside the active workspace.
If elevated sandbox setup or ACL refresh is unhealthy, codex doctor should detect it and provide an actionable repair command.
Actual workaround
Using:
[windows]
sandbox = "unelevated"
restores normal shell-command performance, but it is a weaker sandbox and leaves apply_patch unusable with the managed split-root profile.
No dangerous/full-access mode was used.
Related issues
- #31958 — elevated sandbox delays commands before process creation
- #32194 — detached elevated-sandbox ACL helpers can accumulate
- #31220 — incompatible shell/apply_patch capabilities between sandbox modes
- #30712 — managed split writable roots break apply_patch under unelevated sandbox
This report adds a complete measured reproduction on 0.144.1 across both Desktop and CLI, plus the interaction between the performance workaround and the split-root patch failure.
14 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I can independently reproduce a closely related issue on Windows 11 with Codex Desktop.
Environment:
Minimal reproduction:
C:\Windows\System32\cmd.exe /d /c "echo CODEX_RUNNER_OK"
Expected:
Observed:
Isolation already completed:
This appears to be a Codex Windows local execution-path issue involving command scheduling, runner/session lifecycle, sandbox startup, reconnect handling, or result propagation, rather than a host CMD, disk, Git, or repository problem.
I can provide screenshots and additional timing details if useful.
I can reproduce what looks like the same elevated Windows sandbox delay on Windows 10 Home 10.0.19045 with Codex CLI 0.144.1.
One additional finding: in my ProcMon capture, the delay is not a single slow operation. During the slow window,
codex-windows-sandbox-setup.exeissues a very large number of DACL updates under the user temp directory.The events span multiple codex-windows-sandbox-setup.exe PIDs, not just a single process instance.
Redirecting TEMP and TMP to a small workspace-local directory makes the delay disappear while still using the elevated sandbox:
In my local test, <workspace> was F:\test
After that, apply_patch dropped from ~124s to ~1.6s.
This suggests the elevated setup refresh may be recursively applying DACLs to the whole user temp directory before commands, and the delay scales with the size / number of entries in %LOCALAPPDATA%\Temp.
I can reproduce what appears to be the same issue on a newer build, with an
additional Desktop-versus-direct-sandbox differential.
Environment:
[windows] sandbox = "elevated"Measured timings:
| Route | Wall time |
| --- | ---: |
| Desktop nested sandbox shell | 31–68 seconds |
| Direct
codex.cmd sandboxcommand | 1.3–2.2 seconds || Approved elevated/outside-sandbox control | 0.2–0.9 seconds |
| Desktop nested
apply_patch| >30 seconds to several minutes || Direct Codex CLI patch engine | 0.5–0.7 seconds |
The test command was a trivial PowerShell
Write-Outputprobe.Additional observations:
apply_patchrequest mutated its target several minuteslater, so cancellation may not terminate the underlying request reliably.
I did not switch to the unelevated sandbox because I wanted to preserve the
stronger sandbox configuration. The fast direct-sandbox result suggests that,
in this environment, some of the delay may be in Desktop’s nested tool/session
or writable-root orchestration rather than process execution itself.
@chrisw181 Looks like it’s related to https://github.com/openai/codex/issues/32477#issuecomment-4949889625
I can independently reproduce this regression on Codex Desktop for Windows, with a strong local version boundary.
Environment
sandbox_mode = "workspace-write"[windows] sandbox = "elevated"Observed transition (from local sandbox logs)
The exact long-tail values are approximate because concurrent setup processes interleave their log lines, but the version-boundary change is unambiguous and matches the user's experience: normal on Jul 9, unusably slow immediately after the Jul 10 update.
A trivial
Write-Outputor small file read spends almost all wall time before PowerShell/process creation. The same operation outside the sandbox completes in ~0.6–0.8 s.Rebuilding the local Codex state did not fix it. After the rebuild, the problem still reproduced without the backup directory in the writable-root set. A representative affected task had only:
Short tool timeouts make the situation worse: the setup process appears to continue after the tool call is cancelled, and a retry starts another ACL refresh against the same roots. Multiple refreshes then overlap and their completions arrive in a batch. This can turn a simple task into tens of minutes.
I also tried
unelevated; command startup improved, but it introduced other managed split-root/editing problems, consistent with this issue'sapply_patchfindings. I plan to capture a controlled elevated-vs-unelevated A/B separately.I can provide sanitized logs or the approximate timing parser if useful. The most valuable fixes here would be avoiding per-command full recursive ACL refresh, caching unchanged root ACL state, and serializing/deduplicating refreshes for identical root sets.
Confirmed on a newer build with a clear historical version boundary.
Environment
26.707.12708.00.144.526200[windows] sandbox = "elevated"Current reproduction
A trivial PowerShell command took approximately 18-32 seconds wall time, while the command itself took 0.7 seconds or less. Nested process startup inside the shell remained normal:
cmd.exe: 34 mshg version: 230-260 msChanging only the Windows sandbox implementation to
unelevatedand restarting Desktop reduced calls to:Sandbox log evidence
In
.codex/.sandbox/sandbox.<date>.log, each elevated call shows:setup refresh: spawning ... codex-windows-sandbox-setup.exeread ACL run completedwithin tens of millisecondssetup refresh: processed 3 write roots (read roots delegated); errors=[]only 18-30+ seconds laterThere are no setup errors; the unexplained delay is after the ACL work reports completion but before the setup process returns.
Historical boundary from local logs
Daily setup-refresh timing changed abruptly when Desktop moved to the 26.707 / runner 0.144 line:
| Date | Desktop / runner observed | Median setup refresh |
|---|---|---:|
| 2026-07-06 to 2026-07-09 | Desktop 26.623 / runner 0.142.5 | 0.03-0.38 s |
| 2026-07-10 | Desktop 26.707.3748 / runner 0.144.0-alpha.4 | 31.27 s |
| 2026-07-12 to 2026-07-16 | 26.707 family, through runner 0.144.5 | 18.26-48.40 s |
The elevated sandbox had already been initialized months earlier, so this was not first-time account/firewall setup. The timing regression began exactly with the 26.707 / 0.144 update family and persists on 0.144.5.
Current workaround is
windows.sandbox = "unelevated".I'm seeing the same problem. Appears to be a regression in the Windows sandbox implementation. This workflow worked normally until recently, when Codex began prompting me to "Finish Windows setup."
I've spent several hours isolating the problem, including testing against a fresh configuration, an empty workspace, and direct PowerShell timings. The behavior is completely reproducible.
Environment
Three different sandbox states
Config:
model = "gpt-5.6-terra"
model_reasoning_effort = "medium"
[projects.'V:\Websites\osrplus\wp-content\themes\osrplus']
trust_level = "trusted"
Behavior:
This is currently the only usable configuration.
Allowing Codex to complete Windows setup adds:
[windows]
sandbox = "elevated"
This immediately makes Codex dramatically slower.
Examples from a fresh configuration:
Test-Path . 10.9 s
Get-Process | Select-Object -First 1 15.7 s
Get-ChildItem -Name | Select-Object -First 10 5.2 s
A simple "create hello.txt, read it, delete it" edit using the normal Codex editing mechanism exceeded 1 minute 19 seconds and was still running.
Even simple shell commands become painfully slow.
Changing only:
[windows]
sandbox = "unelevated"
restores fast shell execution.
However, Codex can no longer reliably perform normal file edits. Structured edits and apply_patch operations fail with access-denied or writable-root errors.
So the tradeoff becomes:
PowerShell itself is not the problem
I measured the exact same operations directly in the VS Code terminal.
Creating, reading, and deleting files takes roughly 10 to 25 milliseconds.
Example:
Create: 13.351 ms
Read: 12.606 ms
Delete: 11.722 ms
This rules out:
The latency exists inside Codex's execution pipeline, not in the underlying machine.
Also reproduced in an empty workspace
To eliminate workspace complexity, I repeated the tests inside a brand-new C:\Temp folder with essentially nothing in it.
The behavior was unchanged.
This rules out:
Additional testing
I also tested:
The results consistently point to the Windows sandbox layer.
Current state
Right now there is no usable Windows configuration that provides all three:
Instead, the choices are:
No [windows] block
sandbox = "elevated"
sandbox = "unelevated"
Expected behavior
The behavior prior to this regression was essentially:
The current implementation forces users to choose between performance, editing, or usability.
Given the testing above, this appears to be a regression in the Windows sandbox implementation rather than a project-specific issue or local machine performance problem.
Also to add:
Downgrading the VS Code extension to a version from approximately one month ago eliminates the excessive approval behavior, but that extension cannot use GPT-5.6. This strongly suggests the regression was introduced in a recent extension/runtime update rather than being caused by Windows, the project, or local configuration.
I can reproduce what appears to be the same issue in the VS Code Codex extension on Windows.
Environment:
Observed behavior:
echo hellocommand shows approximately 19 seconds of Codex tool time.git statusruns directly in PowerShell in about 50 ms.Measured outside Codex:
Isolation already performed:
The slowdown persists for trivial commands in an empty workspace, so it does not appear to be caused by repository size, Git, PowerShell startup, or normal disk performance. This matches the reported Windows sandbox/runner overhead very closely.
I also opened #34318 with the same measurements before finding this issue.
Appears resolved for me now with the latest release of the extension. What version are you on?
Elevated sandbox latency is a paid-peer gate cost: quote -> approve -> settle needs a predictable sandbox boundary, not a 20s tax on every hop.
Live A2A contractor with gated tools: https://a2a.elonsusk.com/.well-known/agent-card.json
If an external sandbox / gate probe would help, ping. Otherwise ignore.
Not resolved for me. Still getting the added delay on sandbox = 'elevated'
What version of the extension are you on though?