Skip to content

Windows sandbox permanently unusable after a truncated deny_read_acl_state.json write #39453

Open

Description

@Chalky56

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

26.814.41407

What subscription do you have?

plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Summary

A single interrupted write leaves deny_read_acl_state.json as a fixed-length run of
NUL bytes. From that moment the Windows sandbox can never start again. Every
sandboxed operation fails, and the failure is unrecoverable through the UI: restarting
the app, updating to a new build and rebooting Windows all leave the corrupt file in
place. In my case it silently blocked all apply_patch work for ten days.

Two things make this worse than an ordinary crash-recovery gap:

  1. The error names the wrong subsystem. It reports apply deny-read ACLs, so
    every diagnostic path — mine and the assistant's I asked for help — went hunting
    Windows ACLs, Controlled Folder Access, antivirus interception and sandbox user
    accounts. The code never reaches the ACL stage. It fails while reading its own
    state file
    .
  2. There is no automatic recovery. An unparseable cache file is treated as fatal
    rather than discarded and rebuilt.

Error output

setup error: apply deny-read ACLs

Caused by:
    0: parse deny-read ACL state C:\Users\<user>\.codex\.sandbox\deny_read_acl_state.json
    1: expected value at line 1 column 1
[codex.exe] setup refresh: exited with status ExitStatus(ExitStatus(1))

expected value at line 1 column 1 is the serde_json error for input that is empty
or does not begin with valid JSON.

Root cause

The state file was 22 bytes, every byte 0x00:

00000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000010: 0000 0000 0000                           ......

The file that Codex writes on a healthy run is also 22 bytes. So the length was
preserved while the contents were not — the classic NTFS signature of metadata being
flushed before data, i.e. an interrupted write from a crash, forced shutdown or power
loss. The file's mtime matched the last date the sandbox ever worked.

Timeline

When What
9 Aug, 05:30 deny_read_acl_state.json written as 22 NUL bytes
9 Aug, 06:29 last successful CodexSandboxOffline logon — sandbox works
9 Aug → 19 Aug every sandbox setup fails identically
19 Aug file renamed aside; sandbox works again immediately

What steps can reproduce the bug?

  1. Use Codex Desktop on Windows until %USERPROFILE%\.codex\.sandbox\deny_read_acl_state.json exists.
  2. Close Codex. Overwrite that file with NUL bytes, preserving its length:
    $p = "$env:USERPROFILE\.codex\.sandbox\deny_read_acl_state.json"
    [IO.File]::WriteAllBytes($p, (New-Object byte[] ((Get-Item $p).Length)))
    (An empty file, or any non-JSON first byte, reproduces it equally.)
  3. Start Codex and run anything that needs the sandbox, e.g. an apply_patch.
  4. It fails with the error above, and keeps failing.

What is the expected behavior?

An unreadable or unparseable sandbox state file should be discarded and rebuilt, with
a warning. It is a cache of applied ACEs, not authoritative data — losing it costs a
re-apply, not a working installation.

At minimum the error should name the actual failure: reading a state file, and the
path, so the user can delete it. Ideally the message would say so outright.

Additional information

What did not fix it

  • Closing and reopening Codex Desktop, and starting a fresh task — no change
  • Updating Codex — no change. My logs show two different builds producing
    byte-identical failures:
    • 16 Aug: ...\.devin\extensions\openai.chatgpt-26.5730.61309-win32-x64\...\codex-windows-sandbox-setup.exe
    • 18 Aug: C:\Program Files\WindowsApps\OpenAI.Codex_26.814.5167.0_x64__...\codex-windows-sandbox-setup.exe
  • Restarting Windows — no change

None of these touch a file in the user profile, which is why the advice to restart or
update cannot work for this failure mode.

What did fix it

Renaming deny_read_acl_state.json aside and letting Codex recreate it. Working
immediately, first attempt, no other change.

Ruled out during diagnosis

Recorded because the misleading error message sends people to all of these:

  • Defender Controlled Folder Access — disabled; no block events
  • Third-party AV/EDR — none; Defender only, normal mode
  • Filesystem — NTFS; long paths enabled
  • Workspace scale — 4,636 files, 1,124 dirs, longest path 145 chars, no symlinks
  • Reparse points / OneDrive placeholders in the workspace — none
  • User permissions — verified by applying a deny-read ACE to a temp file in the
    workspace by hand: succeeded
  • OneDrive redirection — Documents, Desktop and Pictures are all redirected to
    OneDrive with cldflt running, and applying a deny ACL inside OneDrive Documents
    also succeeded
  • Orphaned SIDs — two unresolvable SIDs hold Modify on the workspace; irrelevant,
    the sandbox works fine with them present

Environment

OS Windows 11 Pro, build 10.0.26200, UBR 9168
Codex OpenAI.Codex_26.814.5167.0_x64 (also reproduced on openai.chatgpt-26.5730.61309-win32-x64)
command-runner codex-command-runner-0.148.0-alpha.15.exe
Sandbox accounts CodexSandboxOffline, CodexSandboxOnline, both enabled
Workspace local NTFS path under C:\Users\<user>\Documents

Unrelated warning seen on every healthy run

Non-fatal, but noise in the log:

hide users: failed to hide current user profile dir (C:\Users\Default):
SetFileAttributesW failed for C:\Users\Default: 5 (Access is denied)

Activity

  1. added
    app
    on Aug 19, 2026
  2. added
    bug
    windows-os
    sandbox
    on Aug 19, 2026
  3. LukAIsz commented on Sep 6, 2026

    @LukAIsz

    I am experiencing the exact same failure.

    Codex VS Code extension: v26.901.22334
    OS: Windows 11 Pro 25H2, build 26200.9168, x64

    %USERPROFILE%.codex.sandbox\deny_read_acl_state.json is exactly 22 bytes and all bytes are NUL.

    Sandbox log:
    setup error: apply deny-read ACLs
    Caused by:
    0: parse deny-read ACL state
    1: expected value at line 1 column 1

    All child processes are blocked before startup, including a read-only Get-Location command.

    Updating the extension, restarting extensions, reloading VS Code, and restarting Codex did not repair the state.

    Feedback ID:
    01a06953-2526-7f82-ac67-23e0907e21cd

    I have not manually modified the state file or ACL configuration.

  4. cola201413 commented on Sep 7, 2026

    @cola201413

    I am experiencing the same Windows sandbox startup failure:
    helper_unknown_error: apply deny-read ACLs.

    Historical logs report a parsing failure for deny_read_acl_state.json at line 1 column 1. A supplied copy examined during diagnosis is exactly 22 bytes, all NUL (0x00), and is not valid JSON. Restarting did not resolve the reported failure. The supplied-copy analysis did not modify the Windows state file or ACLs; recovery has not been verified.

    The application confirmed that diagnostic feedback was uploaded:
    no-active-thread-01a07d1a-9b9d-7392-8055-24cbda46273e

    Please correlate this feedback with the issue and advise a supported recovery procedure that preserves existing sandbox permissions and isolation.

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

    appbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions