Skip to content

Codex Desktop on Windows selects MXC and fails before shell start when filesystem grants are present (0x80070002) #50981

Open

Description

@leechanju09050320-ui

What version of the Codex App are you using (From “About Codex” dialog)?

26.930.3930.0 (bundled CLI 0.160.0)

What subscription do you have?

Unknown; signed-in desktop account

What platform is your computer?

Windows 11 Home 25H2, build 26200.9457, x64

What issue are you seeing?

Codex Desktop fails before starting PowerShell when a sandboxed command needs existing filesystem grants. The command never runs. The app reports:

MXC launcher: failed to create the process security environment: CreateProcessSecurityEnvironment failed (HRESULT = 0x80070002)

This blocks ordinary project file reads and shell work. The failure persists after an app restart and Windows component repair. No credentials, personal paths, or raw logs are included in this report.

What steps can reproduce the bug?

  1. On Windows 11 Home 25H2 (build 26200.9457), use Codex Desktop 26.930.3930.0 with a local workspace and normal restricted filesystem grants.
  2. The user config specifies [windows] sandbox = "elevated" and [features] prefer_mxc = false; restart Desktop. In the observed Desktop session, MXC is still selected.
  3. Invoke exec_command with a harmless PowerShell read of an existing local text file.
  4. Observe the error above before PowerShell starts. A minimal MXC test with two existing read-only filesystem grants reproduces it; an empty PSEC policy succeeds.
  5. DISM RestoreHealth completed and CheckHealth is clean, but the same grant-bearing test still fails.

What is the expected behavior?

A sandboxed command should start and honor the requested filesystem permissions, or Desktop should select a supported backend / return an actionable configuration error. The user-configured backend should not silently be overridden without a supported way to recover.

Additional information

Read-only ProcessModel tracing associated the failure with sandboxfilesystem.cpp:680 during AppInfo setup; this is an observation, not a proven root cause. Full-access shell execution works, but is not an acceptable fix for restricted sandbox operation. BFS service state was Auto/Stopped and one elevated start returned Error 5; its causal role is unproven. No app patch, ACL change, or security bypass was made. Please advise a supported Desktop backend selection or specific additional diagnostics needed.

