Skip to content

Windows CLI 0.166.0: exec_command blocked by policy in read-only and split writable-root failure in workspace-write #59314

Open

Description

@NOBU-UBON

Summary

On native Windows 11, Codex CLI exec_command fails before launching even a read-only pwd command. Separately, workspace-write fails with the split writable-root restriction. Direct codex sandbox commands, including a controlled create/read/delete probe, succeed.

I am requesting diagnosis and a supported fix, not an unsandboxed workaround.

Environment

  • Windows 11 Pro 25H2, build 26200.9711, x64
  • Codex standalone CLI 0.166.0 (also reproduced on 0.163.0 and 0.162.0 for the split-root error)
  • Native Windows PowerShell, standard user, domain-joined machine
  • Workspace: local Git repository under the user's profile (path redacted)
  • Windows backend: [windows] sandbox = "unelevated"
  • The Windows Codex Sandbox Service is running; desktop package 26.1027.6604.0
  • No OS security settings, ACLs, or persistent Codex configuration were changed during investigation.

Reproduction A: read-only pre-launch policy rejection

From a local Git workspace:

codex exec --ignore-user-config --ignore-rules --disable plugins --ephemeral --sandbox read-only 'Run pwd only. Do not create, modify, or delete files. Do not retry outside the sandbox.'

The session reports sandbox: read-only, approval: never and attempts to launch pwsh.exe -NoProfile -Command pwd.

Actual:

exec_command failed: CreateProcess {
  message: "Rejected(\"...\\WindowsApps\\pwsh.exe -NoProfile -Command pwd\" rejected: blocked by policy)"
}

The same pre-launch refusal occurs with a prompt requesting cmd.exe /d /c echo CODEX_EXEC_ASCII_OK; the tool still tries to launch a PowerShell wrapper first.

Adding -c 'approval_policy="on-request"' does not change the displayed effective approval: never for codex exec.

The user default.rules contains no matches for decision="forbidden" or decision="prompt" in a full-file text search; importantly, --ignore-rules also reproduces the rejection. This does not rule out internal or managed policies.

Reproduction B: workspace-write split writable-root failure

codex exec --ignore-user-config --disable plugins --ephemeral --sandbox workspace-write -c 'windows.sandbox="unelevated"' -c 'sandbox_workspace_write.exclude_slash_tmp=true' -c 'sandbox_workspace_write.exclude_tmpdir_env_var=true' 'Run pwd only. Do not modify files or retry outside the sandbox.'

The effective sandbox is workspace-write [workdir], yet exec_command fails:

UnsupportedOperation("windows unelevated restricted-token sandbox cannot enforce split writable root sets directly; refusing to run unsandboxed")

This also occurs without the two temporary-root exclusions. Enabling experimental prefer_mxc instead results in MXC launcher: CreateProcessW failed with error code 668 (0x0000029C).

Control tests

  • codex sandbox --permission-profile :workspace -- cmd.exe /d /c echo SANDBOX_ASCII_OK succeeds.
  • A direct codex sandbox --permission-profile :workspace CMD create/read/delete probe in the workspace succeeds and leaves no probe file.
  • Direct cmd.exe /d /c echo CODEX_EXEC_ASCII_OK succeeds.
  • An earlier codex exec --sandbox read-only test succeeded under different settings, so the read-only failure may be dependent on effective policy/configuration; the exact difference has not been isolated.
  • No unsafe execution fallback was used.

Expected

  • Read-only harmless commands should run when permitted, or the denial should identify the effective enforcing policy and supported remediation.
  • Workspace-write should enforce writable roots safely rather than fail on a representable split-root configuration.
  • No implicit unsandboxed fallback.

Related reports

Are these separate known defects? What supported diagnostics can identify the effective policy denying exec_command when --ignore-rules is used? Is the split-root fix planned for a release?

All account names, workspace paths, internal IDs and project details have been omitted.

Activity

  1. added
    bug
    CLI
    windows-os
    exec
    sandbox
    tool-calls
    on Nov 4, 2026
  2. removed
    exec
    on Nov 29, 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

    CLIbugsandboxtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions