Repository navigation
Windows sandbox fails with helper_unknown_error: apply deny-read ACLs in workspace-write mode #36087
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.721.81911
What subscription do you have?
Pro
What platform is your computer?
OS: Windows 11 Pro, 64-bit
What issue are you seeing?
Description
Codex Desktop on Windows intermittently fails to initialize the filesystem sandbox for a normal writable workspace.
Sandboxed shell commands and apply_patch fail with:
windows sandbox: helper_unknown_error: apply deny-read ACLs
The workspace itself is readable and writable outside the sandbox. The same read/write test succeeds when executed with escalated sandbox permissions.
The problem persists after:
Moving the repository to a new directory with normal inherited Windows permissions.
Adding the new directory as the project folder.
Fully exiting and restarting the Codex Desktop application.
Environment
- Codex Desktop package version: 26.721.11231.0
- OS: Windows 11 Pro, 64-bit
- Windows version: 10.0.26200
- Windows build: 26200
- Shell: PowerShell
- Workspace: C:\dev\app1
- Sandbox mode: workspace-write
- The workspace is included in the configured writable roots.
What steps can reproduce the bug?
Open Codex Desktop on Windows.
Open a local Git repository under C:\dev\app1.
Run a simple read-only command in the normal sandbox, for example:
Get-Content -LiteralPath .\package.json -TotalCount 1
Observe that the command fails before normal execution with:
windows sandbox: helper_unknown_error: apply deny-read ACLs
Try creating a small file with apply_patch.
In some attempts, the first patch succeeds, but a subsequent patch that reads or deletes the same file fails with the same sandbox error.
Run an equivalent read/write/delete test with escalated sandbox permissions. It succeeds.
What is the expected behavior?
Actual behavior
Normal sandbox operations fail during sandbox initialization:
execution error: Io(Custom {
kind: Other,
error: "windows sandbox: helper_unknown_error: apply deny-read ACLs"
})
A representative apply_patch failure is:
apply_patch verification failed:
Failed to read C:\dev\app1\.codex-patch-test.txt:
fs sandbox helper failed with status exit code: 1:
windows sandbox failed: helper_unknown_error: apply deny-read ACLs
The behavior is inconsistent: one apply_patch call may create a file successfully, while the immediately following patch fails to read or delete it.
Expected behavior
Sandboxed read and write operations should work consistently for files inside a configured writable workspace.
apply_patch should be able to create, read, update, and delete workspace files without requiring escalated execution.
Filesystem verification
A direct read/write/read-back/delete test performed outside the failing sandbox succeeded:
ExistingFileRead : {
WriteReadMatch : True
Created : True
CleanedUp : True
The workspace has standard inherited Windows permissions:
BUILTIN\Administrators: Full control
NT AUTHORITY\SYSTEM: Full control
BUILTIN\Users: Read and execute
NT AUTHORITY\Authenticated Users: Modify
Therefore, the underlying workspace is accessible and writable; the failure appears to occur while the sandbox helper is applying its deny-read ACL rules.
Additional information
Additional observations
- The same error occurred in the repository’s previous directory.
- Moving the complete repository to a fresh project directory did not resolve it.
- Fully restarting Codex Desktop did not resolve it.
- Read-only commands may remain pending for tens of seconds before returning the sandbox initialization error.
- Escalated commands can read and write the same workspace successfully.
- No project source files were changed while diagnosing the issue; only uniquely named temporary test files were used and then removed.
Impact
The issue prevents reliable source editing because normal shell commands and apply_patch cannot consistently operate inside the workspace sandbox. Read-only inspection can be performed with escalation, but the standard safe patch workflow is unusable.
Activity
github-actions commentedon Jul 30, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
gaoshanyan1-oss commentedon Jul 30, 2026
Additional affected-user report (anonymized):
26.721.81911(Windows 11)windows sandbox: helper_unknown_error: apply deny-read ACLsapply_patchThis may be a Windows ACL sandbox initialization regression in this desktop build. A recovery mechanism or official workaround would be very helpful.
kecskeslaszlo94 commentedon Aug 14, 2026
Additional reproduction on Codex Desktop 26.810.41047 (released 2026-08-13), Windows. With CDP enabled, the local PowerShell runner and Node/Computer Use bridge still fail before user code with
windows sandbox: helper_unknown_error: apply deny-read ACLs; browser and mouse control are consequently unavailable. This persists on a newer desktop build than the original report.tico0505 commentedon Aug 16, 2026
I can reproduce the same failure in Codex Desktop on Windows, with an additional create-then-update pattern that may help isolate the helper path.
Environment
26.810.7004.019045.6466workspace-write[windows] sandbox = "elevated"D:\<workspace>Minimal reproduction
apply_patchto create it with the contentprobe-step-created.apply_patchto replace that line withprobe-step-modified.The second patch fails before applying the edit:
The modification is not applied; the original 19-byte content remains intact.
Read and ACL comparison
probe-step-created(19 bytes).DenyACE.CodexSandboxUsershas inheritedModifyaccess on both paths.apply_patch:BUILTIN\Administrators.This makes an underlying NTFS read denial unlikely. The failure appears specific to the
apply_patchverification/helper step that applies deny-read ACL state.Logging observation
%USERPROFILE%\.codex\.sandbox\sandbox.logwas stale: its last write was 2026-06-15, so it contained no entries for this August reproduction. That may be a separate diagnostics/logging gap.No project source files, ownership, ACLs, or sandbox settings were changed during diagnosis.
meSATYA commentedon Aug 20, 2026
Removing .cache\codex-runtimes folder and reinstalling codex might help.
IvanDosBarbas commentedon Aug 21, 2026
I can reproduce this in Codex Desktop on Windows in a normal
workspace-writetask.Observed behavior:
Get-Contentagainst a file inside the configured writable workspace.apply_patchfails before reading the target file withfs sandbox helper failed ... helper_unknown_error: apply deny-read ACLs.windows sandbox failed: helper_unknown_error: apply deny-read ACLs.The workspace is under
C:\Users\<redacted>\Documents\Codex\...and is listed in the task's writable roots. This blocks all inspection and editing, even for a single standalone HTML file.Codex task/session ID for diagnostics:
01a01dc3-9460-7e50-99c3-9fd8c2c386fe.Barragek0 commentedon Aug 23, 2026
Additional data point with a confirmed root cause and a no-admin workaround — posting here because the failure signature matches this issue exactly (
SetNamedSecurityInfoWerror 5 while applying deny ACEs during sandbox setup refresh).Environment
openai.chatgpt-26.818.41705-win32-x64C:\...(local NTFS drive)helper_unknown_error: setup refresh had errors, before PowerShell/cmd ever startedRoot cause
A workspace-local
.codexfolder inside the repo had been left owned byCodexSandboxOffline(leftover from an earlier session where a sandboxed process had write access to the workspace):Every subsequent command triggered a setup refresh, and the helper tried to apply its deny-read ACE on that folder. Since the helper runs as the interactive user (not the owner, not elevated),
SetNamedSecurityInfoWreturned error 5 (ACCESS_DENIED) and the whole refresh aborted:This repeated identically on every single command attempt (verified across ~20 entries in
%USERPROFILE%\.codex\.sandbox\sandbox.<date>.log). Note the generic UI error (setup refresh had errors) hides the actual per-path ACL failure — you only see it in the sandbox log.Workaround (no admin, no ownership changes)
In my case the mis-owned folder was completely empty, so it could simply be deleted — Codex recreates it with correct ownership on the next setup refresh:
After deleting, the next command succeeded immediately. No ACLs were modified, no ownership taken, nothing disabled, no reinstall needed.
If the folder is not empty, don't delete it blindly — use the ownership-restore approach described in #38898 (comment) instead.
Suggestions for maintainers
CodexSandbox*owning paths inside the workspace) and either self-heal or surface the specific path and Win32 error instead of the generichelper_unknown_error..codexin the workspace before granting write access, or exclude it from writable roots)..gitowned byCodexSandboxOfflinein #38898.patricio4-wsl commentedon Aug 28, 2026
Seguimiento a solicitud del usuario. Codex Desktop identificó este issue como relacionado y realizó esta comparación técnica desde el propio entorno Desktop.
En Windows, con codex-cli 0.149.1 tanto en Desktop como en la CLI standalone, Desktop falla de forma reproducible al usar
apply_patchen un workspace aprobado: incluso una prueba temporal inocua devuelveAccess denied/Failed to write file. En una ocasión creó un archivo vacío pero no pudo escribirlo ni eliminarlo con el helper.La misma operación mediante la CLI standalone funciona en el mismo workspace. No se cambiaron ACLs, owner, WindowsApps, permisos del repositorio ni el modo de sandbox. Eso refuerza que el problema está en la inicialización/identidad efectiva del sandbox o helper de Desktop, no en el contenido del proyecto.
Impacto: Desktop sigue siendo útil para análisis y validaciones read-only, pero obliga a desviar las ediciones de
apply_patcha CLI. El informe no incluye rutas personales, SIDs, credenciales ni datos privados.English translation
Follow-up at the user's request. Codex Desktop identified this issue as related and produced this technical comparison from within the Desktop environment itself.
On Windows, using codex-cli 0.149.1 in both Desktop and the standalone CLI, Desktop reproducibly fails when using
apply_patchin an approved workspace: even a harmless temporary-file probe returnsAccess denied/Failed to write file. On one occasion it created an empty file but could neither write it nor delete it through the helper.The same operation works through the standalone CLI in the same workspace. No ACLs, owner, WindowsApps installation, repository permissions, or sandbox mode were changed. This reinforces that the problem lies in Desktop's sandbox/helper initialization or effective identity, rather than in project content.
Impact: Desktop remains useful for analysis and read-only validations, but forces edits through
apply_patchto be redirected to CLI. The report includes no personal paths, SIDs, credentials, or private data.mychun1111-jpg commentedon Aug 30, 2026
Additional reproduction matching this issue:
Observed behavior:
helper_unknown_error: setup refresh had errors, followed byFailed to write file D:\<redacted-workspace>\codex_sandbox_write_test.tmp.Impact:
A paid user was blocked from applying a one-line local configuration update and completing an otherwise straightforward deployment. The troubleshooting path required repeated restarts, permission-mode changes, sandbox configuration changes, fresh-chat tests, filesystem checks, and manual ACL inspection, without producing an actionable error. Besides fixing the sandbox helper failure, it would help if Codex stopped after bounded checks and surfaced a clear product-level failure instead of shifting extended platform debugging effort to the user.
No secrets, account IDs, full local paths, or production credentials are included in this report.
esko666sm-lgtm commentedon Sep 19, 2026
We are seeing the same
helper_unknown_error: apply deny-read ACLsfailure on Windows withworkspace-write, including cases where ordinary reads work butapply_patchcannot create or modify files in the workspace.A useful diagnostic/workaround path from our repeated runs:
docs), the same sandbox error later appeared whenapply_patchneeded to create files undersrc/tests.apply_patchhelper outside the failing sandbox boundary only when necessary, rather than progressively broadening repository ACLs or disabling Windows security controls.So I would caution against treating a recursive/full-repository ACL grant as the fix. A narrow ACL correction can resolve a real local permission mismatch, but the reproducible
apply deny-read ACLsfailure can remain and reappear on another writable subtree.esko666sm-lgtm commentedon Oct 2, 2026
Follow-up from the Windows environment I reported earlier.
Thanks for the additional reproductions and especially the ownership finding around workspace-local
.codex/.gitpaths. Our later runs are consistent with the broader conclusion that this is not solved by granting wider NTFS permissions to the repository.What we have observed:
helper_unknown_error: apply deny-read ACLs;The report from @Barragek0 is particularly useful because it identifies a concrete owner mismatch (
CodexSandboxOffline) that can produce the same failure class. I think it would be valuable for the helper to surface the exact failing path, owner and Win32 error in the UI instead of collapsing this tohelper_unknown_error, and where safe detect/recover sandbox-owned workspace state.For anyone testing the empty-
.codexworkaround: please verify the directory is actually empty before deleting it; I would not recommend deleting a non-empty workspace state directory or recursively changing ownership/ACLs just to make the error disappear.I can provide another sanitized Windows reproduction/log comparison if maintainers need a specific probe.