Skip to content

Windows sandbox initialization fails: SYSTEM denied WRITE_DAC on .sandbox-bin #59038

Open

Description

@bailingweiyu

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

26.1027.3384.0

What subscription do you have?

ChatGPT Prolite

What platform is your computer?

Windows 10 Enterprise 22H2 (Build 19045), x64

What issue are you seeing?

Codex for Windows repeatedly displays "Finish Windows setup to continue" and fails to initialize its elevated sandbox.

Environment:

  • Codex App: 26.1027.3384.0
  • OS: Windows 10 Enterprise 22H2, build 19045, x64
  • Configuration: [windows] sandbox = "elevated"

Observed sandbox logs:

WFP setup succeeded for CodexSandboxOffline with 12 installed filters
codex-windows-sandbox-bin failed: open directory ...\.codex\.sandbox-bin: NtCreateFile: os error 5
setup error: helper_sandbox_lock_failed
sandbox setup required: sandbox setup marker missing or incompatible

Investigation with Microsoft Process Monitor:

  • Process: codex-windows-sandbox-setup.exe
  • Account: NT AUTHORITY\SYSTEM
  • Integrity: System
  • Operation: CreateFile
  • Target: %USERPROFILE%.codex.sandbox-bin
  • Result: ACCESS DENIED
  • Desired Access included Read Control and Write DAC.

The sandbox accounts and CodexSandboxUsers group were present, and the directory ACL passed verification. The directory granted SYSTEM Modify (M), but not WRITE_DAC.

Verified workaround (run from elevated PowerShell):

icacls "$env:USERPROFILE\.codex\.sandbox-bin" /grant "*S-1-5-18:(WDAC)"

After granting SYSTEM WRITE_DAC on the directory, the Windows setup failure disappeared.

Expected behavior: The Codex Windows sandbox provisioning process should establish or validate the permissions required for initialization without manual ACL changes.

The precise reason the original ACL lacked WRITE_DAC is unknown. Please investigate whether installation, upgrading, or sandbox reprovisioning can leave this directory with insufficient permissions.

What steps can reproduce the bug?

  1. Install Codex for Windows version 26.1027.3384.0 on Windows 10 Enterprise 22H2 (Build 19045, x64).

  2. Configure the Windows sandbox mode in ~/.codex/config.toml:

    [windows]
    sandbox = "elevated"
  3. Launch Codex and attempt to complete the Windows sandbox setup.

  4. Codex repeatedly displays "Finish Windows setup to continue" and fails to initialize the sandbox.

  5. Inspect the sandbox logs. The following errors appear:

    codex-windows-sandbox-bin failed:
    NtCreateFile: os error 5
    
    setup error: helper_sandbox_lock_failed
    
  6. Use Microsoft Process Monitor to inspect the failed operation:

    • Process: codex-windows-sandbox-setup.exe
    • User: NT AUTHORITY\SYSTEM
    • Integrity: System
    • Operation: CreateFile
    • Path: %USERPROFILE%\.codex\.sandbox-bin
    • Result: ACCESS DENIED
    • Requested access includes WRITE_DAC.
  7. Verify that the directory ACL grants SYSTEM Modify (M) permission but not WRITE_DAC.

The original ACL configuration could not be reproduced from a clean installation. These steps describe the observed failure on the affected system.

What is the expected behavior?

Codex should successfully initialize the Windows elevated sandbox without requiring manual modifications to filesystem permissions.

The sandbox setup process should automatically establish or validate the required ACL permissions for %USERPROFILE%\.codex\.sandbox-bin.

If the required permissions are missing, the setup process should either repair them safely or provide a clear diagnostic message instead of repeatedly displaying "Finish Windows setup to continue".

Additional information

Root Cause Investigation and Verified Workaround

The issue was investigated using Windows PowerShell and Microsoft Sysinternals Process Monitor.

