Skip to content

Codex Windows sandbox regression — error 32 / CreateProcessAsUserW error 5 #52244

Open

Description

@natx808

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

Codex CLI 0.161.0

What subscription do you have?

Pro 5X

What platform is your computer?

Win 11

What issue are you seeing?

Hello OpenAI Support,

I'm reporting a reproducible Windows Codex execution failure that prevents me from using Codex in VS Code or the standalone CLI.

Environment

  • Windows 11 Pro, build 26300, x64
  • Codex CLI 0.161.0
  • VS Code Codex extension openai.chatgpt-26.51002.51308-win32-x64
  • Native Windows repository at C:\dev\reclamation
  • Codex installed through npm; authenticated with ChatGPT
  • Default Windows sandbox mode: elevated

Primary failure — Elevated Windows sandbox

Every attempt to execute even a read-only command such as git status --short fails with:

helper_unknown_error: setup refresh had errors

The sandbox log provides the underlying error:

runtime read/execute validation failed:
validate runtime read/execute access on
C:\Users\root\AppData\Local\OpenAI\Codex\runtimes\cua_node\3dd31cfff853001c\bin\node_repl.exe:
open ACL target for root-only update:
The process cannot access the file because it is being used by another process. (os error 32)

Process Explorer shows node_repl.exe processes running from that same runtime location, including processes that appear and disappear automatically while Codex is idle or while typing a prompt, before submission.

Closing VS Code terminates these processes. The failure is consistent with a possible runtime initialization or executable-sharing conflict, although the underlying cause remains unconfirmed.

Secondary failure — Unelevated Windows sandbox

Changing [windows] sandbox to unelevated avoids the initial setup error but command execution fails with:

Failed to create unified exec process:
CreateProcessAsUserW failed: 5 (Access is denied.)

This was reproduced in standalone Codex CLI with --no-daemon, as well as through the VS Code workflow.

Troubleshooting already performed

  • Updated Codex CLI to 0.161.0.
  • Reinstalled the VS Code extension.
  • Restarted Windows and performed a complete shutdown/cold startup.
  • Regenerated Codex Node runtime files.
  • Tested one VS Code window, including launching as Administrator.
  • Verified both Codex sandbox accounts are enabled and members of CodexSandboxUsers.
  • Checked local security-policy assignments and Defender event logs; no specific Defender block was identified.
  • Confirmed Git and PowerShell execute normally outside Codex.
  • Ran codex doctor --json: installation, authentication, configuration, network, and databases pass. It reports a stale/unreachable app-server daemon and an MCP environment-variable warning.

Impact

Codex can authenticate and respond, but it cannot execute local commands. This completely blocks my established native Windows C++ development workflow.

A separate coding extension can execute commands successfully in the same repository and Windows environment.

Request

Please investigate the Windows sandbox runtime ACL refresh and process creation failures, especially the interaction between node_repl.exe and codex-windows-sandbox-setup.exe.

I would appreciate a supported workaround or confirmation of an upstream fix. I can provide redacted diagnostic reports, sandbox logs, and Process Explorer evidence.

Thank you.

sandbox.2026-10-08.log

Image Image Image

What steps can reproduce the bug?

Steps to Reproduce

Environment

  • Windows 11 Pro, build 26300, x64
  • Codex CLI 0.161.0
  • VS Code extension openai.chatgpt-26.51002.51308-win32-x64
  • Native Windows Git repository: C:\dev\test-repository
  • ChatGPT authentication
  • Windows sandbox modes tested: elevated and unelevated

Bug 1 — Elevated sandbox fails during initialization (Windows error 32)

  1. Close all VS Code windows and Codex sessions.
  2. Open %USERPROFILE%\.codex\config.toml.
  3. Configure:
    [windows]
    sandbox = "elevated"
  4. Launch VS Code and open an existing local Git repository.
  5. Open the Codex chat extension.
  6. Submit: Execute git status --short. Do not modify files.
  7. Observe that command execution fails before Git starts.

Actual result:

helper_unknown_error: setup refresh had errors

The sandbox log shows:

runtime read/execute validation failed:
validate runtime read/execute access on
%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<runtime-id>\bin\node_repl.exe:
open ACL target for root-only update:
The process cannot access the file because it is being used by another process.
(os error 32)

Process Explorer shows node_repl.exe instances launched from the same runtime directory. These processes can appear before a chat request is submitted and disappear shortly afterward.

The failure persists after restarting Windows, a complete shutdown, extension reinstallation, and launching VS Code as Administrator.

Bug 2 — Unelevated sandbox cannot create processes (Windows error 5)

  1. Close VS Code and Codex sessions.
  2. Change the configuration to:
    [windows]
    sandbox = "unelevated"
  3. Open PowerShell and navigate to an existing local Git repository.
  4. Launch Codex without its shared daemon:
    codex --no-daemon -c windows.sandbox="unelevated" --sandbox workspace-write --ask-for-approval on-request
    
  5. Ask Codex to execute git status --short or git log -1 --oneline.

Actual result:

Failed to create unified exec process:
CreateProcessAsUserW failed: 5 (Access is denied.)

The same Git commands execute successfully outside Codex.

Expected result

Codex should initialize the Windows sandbox and execute read-only Git commands without modifying repository files.

Additional findings

  • Both Codex sandbox accounts exist, are enabled, and belong to CodexSandboxUsers.
  • codex doctor --json reports healthy installation, authentication, configuration, network connectivity, and state databases.
  • Doctor reports a stale/unreachable app-server daemon and an optional Node REPL MCP configuration warning.
  • No corresponding Microsoft Defender block was identified.
  • Another VS Code coding-agent extension successfully executes Git and PowerShell commands in the same environment.
  • No successful workaround has been identified.

Available diagnostic evidence

  • Windows sandbox setup log
  • Redacted codex doctor --json report
  • Process Explorer screenshots showing Node REPL processes and executable paths

Request: Please investigate the runtime executable ACL/file-sharing conflict and the unelevated sandbox's CreateProcessAsUserW failure. A supported workaround or fix would be appreciated.

What is the expected behavior?

Codex should be able to interact with the repo at the CLI level. It cannot with this bug.

Additional information

No response

Activity

  1. added
    app
    on Oct 8, 2026
  2. added
    bug
    CLI
    windows-os
    sandbox
    on Oct 8, 2026
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

    CLIappbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions