Repository navigation
Description
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_OKsucceeds.- A direct
codex sandbox --permission-profile :workspaceCMD create/read/delete probe in the workspace succeeds and leaves no probe file. - Direct
cmd.exe /d /c echo CODEX_EXEC_ASCII_OKsucceeds. - An earlier
codex exec --sandbox read-onlytest 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
- Codex on Windows rejects an authorised command with “blocked by policy” but gives no reason or recovery action #56722: opaque Windows
blocked by policybefore PowerShell launch - [BUGFIX INCLUDED] Windows unelevated sandbox rejects enforceable split writable roots, breaking apply_patch updates and deletes #35864: exact split writable-root restriction and proposed fix
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
github-actions commentedon Nov 4, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
blocked by policywith no matching execpolicy rule; feedback permission error #58601Powered by Codex Action