Confirmed findings:

  • Both CodexSandboxOffline and CodexSandboxOnline accounts existed and were enabled.
  • Both accounts belonged to CodexSandboxUsers.
  • The directory ACL passed icacls /verify.
  • Windows Filtering Platform (WFP) setup completed successfully.
  • The sandbox setup executable was running as NT AUTHORITY\SYSTEM with System integrity.
  • Process Monitor captured an ACCESS DENIED result when the setup executable requested WRITE_DAC access to .sandbox-bin.

Verified workaround:

Running the following command in an elevated PowerShell session resolved the issue:

icacls "$env:USERPROFILE\.codex\.sandbox-bin" /grant "*S-1-5-18:(WDAC)"

After granting WRITE_DAC to SYSTEM, the Windows sandbox setup failure disappeared.

Suggested investigation:

The original directory ACL granted SYSTEM Modify (M) permission, which does not include WRITE_DAC.

This appears to be a permissions mismatch between the sandbox provisioning process and the ACL applied to .sandbox-bin.

The exact cause of the original ACL configuration remains unknown. It may be worth investigating whether installation, application updates, or sandbox reprovisioning can leave this directory without the required permissions.

This workaround modifies a security-sensitive directory ACL and should not be considered an official general-purpose fix.

Activity

  1. added
    app
    on Nov 3, 2026
  2. added
    bug
    windows-os
    sandbox
    on Nov 3, 2026
  3. steffenz190-arch commented on Nov 6, 2026

    @steffenz190-arch

    Additional reproducible report from an affected Windows 10 22H2 (19045), x64 user of the ChatGPT desktop app (Work/Codex), observed on 2026-11-06.

    Observed behavior

    • Desktop app repeatedly shows “Windows setup was not completed / setup stopped” (“Windows-Einrichtung wurde nicht abgeschlossen”).
    • Trying to finish setup again fails, including immediately after a full Windows reboot. The user also reports that changing the app's approval mode does not appear to take effect.
    • The original %USERPROFILE%\.codex\.sandbox\setup_error.json contained:
      {
        "code": "helper_sandbox_lock_failed",
        "message": "lock sandbox bin dir \\?\\%USERPROFILE%\\.codex\\.sandbox-bin failed: open directory ...: NtCreateFile: Zugriff verweigert (os error 5)"
      }
      (Path sanitized; original message included the user profile name.)
    • deny_read_acl_state.json contained {"principals": {}}, without further diagnostic context.

    ACL evidence

    • Initial icacls output for %USERPROFILE%\.codex\.sandbox-bin showed NT AUTHORITY\SYSTEM:(M) but not (WDAC); the interactive Windows account had (M,WDAC).
    • With the app closed, the user backed up the ACL, ran icacls ... /grant "*S-1-5-18:(WDAC)" from an elevated prompt, and confirmed NT AUTHORITY\SYSTEM:(WDAC) appeared afterward. The setup failure banner persisted.

    Other attempts (none fixed it)

    1. App diagnosis of Codex Workspace dependencies reported them healthy; reinstalling the dependencies had no effect (component version shown: 26.1105.12137).
    2. Retrying Windows setup repeatedly.
    3. Renaming (not deleting) %USERPROFILE%\.codex\.sandbox-bin while the app was closed, to force regeneration.
    4. Renaming %USERPROFILE%\.codex\.sandbox while the app was closed, to reset saved setup state.
    5. Fully rebooting Windows: the setup wizard reappeared, but setup still failed.

    Important distinction: the exact helper_sandbox_lock_failed error is confirmed from the initial log. We have not confirmed a newly generated post-reset error log, so the later failure may have a different internal cause.

    Could maintainers investigate why setup or reprovisioning remains broken even after the previously documented SYSTEM:(WDAC) workaround, and identify a supported lasting fix/diagnostic procedure? A user-facing exact failure reason would be particularly helpful. Further blind ACL changes, antivirus disablement, or deleting user configuration should not be necessary.

    This is a follow-up to this issue, not a claim that a single underlying cause has been conclusively identified. Private paths, names and credentials have deliberately been omitted.

  4. steffenz190-arch commented on Nov 6, 2026

    @steffenz190-arch

    Follow-up to the report posted earlier today (2026-11-06): cross-model UI behavior now confirmed by the affected user.

    The same Windows sandbox initialization/setup error is shown when using Astra, not just Sol/Codex. In the Astra interface, the user can select "Full access" ("Vollzugriff"), but the choice does not persist or take effect: the UI allows clicking the option while the effective permission state remains unchanged. The user reports the same persistent Windows setup failure across these execution modes.

    This suggests that the issue may affect a shared Windows setup/permission-state component, rather than a particular reasoning model or task prompt. This is an inference, not a verified root cause. No fresh post-reset setup_error.json was captured yet.

    For maintainers: please also investigate (1) why selecting permission modes does not take effect when Windows setup has failed, (2) whether the UI should explicitly disable or explain unavailable modes, and (3) whether Astra and Codex share the failing setup dependency. No further system-ACL changes or unsafe workarounds have been attempted.

  5. manhmeoipad-a11y commented on Nov 7, 2026

    @manhmeoipad-a11y

    I'm also encountering Windows sandbox initialization errors:

    • helper_sandbox_lock_failed
    • NtCreateFile: access denied (os error 5) on .sandbox-bin
    • sandbox setup marker missing or incompatible

    I have restarted the app and Windows, and checked for updates. The app reports that it is up to date, but the problem persists. No Windows setup banner is shown, so I cannot retry setup from that banner.

    Feedback ID: 01a1b121-72de-7014-9ab1-5170c370902b

    Could you advise on a supported way to recover or retry the sandbox setup?

  6. robbyatbln commented on Nov 10, 2026

    @robbyatbln

    I can reproduce this on Windows 11 with the ChatGPT desktop app (Codex package OpenAI.Codex 26.1103.7773.0, x64). Running Get-Location from a local Codex chat fails before PowerShell starts. Restarting the app and opening a new chat did not resolve it.

    • Error: helper_sandbox_lock_failed, NtCreateFile access denied (Windows error 5), on %USERPROFILE%\.codex\.sandbox-bin.
    • Process Monitor: codex-windows-sandbox-setup.exe runs as NT AUTHORITY\SYSTEM with System integrity. CreateFile on that directory requests Read Control and Write DAC and returns ACCESS DENIED.
    • icacls shows SYSTEM has (M), the interactive account has (M,WDAC), and CodexSandboxUsers has (RX). No manual ACL changes were made.

    Can you confirm which Windows desktop build includes the provisioning fix from #59745?

  7. bamboojuice8-bit commented on Nov 10, 2026

    @bamboojuice8-bit

    Additional Windows 10 report, with a distinction between connected and local execution.

    • Windows 10 build 19045; desktop app version previously recorded as 26.1103.32239. The local diagnostic report identified the bundled runtime as 0.167.0-alpha.3.2.
    • In the affected connected execution path, a command intended only to read a workspace file failed before the target process started: helper_sandbox_lock_failed, NtCreateFile: Access is denied (os error 5), on %USERPROFILE%\.codex\.sandbox-bin.
    • Read-only diagnosis reported the provisioning service running as LocalSystem and a SYSTEM access mask of 0x1301BF, without WRITE_DAC, on that protected directory.
    • A separate local Codex session successfully read the workspace file and ran docker version, returning client/server version 29.9.3. This does not verify the failing connected path.

    Important recovery-state caveat: On November 10, a custom local repair script (not an upstream Codex repair command) attempted one directory-only SYSTEM WRITE_DAC addition and returned ACL_WRITE_ATTEMPTED_UNVERIFIED / IOException: Post-write verification failed. Subsequent read-only comparison found the intended DACL bytes and ACE order, unchanged owner/group and directory identity, but descriptor control changed from 0x9404 to 0x9004: SE_DACL_AUTO_INHERITED cleared while SE_DACL_PROTECTED remained. The custom rollback does not accept this intermediate state. No successful connected-path retest or recovery is claimed, and this script outcome is not being attributed to upstream Codex.

    PR #59745 is merged, but we have not verified an installed desktop build containing it. Could maintainers identify the desktop build carrying the fix and the supported recovery path for an installation in this intermediate ACL state, without further blind permission changes?

    Personal paths, account/device identifiers, raw logs and private project details are omitted.

  8. moffcoVRC commented on Nov 13, 2026

    @moffcoVRC

    Additional Windows 10 recurrence report — November 13, 2026

    Adding the prepared English report here to avoid opening another issue for the same error signature. This adds a successful official elevated setup → verified PC reboot and normal read/write → next-day recurrence sequence. The same MSIX version is also reported in #61154; recurring failures are discussed in #50520. A shared root cause remains a hypothesis for this installation.

    Report date: 2026-11-13. All event times below are JST (UTC+09:00).

    Summary and impact

    The desktop app's "Approve for me" setting reverts to "Ask for approval", and ordinary sandboxed commands fail before the requested command starts. Official UAC-elevated setup temporarily restores operation, but the failure recurs. This repeatedly interrupts daily development and requires another backup and administrator-assisted recovery. Please investigate a durable fix in the supported desktop distribution.

    Environment

    • Windows 10 Home, version/build 10.0.19045; native Windows, not WSL.
    • App updater: version 26.1106.51428, build 26605, channel prod.
    • Windows MSIX package version: 26.1106.6628.0 (different version notation).
    • CLI actually used by the app: codex-cli 0.167.0-alpha.4.1.
    • PowerShell 7.6.9; legacy elevated sandbox; provisioning service runs as LocalSystem.
    • The CLI's OpenAI Authenticode signature was Valid.
    • On November 13, app/CLI versions were unchanged from November 12 and the configured app updater returned up_to_date. This does not describe every other release channel.

    Actual behavior

    The following error occurs even for a simple ordinary command such as Get-Date. Paths have been redacted:

    Failed to create unified exec process:
    sandbox provisioning failed: helper_sandbox_lock_failed:
    lock sandbox bin dir <CODEX_HOME>\.sandbox-bin failed:
    open directory <CODEX_HOME>\.sandbox-bin:
    NtCreateFile: Access is denied. (os error 5)
    

    The original Windows message is Japanese: "アクセスが拒否されました。"
    At failure, .sandbox/setup_marker.json was zero bytes and setup_error.json contained this error. This is not just an approval-picker display issue.

    Expected behavior

    After successful official provisioning, ordinary sandboxed work and the selected approval mode should remain usable across later startup/provisioning cycles, unless a documented policy change requires user action. If setup fails, the app should expose the reason and a supported recovery route clearly.

    Observed sequence, not a deterministic clean-machine reproduction

    1. Use a previously provisioned legacy elevated sandbox with "Approve for me".
    2. Resume after a PC restart or encounter a condition requiring automatic provisioning.
    3. Observe the approval selection reverting and normal commands failing with the error above.
    4. Run official elevated setup for the actual user and Codex home. Operation resumes, but can fail again later.
      Not every reboot fails. One reboot test passed before the subsequent recurrence. Windows Update or an application update has not been established as the trigger.

    Timeline (JST)

    • Nov 12, 15:04: Earlier recovery checkpoint passed UI persistence, ordinary file operations and a reboot check.
    • Nov 12, 15:26:10: Logs showed network requirements changing from no proxy ports/local binding false to ports 3128 and 8081/local binding true.
    • Nov 12, 15:26:11: Automatic provisioning failed with helper_sandbox_lock_failed. This preceded the later 20:30 PC reboot.
    • Nov 12, 17:51:44: An ordinary setup refresh succeeded; refresh success coexisted with full-provisioning failure.
    • Nov 12, 21:12:21: Official UAC-elevated setup exited 0. Normal reads resumed.
    • Nov 12, 21:18:14: Actual PC reboot, confirmed by OS boot-time change.
    • Nov 12, 21:21–21:22: User confirmed the mode stayed selected; default workspace-write commands successfully created, read and deleted a unique test file.
    • Nov 13, 13:44:51: OS boot time.
    • Nov 13, 13:50:29–31: Logs reported "setup marker missing or incompatible", followed by the same .sandbox-bin access denial. Default commands reproduced the failure.
    • Nov 13, 13:56:42–47: After backup, one official UAC-elevated setup completed with exit 0.
    • Nov 13, 13:57–13:59: Ordinary reads succeeded. User selected "Approve for me" and reported it still selected after an approximately 10-second check.
    • Nov 13, 14:02:52: With the next turn's effective context now workspace-write, ordinary create/read/delete succeeded without require_escalated. Only the unique probe file was deleted.

    Temporary recovery performed

    From an administrator PowerShell process, using the verified app CLI:

    codex sandbox setup --elevated --user <WINDOWS_USER> --codex-home <CODEX_HOME>
    

    On Nov 13, 95 relevant local files were backed up and their SHA256 copies matched before setup. Credentials and conversations were excluded. Setup removed setup_error.json and produced a valid version-5 marker (255 bytes).
    config.toml and project Git metadata hashes stayed unchanged. The .sandbox-bin owner and DACL stayed unchanged; official setup changed the marker's owner/DACL.
    This recovery did not manually edit ACLs, take ownership, disable the sandbox, enable full access, delete/regenerate .sandbox-bin, or replace official binaries. Earlier bin regeneration had not prevented later recurrence. An earlier, separate project-.git ACL error should not be conflated with this bin-lock failure.

    Likely relationship to existing upstream fix — please confirm

    Local ACL inspection on Nov 12 found a user-owned, protected, allow-only .sandbox-bin DACL. SYSTEM had mask 0x1301BF (Modify etc.), without WRITE_DAC; the provisioning service runs as LocalSystem.
    An earlier pinned-source review of the installed CLI tag found the bin-opening path requesting READ_CONTROL | WRITE_DAC while the generated SYSTEM entry lacked WRITE_DAC. This is consistent with the contrast between service provisioning failure and user-elevated setup success. We did not trace the live service's access requests in a debugger.

    This upstream commit's description and diff were rechecked on Nov 13:
    b93a7b1
    Related PR: #59745.
    It addresses SYSTEM permissions and narrowly migrates the expected legacy ACL. Please confirm whether this is the same issue and how the fix reaches the installed desktop update channel. A fixed desktop binary has not been installed/tested on this PC.

    Installed-tag source reviewed previously:
    rust-v0.167.0-alpha.4.1, commit d2c0356
    codex-rs/windows-sandbox-rs/src/setup_provisioning.rs, lines 345–389 and 870–909.

    Requested investigation

    1. Confirm applicability and desktop rollout/backport of Repair legacy Windows sandbox bin permissions for SYSTEM #59745, including migration of existing legacy homes.
    2. Cover repeated provisioning, ordinary refresh, reboot/resume and changes to proxy/local-binding requirements without repeated manual UAC recovery.
    3. Investigate why the marker becomes empty and whether failure-safe/atomic marker updates can preserve valid state.
    4. Show an actionable setup error instead of only reverting the approval selection.

    Evidence boundaries

    Current-session UI persistence and default read/write commands now pass. No additional reboot after the Nov 13 recovery or long-term stability test has been performed. No deterministic clean-VM reproduction, Windows 11/MXC result, or proof of a Windows Update trigger is claimed.
    UI observations are user-reported; command exits, timestamps, hashes and ACL comparisons were inspected separately by the coding agent.
    This is a sanitized summary: no personal usernames, machine names, account SIDs, credentials, private paths, project assets, session transcripts, raw logs or third-party source code are attached. Original local evidence can be reviewed for a narrowly requested, further-redacted excerpt if needed.

    Official references

    https://learn.chatgpt.com/docs/windows/windows-sandbox
    https://learn.chatgpt.com/docs/reference/troubleshooting#feedback-and-logs

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