Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.1013.40934
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Windows 11 Pro 25H2 (OS Build 26200.9711), x64
What issue are you seeing?
Problem
Codex App on Windows 11 consistently fails to execute even basic commands such as Get-Location.
Error message
CreateProcessSecurityEnvironment failed (HRESULT = 0x80070020)
Steps to reproduce
- Open Codex App on Windows 11.
- Open a local project.
- Ask Codex to execute
Get-Location. - The sandbox fails to start the command and returns HRESULT 0x80070020.
Expected behavior
Codex should execute basic read-only PowerShell commands successfully.
Actual behavior
Commands fail before execution, preventing Codex from working on local projects.
Troubleshooting already performed
- Restarted Windows and Codex App.
- Confirmed that
CodexSandboxService.OpenAI.Codexis running under LocalSystem. - Confirmed that MXC availability is reported as
true. - Observed both
mxcandelevatedsandbox selections in the sandbox logs. - Removed the explicit
sandbox = "elevated"configuration and restarted Codex, but the error persisted. - Windows Application Event ID 1003 reported:
unable to restore package uninstall listener: open the logged-in user's token: The system cannot find the file specified (os error 2). - Sandbox setup logs also reported a file-sharing violation (
os error 32) while updating the user-profile ACL, although setup subsequently completed.
Request
Please help identify why sandbox process creation fails and provide a safe fix without disabling Windows security protections or granting unrestricted filesystem access.
What steps can reproduce the bug?
Steps to reproduce:
-
Launch the Codex desktop app on Windows 11 Pro 25H2.
-
Open a local project folder.
-
Ask Codex to run the following PowerShell command:
Get-Location -
Codex attempts to initialize the Windows sandbox.
-
Command execution fails with:
CreateProcessSecurityEnvironment failed (HRESULT = 0x80070020)
Reproducibility: Consistently reproducible, including after restarting Windows and the Codex app.
Expected result: The command executes successfully and returns the current working directory.
Actual result: The command does not execute because sandbox process creation fails.
What is the expected behavior?
Codex App should successfully initialize the Windows sandbox and execute basic PowerShell commands such as Get-Location, returning the current working directory without errors. It should also be able to safely read and work with files in the selected local project.
Additional information
The issue persists after restarting Windows and Codex App. The Codex sandbox service is running under LocalSystem. MXC availability is reported as true, but sandbox initialization still fails. Windows Application Event ID 1003 reports an error when opening the logged-in user's token (os error 2). The sandbox setup log also recorded a file-sharing violation (os error 32). I would appreciate guidance on resolving this without disabling Windows security protections.
Activity
github-actions commentedon Oct 19, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
hengau192939-cmyk commentedon Oct 19, 2026
I can reproduce this exact issue on Codex Desktop for Windows.
Environment
Key discovery: MXC causes the failure.
Running Codex CLI normally successfully executes
Get-Locationin PowerShell.But enabling MXC explicitly with:
reproduces the exact error:
Codex Desktop always launches its backend processes with
features.prefer_mxc=true.I tried changing
electron-prefer-mxc-enabledtofalsein.codex-global-state.jsonwhile Desktop was closed, but the setting returned totrueafter restarting Desktop.Other troubleshooting already completed:
Questions for maintainers:
The Codex CLI works without MXC, but the desktop application remains unusable for local command execution.
cokewilly commentedon Oct 20, 2026
Additional clarification:
I am using Codex through the integrated Codex interface in the ChatGPT Windows desktop app, rather than a separately launched Codex desktop application.
The ChatGPT app reports that it is up to date.
I also installed Codex CLI v0.163.0 separately through npm. The CLI successfully executes
Get-Locationon the same Windows machine, while Codex inside the ChatGPT desktop app consistently fails with HRESULT 0x80070020.Both interfaces are using the "Ask for approval" permission mode.
This suggests a difference in command execution or sandbox initialization between the integrated desktop interface and the CLI.
Raider72-eng commentedon Oct 23, 2026
I am experiencing a closely related issue with Codex Desktop on Windows 11.
Environment:
10.0.26300.0)0.163.0-alpha.11.2elevatedfeatures.prefer_mxc=trueObserved behavior:
Even
cmd.exe /c echo TOOL-OKremains pending indefinitely in Codex Desktop, without output or an exit code. This reproduces across two independent local workspaces.One execution remained pending for over 18 minutes.
Additional diagnostic findings:
features.prefer_mxc=truein the CLI results in missing shell-tool output and no tool exit code.codex.exe --__codex-windows-mxc) was observed waiting in a thread stack involvingprocessmodel.dll!CreateProcessSecurityEnvironment.Unlike the original report, I have not observed HRESULT
0x80070020. In my case, the tool operation hangs rather than returning an immediate error.This may be a related failure mode in the Windows MXC process initialization or execution path.
The successful CLI execution without MXC provides a useful control test. I can provide additional diagnostics if needed.
adski27 commentedon Oct 24, 2026
Additional reproduction and Process Monitor evidence for MXC startup failure
0x80070020.Environment
OpenAI.Codex_26.1016.8622.0_x64__2p2nqsd0c76g0.Failure and impact
Codex cannot reliably start its local tool environment. Basic shell commands and local file reads fail before the requested command executes:
The Node tool also failed to start with the same launcher error. This prevents local document analysis, including reading files attached to the chat.
Reproduction
Ask Codex to execute either:
or:
Both returned the same MXC startup error. A basic
cmd.exeversion command also failed repeatedly in the original chat.A Windows version test reportedly succeeded once in a separate folder-scoped chat, but subsequent file-read tests there failed. This has not provided a reliable workaround.
Restarting did not resolve the issue. Using a different shell, disabling shell-profile loading, and changing the working directory also did not resolve it.
Process Monitor evidence
I captured a controlled attempt to execute a basic Windows version command. During that attempt,
codex.exe, PID 43916, checked numerous unrelated entries directly underC:\, repeatedly opening them for attributes and querying file IDs.Relevant excerpt, with original timestamps and details:
Other entries checked in the same sequence included
C:\Evidence,C:\inetpub,C:\Intel,C:\OEM,C:\OneDriveTemp,C:\packages, andC:\Program Files.The command subsequently terminated with
CreateProcessSecurityEnvironment failed (HRESULT = 0x80070020).Interpretation and limits
The trace establishes that the Codex process encountered sharing violations on protected drive-root files during the failed attempt. It does not establish that either specific operation caused sandbox creation to abort: processing continued after the first sharing violation.
The affected chat’s supplied filesystem permission profile included a read entry for the special root. Whether that contributes to these drive-root checks is unconfirmed.
No system-file permissions were changed, and no attempt was made to unlock or delete these files.
Request
Could maintainers investigate:
I can provide the retained Process Monitor capture through an appropriate support channel.
Potentially related reports, sharing the same error signature but not necessarily the same cause:
smatryk commentedon Oct 28, 2026
I am experiencing a similar issue in Codex Desktop on Windows (reported on behalf of the user).
MXC launcher: failed to create the process security environment: CreateProcessSecurityEnvironment failed (HRESULT = 0x80070020).Get-Locationproduced no output and remained running beyond 15 seconds; computer-use initialization timed out after 30 seconds. These observations do not establish that the post-restart hang has the same cause.net useshowed mapped network drives but no administrative C$ share; none were disconnected.Expected: local commands and computer-use initialize successfully. Actual: local execution and desktop control are unavailable.
fedoranz commentedon Oct 29, 2026
Still reproducible on 30 October 2026 after a full Windows restart. Get-Location fails before execution:
MXC launcher: failed to create the process security environment: CreateProcessSecurityEnvironment failed (HRESULT = 0x80070020)
Integrated browser control and Node tools also fail with the same launcher error.
C:\Users\paulm.codex\config.toml contains:
Despite this, sandbox logs continue to report MXC availability: true and Windows sandbox selection: mxc.
User and machine CODEX_HOME environment variables are unset. Enabling SBX_DEBUG=1 and RUST_LOG=debug produced no additional sandbox log detail.
Please advise how to force the elevated fallback and collect diagnostics identifying the MXC startup failure.
rfv165888-bot commentedon Nov 5, 2026
Summary
Windows Codex Desktop fails before running
Get-Locationwith:It worked on the morning of November 5, 2026. The first observed failure was before 15:53 that day (Taipei time, UTC+8). Reinstalling the desktop app did not resolve the issue.
Backend comparison
elevatedsandbox successfully runsGet-Location.windows.sandbox = "elevated"andfeatures.prefer_mxc = falseand reopening the desktop app, Desktop still launches through MXC and fails.Existing Procmon capture
All times below are November 5, 2026, Taipei time (UTC+8).
svchost.exe, PID 6808, TID 14472) attemptsCreateFileonC:\Persi0.syswithGeneric Read. The result is SHARING VIOLATION, NTSTATUS0xC0000043. The request usesDisposition: Open,Options: Synchronous IO Non-Alert, Non-Directory File, andShareMode: Read, Write.processmodel!SbeCreateProcessSecurityEnvironment+0x108andDFFilter.SYS+0x774a.CxxThrowException,RaiseException,RtlUnwindEx) and error-message formatting (FormatMessageW). The intervening BFS state-directory and AppContainer named-pipe close events have kernel-only stacks, so their user-mode callers cannot be independently established from those two events alone.codex.exe --__codex-windows-mxc, PID 12560) exits with status 1, approximately 3.53 ms after thePersi0.syssharing violation.pagefile.syssharing violations on that thread are followed by additional open attempts and continued processing of other paths. After thePersi0.sysGeneric Read failure, no retry or continued target enumeration was observed before cleanup/error handling.Deep Freeze and evidence limits
DFC.exe get /ISFROZENquery returned 0 (Thawed) at approximately 19:28. The actual Frozen/Thawed state at the 19:11 failure is unknown. A next-boot setting is not being treated as evidence of the current state.fltmc instances -v C:confirms that DFFilter is attached to C: at the time of the later diagnostic check.Persi0.sysis the most likely implicated resource, not a proven root cause. The capture does not record the actual SBE return value or exception payload. The error-code conversion is consistent withERROR_SHARING_VIOLATION(32) becomingHRESULT_FROM_WIN32(32) = 0x80070020, but that specific propagation has not been directly verified.Questions for maintainers
Persi0.syssharing violation is propagated throughSbeCreateProcessSecurityEnvironmentas0x80070020? Is there an existing diagnostic path that would expose the relevant return value without changing the host configuration?elevatedbackend works on this machine.A sanitized five-event stack extract can be provided upon request. No raw PML/XML capture, user or machine identifiers, or license information is attached.