Skip to content

Windows sandbox: command execution fails with CreateProcessWithLogonW failed: 5 #9062

Description

@tagorr

What version of Codex is running?

codex-cli 0.80.0

What subscription do you have?

ChatGPT Plus

Which model were you using?

gpt-5.2 (reasoning medium, summaries auto)

What platform is your computer?

Microsoft Windows NT 10.0.17763.0 x64

What issue are you seeing?

After upgrading to Codex CLI v0.80.0 on native Windows, agent mode started prompting for approval for almost every command, including simple read-only commands inside the workspace (for example cmd.exe /c type AGENTS.md). In addition, command execution inside the Windows sandbox fails with:

windows sandbox: CreateProcessWithLogonW failed: 5

This prevents apply_patch and even basic commands from running. The behavior persisted even after downgrading to v0.79.0, until I forced a sandbox re-onboarding flow (disable experimental_windows_sandbox, restart, then accept the “Enable experimental sandbox” onboarding prompt). After that re-onboarding, sandbox execution worked again and the patch could be applied.

Also, release notes mention /elevate-sandbox, but the command is not recognized and is not present in the slash command list in my TUI session.

Finally, approval mode appears inconsistent during onboarding: /status showed Approval: on-request even though config.toml had approval_policy = "on-failure". After codex resume, /status returned to on-failure.

What steps can reproduce the bug?

Repro (high level)

  1. Install/run Codex CLI v0.80.0 on native Windows (no WSL).

  2. Ensure agent mode is enabled and sandbox is workspace-write.

  3. Run any prompt that needs to read files and apply a patch.

  4. Observe repeated approval prompts for in-workspace commands and/or failures:

    • windows sandbox: CreateProcessWithLogonW failed: 5

Notes

  • Even after downgrading to v0.79.0 the failure persisted, until the sandbox was re-onboarded via the UI prompt.

Workaround that recovers the sandbox

  1. Set experimental_windows_sandbox = false in ~\.codex\config.toml and restart Codex.

  2. Accept the “Enable experimental sandbox” onboarding prompt.

  3. After this re-onboarding, sandbox process creation works again and apply_patch succeeds.

Uploaded thread: 019baafa-08a3-72b0-8595-7588471ad5d1

What is the expected behavior?

Expected behavior

  • On native Windows, with sandbox workspace-write, Codex should be able to run read-only commands inside the workspace without per-command approvals (unless accessing outside workspace or network).

  • approval_policy should be consistently reflected by /status, and should follow config.toml unless explicitly overridden.

  • Windows sandbox should be able to create processes reliably, so apply_patch and basic commands do not fail with CreateProcessWithLogonW failed: 5.

Additional information

Environment

  • OS: Windows 10 Enterprise LTSC 2019 (1809), build 17763.7792 (native, no WSL)

  • Codex CLI: v0.80.0 (problem), v0.79.0 (problem persisted after downgrade)

  • Install: npm global (@openai/codex)

  • Shell: Windows PowerShell 5.1 and cmd.exe

  • Workspace: D:\Downloads\LTSC clean\win10-ltsc-2021-clean-quiet-baseline

  • Config (~\.codex\config.toml):

    • sandbox_mode = "workspace-write"

    • approval_policy = "on-failure"

    • [features] experimental_windows_sandbox = true

    • [features] elevated_windows_sandbox = false (also tested true/false)

Image Image Image

sandbox.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions