Windows elevated sandbox delays every shell_command by ~88 seconds before process creation; unelevated is immediate
What version of Codex CLI is running?
0.144.0
What subscription do you have?
ChatGPT Pro
Which model were you using?
gpt-5.6-sol
What platform is your computer?
_No response_
What terminal emulator and version are you using (if applicable)?
_No response_
Codex doctor report
What issue are you seeing?
Summary
On native Windows, every shell_command invocation is delayed for approximately 88 seconds when the Windows sandbox is configured as elevated.
The delay occurs before powershell.exe is created. PowerShell startup and the requested script itself are fast once the process is finally launched.
Changing only the Windows sandbox mode from elevated to unelevated resolves the problem immediately.
Timing breakdown
For one representative invocation, the total duration was 88.85 seconds:
- Tool request to
powershell.exeprocess creation: 88.03 seconds - PowerShell process creation to script entry: 0.61 seconds
- Actual script execution: 0.077 seconds
- Result return: approximately 0.13 seconds
A non-shell tool invocation completed in approximately 22 ms, so the general tool system was responsive.
The abnormal delay is isolated to the shell_command execution path after the request is submitted but before the PowerShell process is created.
Observed behavior
With:
[windows]
sandbox = "elevated"
even trivial commands such as:
Write-Output "OK"
or reading a small local file take approximately 88–90 seconds.
The file read or PowerShell command itself is not slow. Almost the entire delay occurs before process creation.
With:
[windows]
sandbox = "unelevated"
### What steps can reproduce the bug?
[windows]
sandbox = "unelevated"
### What is the expected behavior?
_No response_
### Additional information
_No response_
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I can confirm this issue on my machine and wanted to share some additional investigation results that may help identify the root cause.
Environment
sandbox = "elevated"sandbox = "unelevated"Symptoms
Every shell command incurs an additional 40–70 second delay before execution.
Initially I suspected this was related to PowerShell commands such as:
However, after further investigation, I found that the command itself is not the problem.
The same delay occurs for trivial commands such as:
Investigation
I measured the execution time of the commands using
Measure-Command.The actual PowerShell commands consistently complete in approximately 8–70 ms.
The delay occurs entirely before PowerShell starts executing.
The Codex logs consistently show the following sequence:
For every shell invocation,
codex-windows-sandbox-setup.exetakes approximately 40–70 seconds before the command runner is launched.After the setup process finishes, PowerShell executes almost immediately (roughly 200 ms).
Additional observations
I monitored the setup process while it was running:
The CPU time continuously increased while the process was running, so it does not appear to be blocked waiting on a timeout. It is actively performing work during those 40–70 seconds.
Workaround
I found a workaround that completely eliminates the problem.
Adding the Codex installation directory to Microsoft Defender exclusions causes the delay to disappear immediately.
Excluded path:
After adding this exclusion:
codex-windows-sandbox-setup.execompletes almost instantly.Conclusion
Based on these findings, the delay does not appear to be related to:
Get-ContentrgInstead, it appears to occur entirely inside
codex-windows-sandbox-setup.exe, and there seems to be a significant interaction with Microsoft Defender's real-time protection.Hopefully these findings help narrow down the root cause.