Codex Desktop Windows sandbox setup fails on NTFS ACL / SetNamedSecurityInfoW error 5, then agents fall back to unsandboxed PowerShell escalation

Open 💬 2 comments Opened Jul 8, 2026 by arketov
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.623.141536 • Released 7 июл. 2026 г.

What subscription do you have?

plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Product:
Codex Desktop on Windows

Version / build observed:
OpenAI.Codex_26.623.19656.0_x64
codex-command-runner-0.142.5.exe

Environment:
Windows, non-elevated Codex Desktop.
Workspace roots on D:\Projects\..., NTFS owner was BUILTIN\Administrators.

Problem:
All sandbox modes that require filesystem setup can fail before any command runs.
The agent sees helper_unknown_error / setup refresh had errors.
After that, agents request require_escalated, so work continues through PowerShell outside sandbox. This is unsafe and extremely confusing.

Observed local errors:
C:\Users\arketov\.codex\.sandbox\setup_error.json:
{
"code": "helper_unknown_error",
"message": "setup refresh had errors"
}

Sandbox log:
write ACE grant failed on D:\Projects\miles\regionTMC: SetNamedSecurityInfoW failed: 5
setup refresh completed with errors
setup error: setup refresh had errors

Root cause:
Codex sandbox setup tries to grant write ACEs on workspace roots.
If the workspace root is owned by BUILTIN\Administrators and the non-elevated user lacks WRITE_DAC, Windows returns ERROR_ACCESS_DENIED (5).
Codex reports this as a generic helper failure instead of explaining the ACL problem or offering a UAC repair.

Expected behavior:
Codex should detect this and show a clear actionable error:
“Cannot prepare Windows sandbox ACLs for workspace root. Current user lacks WRITE_DAC. Run UAC repair / grant the user ACL rights / choose another workspace root.”
It should not silently degrade into agents requesting unsandboxed PowerShell escalation.

Workaround that fixed it locally:
Run elevated:
icacls "D:\Projects" /grant "%USERDOMAIN%\%USERNAME%:(OI)(CI)(F)"

After this:
setup_error.json disappeared
sandbox log shows errors=[]
sandboxed exec_command works without require_escalated

Impact:
Paid Codex Desktop app appears broken on Windows for any workspace tree with admin-owned ACLs.
The error message hides the real cause.
The fallback path encourages unsafe unsandboxed execution.

What steps can reproduce the bug?

setup and run

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 1 month ago

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

  • #31414

Powered by Codex Action

McSlaine · 21 hours ago

I can reproduce this issue on the current Codex Desktop Windows build when the task workspace is a Microsoft OneDrive-synchronised folder.

Environment:

  • Codex Desktop: OpenAI.Codex_26.820.9563.0_x64
  • Windows x64
  • Workspace: D:\OneDrive - <Organisation>
  • Affected features: sandboxed commands, Chrome/browser control, and Computer Use across multiple models/tasks, including Luna

Observed error:

windows sandbox failed:
helper_unknown_error: setup refresh had errors

Relevant sandbox log lines:

granting write ACE to D:\OneDrive - <Organisation>
write ACE grant failed on D:\OneDrive - <Organisation>:
SetNamedSecurityInfoW failed: 5

setup refresh completed with errors
setup error: setup refresh had errors

The failure occurs before browser tab discovery or command execution. The Chrome extension and native-messaging setup validate correctly, so this is not an extension installation or login problem.

The same Codex runtime successfully initializes when a task is rooted under a local folder such as:

C:\Users\<user>\Documents\Codex\<task>

This suggests the sandbox's mandatory write-ACE operation is incompatible with, or lacks permission for, this OneDrive-managed workspace root. A rejected writable root aborts the complete sandbox setup, making unrelated browser and command features appear broken.

Expected behaviour:

  • Codex should support OneDrive-synchronised NTFS workspaces; or
  • detect the ACL limitation and use a safe alternative; or
  • immediately identify the rejected workspace path and recommend moving the task to a local folder.

It should not report only helper_unknown_error, because that misleadingly presents the problem as a browser-plugin or model failure.