Windows ARM64 elevated sandbox: CreateProcessAsUserW failed: 5 launching Store PowerShell after successful setup

Resolved 💬 2 comments Opened Aug 1, 2026 by metam1nd Closed Aug 1, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.146.0

Platform

  • Windows 11 Home
  • Version/build: 10.0.26200 / 26200
  • Architecture: ARM64
  • PowerShell: Store-packaged PowerShell 7.6.4 ARM64
  • PowerShell path: C:\Program Files\WindowsApps\Microsoft.PowerShell_7.6.4.0_arm64__8wekyb3d8bbwe\pwsh.exe

Configuration

approvals_reviewer = "auto_review"

[windows]
sandbox = "elevated"

[projects.'c:\users\<USER>']
trust_level = "trusted"

Issue

Every ordinary sandboxed shell command fails before PowerShell starts, including a harmless identity check:

Write-Output "sandbox-launch-ok"
whoami

The tool reports:

windows sandbox: runner failed during SpawnChild:
CreateProcessAsUserW failed: 5 (Access denied)

Running the same command through approved external execution succeeds. The external process runs under the normal user at medium integrity (S-1-16-8192).

Relevant sanitized sandbox log

Sandbox setup itself reports success and the copied command runner is resolved:

setup refresh: processed 31 write roots (read roots delegated); errors=[]
codex-windows-sandbox-setup.exe] setup binary completed
helper copy: reused command-runner source=C:\Users\<USER>\AppData\Local\Programs\OpenAI\Codex\bin\codex-command-runner.exe destination=C:\Users\<USER>\.codex\.sandbox-bin\codex-command-runner-0.146.0.exe
helper launch resolution: using copied command-runner path C:\Users\<USER>\.codex\.sandbox-bin\codex-command-runner-0.146.0.exe
codex-command-runner-0.146.0.exe] hide users: failed to hide current user profile dir (C:\Users\Default): SetFileAttributesW failed for C:\Users\Default: 5 (Access denied)

Immediately after that, the client reports CreateProcessAsUserW failed: 5. The sandbox log itself ends at the SetFileAttributesW line and does not record the subsequent process-creation error.

Reproduction

  1. Configure [windows] sandbox = "elevated".
  2. Fully restart Codex.
  3. Run any trivial shell command in the sandbox, such as whoami or Write-Output "test".
  4. Observe CreateProcessAsUserW failed: 5 before PowerShell executes.
  5. Approve external execution of the same command; it succeeds.

Additional context

  • The Microsoft optional Windows Sandbox feature should not be relevant; this is Codex's native local-user/ACL/firewall sandbox.
  • The setup helper exists and completes.
  • The copied codex-command-runner-0.146.0.exe exists and is selected.
  • This may be ARM64-specific, related to launching Store-packaged ARM64 PowerShell under the sandbox user/token, or related to the preceding failure to hide C:\Users\Default.
  • Similar generic reports include #25436 and #27987, but this reproduction adds ARM64, Codex 0.146.0, PowerShell 7.6.4 ARM64, and a successful setup/runner-resolution trace.

Expected behavior

A trivial PowerShell command should run through the elevated sandbox, or the runner should return a more actionable diagnosis identifying the denied object or missing right.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 26 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #35871

Powered by Codex Action

metam1nd · 26 days ago

Confirmed duplicate of #35871. This report adds an ARM64 data point: the same deterministic failure occurs with the Store/MSIX ARM64 build of PowerShell 7.6.4 (C:\Program Files\WindowsApps\Microsoft.PowerShell_7.6.4.0_arm64__8wekyb3d8bbwe\pwsh.exe) on Codex CLI 0.146.0. The elevated sandbox setup and runner resolution complete, but launching the packaged shell fails with CreateProcessAsUserW failed: 5. Closing this issue in favor of #35871.