Skip to content

Windows sandbox startup and elevated setup fail when deny-read ACL state is zero-filled #47950

Open

Description

@wdhrhfbprg-blip

Summary

Browser-control initialization and ordinary sandboxed commands fail before reaching the requested website or command. Retrying after an app-restart attempt and rerunning the supported elevated Windows sandbox setup did not resolve the failure.

Environment

  • Windows 10, build 19045.
  • Native elevated Windows sandbox.
  • Installed CLI: 0.155.0-alpha.16.4 (desktop app version not independently verified).
  • Reproduced September 24, 2026.

Observed behavior

The startup error is:

windows sandbox failed: helper_unknown_error: apply deny-read ACLs

The sandbox log narrows this to:

parse deny-read ACL state <CODEX_HOME>/.sandbox/deny_read_acl_state.json
expected value at line 1 column 1

Read-only inspection found that this state file is 22 bytes, all NUL bytes, rather than valid JSON. Why it became zero-filled is unknown.

The documented windowsSandbox/setupStart request with mode: elevated returned started: true, followed by windowsSandbox/setupCompleted with success: false and the same apply deny-read ACLs error. The file remained zero-filled after this attempt.

Expected behavior / recovery request

Sandbox setup should provide a supported recovery path or an actionable diagnostic for malformed persisted ACL state. Please advise how to recover without blindly deleting permissions bookkeeping.

No manual ACL changes, state-file replacement/deletion, or sandbox bypass was attempted. No private conversation, account credentials, or full logs are attached.

Activity

  1. added
    bug
    windows-os
    sandbox
    on Sep 24, 2026
  2. github-actions commented on Sep 24, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. TravelerAnt commented on Sep 26, 2026

    @TravelerAnt

    Additional confirmation from an affected Windows installation:

    • Codex Desktop package: OpenAI.Codex 26.917.9434.0
    • Bundled CLI: 0.155.0-alpha.16.4

    Browser/Computer Use fails before navigation:

    node_repl kernel exited unexpectedly
    windows sandbox failed: helper_unknown_error: apply deny-read ACLs
    

    The saved nested diagnostic identifies JSON parsing of deny_read_acl_state.json:

    expected value at line 1 column 1
    

    Read-only inspection of the file named in that diagnostic found exactly 22 bytes, all NUL bytes, not valid JSON. The cause of the corruption is unknown.

    Please provide a supported recovery procedure for this malformed persisted state that preserves the sandbox's security restrictions.

  4. chatsojang-lgtm commented on Sep 28, 2026

    @chatsojang-lgtm

    Root cause and workaround confirmed on Windows 11 Pro, codex-cli 0.157.1 (npm) + Codex app 26.924.2738.0, [windows] sandbox = "elevated".

    Trigger: an unclean power-cycle reboot while codex was running. %USERPROFILE%\.codex\.sandbox\deny_read_acl_state.json was left as 22 bytes of 0x00 (mtime = 2 minutes before boot). NTFS had already allocated the new extent for the rewrite when power was cut, so the size survived but the content did not.

    Why it kills every command: codex-rs/windows-sandbox-rs/src/deny_read_state.rs

    • store_state uses std::fs::write (in-place overwrite, no temp-file + rename, no fsync) -> torn write on power loss.
    • load_state treats NotFound as a fresh state but any parse error as fatal -> setup error: apply deny-read ACLs / Caused by: parse deny-read ACL state ... / expected value at line 1 column 1 in .sandbox\sandbox.<date>.log, surfaced to the agent as helper_unknown_error: apply deny-read ACLs on every exec_command. Restarting CodexSandboxService, re-running elevated setup, or reinstalling does not help because the corrupt file is never touched. (main is byte-identical to rust-v0.157.1 for this file, so 0.158.0 behaves the same.)
    • The 22-byte size is exactly serde_json::to_vec_pretty of the empty state {"principals": {}}.

    Workaround (worked immediately): back up and delete the file, then run any command - the helper recreates it:

    $f = "$env:USERPROFILE\.codex\.sandbox\deny_read_acl_state.json"
    Copy-Item $f "$f.corrupt-$(Get-Date -Format yyyyMMdd-HHmm)"; Remove-Item $f

    Detection: the file is exactly 22 bytes and every byte is 0x00.

    Suggested fix: write atomically (temp file in the same dir + rename, ideally fsync) and make load_state tolerant - on a parse error, rename the bad file aside (*.corrupt) and continue with the default state instead of failing the whole sandbox.

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

    bugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions