Windows sandbox command runner fails with CreateProcessAsUserW failed: 1312

Open 💬 2 comments Opened Jun 25, 2026 by martinmclee

What issue are you seeing?

Native Codex shell execution fails with:

windows sandbox: runner error: CreateProcessAsUserW failed: 1312

in non-escalated runs, even for trivial read-only commands.

Versions

  • OS: Windows 11 x64
  • Codex app/runtime: 26.616.81150 UI, runtime path under %PROGRAMFILES%\WindowsApps\OpenAI.Codex_*
  • app sandbox config: sandbox_mode = "danger-full-access", [windows] sandbox = "unelevated"
  • issue observed on 2026-06-25 after normal tool activity

Minimal repro

  1. Run any trivial command such as Get-Location.
  2. Non-elevated command execution returns:
  • windows sandbox: runner error: CreateProcessAsUserW failed: 1312

Direct tool output

When invoking the same command path from non-escalated shell execution:
Get-Location | Format-List -Property Path

Observed:
execution error: Io(Custom { kind: Other, error: "windows sandbox: runner error: CreateProcessAsUserW failed: 1312" })

Additional notes

  • Escalated execution path still works for file read commands and shell command preparation.
  • rg and shell attempts show sandbox setup starts and succeeds in .codex/.sandbox/sandbox.2026-06-25.log, including:
  • setup refresh: processed 3 write roots (read roots delegated); errors=[]
  • read ACL run completed
  • Yet command invocation fails with CreateProcessAsUserW failed: 1312 at runner boundary.
  • Attempted non-destructive recovery (state folder rollback only) did not restore execution.

Expected behavior

Simple read-only command calls (no external tooling, no writes) should execute.

Actual behavior

Command execution fails at sandbox run boundary with CreateProcessAsUserW failed: 1312.

I did not restart Codex as a workaround for this repro.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