Activity

  1. added
    app
    on Oct 5, 2026
  2. added
    bug
    windows-os
    sandbox
    config
    on Oct 5, 2026
  3. leechanju09050320-ui commented on Oct 5, 2026

    @leechanju09050320-ui
    Author

    Update after further troubleshooting (2026-10-05): Windows app Repair, app Reset, uninstall/reinstall from the official Microsoft Store listing, and a full Windows restart have all been completed. The same error still occurs before PowerShell starts when running a harmless read-only Get-Location command from Codex Desktop: CreateProcessSecurityEnvironment failed (HRESULT = 0x80070002). We did not change ACLs or disable sandbox protection. The available sandbox log did not provide a new causal diagnostic for these retests. Please advise a supported next diagnostic or fix; we will avoid repeating resets/reinstalls without new evidence.

  4. Danieljedi11 commented on Oct 5, 2026

    @Danieljedi11

    I can reproduce what appears to be the same MXC failure on another Windows system.

    Codex Desktop: 26.930.4958.0
    Bundled CLI: 0.160.0
    Windows: Microsoft Windows NT 10.0.26300.0 x64

    A simple Get-Location fails before PowerShell starts.

    One additional diagnostic may be useful:

    • With Google Drive virtual drives G: and H: mounted, CreateProcessSecurityEnvironment fails with HRESULT 0x8007000F.
    • After completely closing Google Drive so G: and H: disappear, the same MXC failure still occurs, but the HRESULT changes to 0x80070002.
    • After rebooting with Google Drive active again, the error returns to 0x8007000F.

    I also confirmed that Codex Desktop launches codex.exe app-server with -c features.prefer_mxc=true. Setting [windows] sandbox = "unelevated" did not prevent MXC from being selected.

    Inspection of the installed Desktop JavaScript traced the preferMxc preference to Statsig gate ID 93596649, although I could not determine which remote evaluation rule or rollout is enabling it.

    Windows is fully updated, the PC has been rebooted, and Microsoft Store reports no Codex update available.

  5. Danieljedi11 commented on Oct 5, 2026

    @Danieljedi11

    One additional observation: the terminal opened manually from Codex Desktop works normally. PowerShell starts successfully and reaches the prompt. The failure only occurs when the Codex agent attempts to execute a terminal command through the sandbox. This further suggests that the problem is specifically in the MXC sandbox/process security environment initialization rather than PowerShell or terminal execution itself.

  6. ShivaPriyanShanmuga commented on Oct 10, 2026

    @ShivaPriyanShanmuga

    I can reproduce this issue on Windows 11 Home Single Language 25H2 (OS build 26200.9457), Codex 26.1007.21434 (build 13901, production channel).

    Both browser control and basic sandboxed shell commands such as Get-Location fail with CreateProcessSecurityEnvironment failed (HRESULT = 0x80070002).

    Restarting Windows and Codex did not resolve the issue. The app reports that it is up to date.

    Is there a supported fix or workaround for this version?

  7. Danieljedi11 commented on Oct 10, 2026

    @Danieljedi11

    Update: My issue is now resolved.

    I uninstalled the McAfee applications from my Windows computer and restarted the system. After the restart, Codex Desktop started working normally again, including sandboxed terminal commands that had previously failed with "CreateProcessSecurityEnvironment failed".

    I cannot confirm whether removing McAfee directly resolved the issue or whether the timing coincided with an update or another change.

    However, this was the action immediately preceding the successful test, so I'm sharing it in case it helps others investigate a possible conflict between McAfee and the MXC sandbox.

    I've also reported this finding directly to OpenAI Support.

  8. ShivaPriyanShanmuga commented on Oct 10, 2026

    @ShivaPriyanShanmuga

    Update: The fix worked @Danieljedi11
    Thanks

  9. cghchong commented on Oct 12, 2026

    @cghchong

    Additional reproduction with the current Windows desktop browser-control path (2026-10-12):

    • Windows 11 Pro 25H2, build 26200.9457; Codex Desktop 26.1007.2314.0 (browser/computer-use plugin 26.1007.21434, bundled CLI 0.162.0-alpha.17.2); standalone CLI 0.162.1.
    • Browser control cua.getState() fails before the Node kernel starts: CreateProcessSecurityEnvironment failed (HRESULT = 0x80070002). This is not limited to shell commands.
    • With standalone CLI 0.162.1, an MXC/PSEC profile with an empty filesystem policy starts successfully. Adding only :minimal read access, or only one existing local directory with read access, reproduces 0x80070002. That narrows the trigger to filesystem grants.
    • A legacy elevated CLI probe succeeds. The saved configuration is [windows] sandbox = "elevated" and [features] prefer_mxc = false, but Desktop launches the browser tool through MXC. In a temporary managed-policy test, windows.allow_mxc = false made browser control reject explicit Some(Mxc) rather than fall back; the temporary policy was removed immediately.
    • Historical session logs show the browser component on this same PC successfully opened and read an authenticated page on 2026-08-18. A BFS minifilter altitude collision was already logged on 2026-08-15, so that collision alone cannot explain the later browser regression. Its relationship to the PSEC failure remains unproven.
    • No McAfee products are installed here. We have not disabled Defender, changed enterprise encryption/minifilter settings, or attached logs/business URLs/credentials.

    Could maintainers advise a supported fallback for Browser/Computer Use to the configured elevated backend, or a fix/diagnostic for PSEC filesystem grants? A desktop app restart, browser-kernel reset, and sandbox-service restart did not help.

  10. denelon commented on Nov 5, 2026

    @denelon

    A Microsoft MXC issue explicitly cites this report as another occurrence of the same HRESULT under different conditions:

    Both reports observe CreateProcessSecurityEnvironment failing with 0x80070002 before the child process starts. This Codex report narrows its reproduction to policies containing filesystem grants, while the MXC issue describes a session-0 batch-logon caller using a policy with no explicit filesystem grants. The matching HRESULT therefore establishes a useful diagnostic correlation, but the different caller contexts and policy contents do not establish a common root cause.

    Drafted with GitHub Copilot assistance.
  11. cghchong commented on Nov 5, 2026

    @cghchong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugconfigsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions