Skip to content

Windows Desktop 26.721 repeats elevated sandbox setup; marker rewritten but unreadable/rejected #35407

Open

Description

@Penthus

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

OpenAI.Codex package version 26.721.4979.0

Bundled Codex CLI: 0.146.0-alpha.3.1

What subscription do you have?

PLUS

Which model were you using?

GPT-5.6 Sol, medium reasoning.

What platform is your computer?

Windows 11 Core, version 25H2, build 26200.8875, x64.

PowerShell 7.6.4 MSI at C:\Program Files\PowerShell\7\pwsh.exe.

The signed-in Windows user is a member of Administrators; ChatGPT Desktop normally runs at medium integrity under UAC.

What issue are you seeing?

ChatGPT/Codex Desktop repeatedly displays Finish Windows setup to continue and rejects every elevated shell launch, even though the Windows sandbox setup helper reports successful completion.

This looks closely related to #30445. This report confirms the behavior still occurs on Desktop 26.721.4979.0 / CLI 0.146.0-alpha.3.1, and adds a control test showing that the same Codex binary successfully runs the elevated sandbox from an external Administrator terminal.

On each Desktop command:

  1. Codex reports sandbox setup marker missing or incompatible.
  2. The setup helper successfully recreates or refreshes sandbox users, WFP rules, and ACLs.
  3. The helper reports setup binary completed.
  4. The marker file's modification time advances.
  5. The next Desktop command immediately rejects the resulting marker and repeats setup.

After the final reproduction, the marker was rewritten at 2026-07-26 07:18:30 +08:00, but the normal signed-in user could not read %USERPROFILE%\.codex\.sandbox\setup_marker.json:

Access to the path '%USERPROFILE%\.codex\.sandbox\setup_marker.json' is denied.

That strongly supports the marker ACL diagnosis in #30445. I have not manually changed the marker ACL so that the failing state remains available for diagnosis.

The user has experienced elevated-sandbox failures for several months across Codex versions.

Relevant configuration

The final reproduction used:

approval_policy = "on-request"
default_permissions = "trusted-development"

[features.network_proxy]
enabled = false

[permissions.trusted-development]
extends = ":workspace"

[permissions.trusted-development.network]
enabled = true
mode = "limited"
allow_local_binding = false

[windows]
sandbox = "elevated"

The experimental network proxy was explicitly disabled before the final reproduction.

What steps can reproduce the bug?

  1. Set [windows] sandbox = "elevated" in the global config.toml.

  2. Keep [features.network_proxy] enabled = false.

  3. Fully quit and reopen ChatGPT Desktop.

  4. Create a new task using the trusted-development permission profile.

  5. Ask it to run:

    whoami
    $PSVersionTable.PSVersion
    (Get-Process -Id $PID).Path
  6. Observe Finish Windows setup to continue.

  7. Retry the command.

  8. Observe the same setup flow again, even though the helper log says setup completed.

What is the expected behavior?

The setup helper should run once, create a marker readable by the normal Desktop process, and then launch the command under an elevated sandbox identity such as:

<machine>\codexsandboxonline

What actually happens?

Desktop loops through setup. A fallback shell can sometimes run under the host identity:

<machine>\<user>

but the Desktop elevated sandbox does not start.

Key log evidence

Sanitized excerpt from %USERPROFILE%\.codex\.sandbox\sandbox.2026-07-25.log:

[2026-07-26 07:17:40.767 codex.exe] sandbox setup required: sandbox setup marker missing or incompatible
[2026-07-25T23:17:41.635015100+00:00] WFP setup succeeded for CodexSandboxOffline with 12 installed filters
[2026-07-26 07:17:41.893 codex-windows-sandbox-setup.exe] setup binary completed

[2026-07-26 07:17:46.598 codex.exe] sandbox setup required: sandbox setup marker missing or incompatible
[2026-07-25T23:17:47.321089200+00:00] WFP setup succeeded for CodexSandboxOffline with 12 installed filters
[2026-07-26 07:17:47.549 codex-windows-sandbox-setup.exe] setup binary completed

[2026-07-26 07:17:53.841 codex.exe] sandbox setup required: sandbox setup marker missing or incompatible
[2026-07-25T23:17:54.592460700+00:00] WFP setup succeeded for CodexSandboxOffline with 12 installed filters
[2026-07-26 07:17:54.838 codex-windows-sandbox-setup.exe] setup binary completed

External control test

A diagnostic launched from an external Administrator terminal used the same Codex binary and explicit configuration overrides.

===== unelevated sandbox probe =====
EXIT CODE: 0
<machine>\<user>

===== elevated sandbox probe =====
EXIT CODE: 0
<machine>\codexsandboxonline

The elevated control also logged:

setup refresh: processed 2 write roots (read roots delegated); errors=[]
setup binary completed

This shows that the sandbox users, WFP configuration, command runner, and elevated command execution can work when launched externally. The failure appears specific to Desktop reading/accepting the marker after its UAC-approved setup flow.

Troubleshooting already completed

  • Repaired the Windows app.
  • Recreated .sandbox and .sandbox-bin.
  • Verified sandbox users exist and are enabled.
  • Verified WFP/filter creation succeeds.
  • Verified the setup helper and CLI binaries are intact.
  • Verified chat/session SQLite databases are healthy and unrelated.
  • Installed native PowerShell 7 MSI to eliminate a separate WindowsApps pwsh.exe alias launch denial.
  • Disabled the experimental network proxy.
  • Confirmed Desktop shell execution works when [windows] sandbox = "unelevated".
  • Confirmed the elevated sandbox works from an external Administrator terminal.

Workaround

The reliable workaround is:

[features.network_proxy]
enabled = false

[windows]
sandbox = "unelevated"

Related issues

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    windows-osIssues related to Codex on Windows systems
    sandboxIssues related to permissions or sandboxing
    on Jul 25, 2026
  2. github-actions commented on Jul 25, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. personalsovereignty888-hash commented on Jul 28, 2026

    @personalsovereignty888-hash

    Another affected Windows user here. The app was working normally before, then suddenly started showing Finish Windows setup / Windows setup didn't finish.

    Observed behavior:

    1. Launch ChatGPT/Codex Desktop.
    2. Click Try Windows setup again.
    3. Approve the genuine OpenAI LLC UAC prompt.
    4. The app immediately returns to Windows setup didn't finish.

    Troubleshooting already tried with no effect:

    • Renamed/reset %USERPROFILE%\.codex\config.toml.
    • Fully quit the app and retried as administrator.
    • Moved the entire %USERPROFILE%\.codex directory aside so the app could recreate a clean state.
    • Repeated the UAC-approved Windows setup flow.

    The same failure persists even with a fresh .codex directory, so this does not appear to be caused only by a corrupt config or stale sandbox state. The user reports that the desktop app was previously working normally and then failed suddenly, likely after an automatic app update.

    The only available older sandbox log is from a previously working session and shows setup binary completed, errors=[], and successful PowerShell commands. The current failed setup flow does not appear to append a useful new error to that old log.

    Environment:

    • ChatGPT Plus
    • Windows x64
    • Chinese UI locale
    • Previously working package shown in old logs: OpenAI.Codex_26.513.4821.0
    • Current package version not yet confirmed

    This looks consistent with the Desktop setup-marker/setup-state loop described in this issue, except that resetting the entire .codex directory also did not recover the app.

  4. richiejacob commented on Jul 31, 2026

    @richiejacob

    Additional reproduction on a newer 26.721 build — marker is readable and ACLs are correct

    I am seeing a closely related repeated-UAC/setup loop with a newer package, but in this reproduction the marker is readable and its ACL is not the problem.

    Environment

    • OpenAI.Codex package: 26.721.11231.0
    • Bundled/staged CLI: codex-cli 0.146.0-alpha.3.1
    • Windows x64
    • Invocation context: fresh nested Codex reviewer/worker processes launched by a local automation controller. The controller stages the signed binaries from the installed Windows package under %LOCALAPPDATA%\ai-peer-review-harness\codex-runtime\<digest>.
    • The UAC dialog identifies the genuine signed codex-windows-sandbox-setup.exe from that staged runtime.

    Marker and account state

    Both sandbox accounts exist and are enabled:

    CodexSandboxOffline  Enabled=True
    CodexSandboxOnline   Enabled=True
    

    %USERPROFILE%\.codex\.sandbox\setup_marker.json is readable by the normal user, and the file ACL grants that user FullControl:

    {
      "version": 5,
      "offline_username": "CodexSandboxOffline",
      "online_username": "CodexSandboxOnline",
      "proxy_ports": [],
      "allow_local_binding": false,
      "read_roots": [],
      "write_roots": []
    }
    NT AUTHORITY\SYSTEM     FullControl
    BUILTIN\Administrators FullControl
    <normal user>           FullControl
    

    So this reproduction is not explained by the marker-read ACL failure described in the original report.

    Installed and staged binaries are identical

    The controller-staged files are byte-identical to the current installed package files:

    codex.exe SHA-256
    39E9E041EA33AC34AAD9578ADFE660C5C7A6DC8F82620B77623960F9352A6EF3
    
    codex-windows-sandbox-setup.exe SHA-256
    400CF60D47A8F865E33E43815ECADF3369FE71C4AB830C712AA9E949D6B06AE1
    

    This rules out a stale staged runtime or mismatched setup helper in this case.

    Repeated behavior

    For the same staged runtime and the same canary worktree, ordinary Git commands repeatedly trigger the setup helper within seconds:

    setup refresh: spawning ...\codex-windows-sandbox-setup.exe
    setup refresh: processed 2 write roots (read roots delegated); errors=[]
    setup binary completed
    
    sandbox setup required: sandbox users missing or incompatible with marker version
    
    setup refresh: spawning ...\codex-windows-sandbox-setup.exe
    setup refresh: processed 2 write roots (read roots delegated); errors=[]
    setup binary completed
    

    The helper is then invoked again for subsequent commands in the same workspace, producing repeated UAC prompts. The log also repeatedly contains:

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

    That warning may be secondary, because the setup refresh is requested before it appears.

    An additional notable detail is that the helper reports processing two write roots, while the marker read afterward still contains empty read_roots and write_roots arrays.

    Operational impact

    This prevents unattended nested reviewer/worker execution: approving the genuine OpenAI UAC prompt does not terminate the setup cycle, and multiple fresh agents can create a prompt storm. We are now failing the affected backend closed as manual_action_required rather than retrying or falling back to unsandboxed execution.

    This appears to extend the issue in two ways:

    1. It still occurs on package 26.721.11231.0 with CLI 0.146.0-alpha.3.1.
    2. It can occur even when the marker is readable, the ACL is correct, both users exist, and the staged/installed binaries match exactly.

    I can provide a longer sanitized log excerpt or open a separate issue for the nested-CLI/controller invocation path if that would be more useful.

  5. topgravy commented on Aug 16, 2026

    @topgravy

    I reproduced this on Codex 26.810.7004.0 and found an ACL issue with setup_marker.json.

    The sandbox helper successfully created %USERPROFILE%.codex.sandbox\setup_marker.json and both CodexSandboxOffline / CodexSandboxOnline local users, but the normal Codex process received Access denied when reading the marker. The marker contents were valid (version: 5, correct sandbox usernames, etc.).

    Granting the interactive Windows user explicit Full Control on the existing marker with:

    icacls "%USERPROFILE%.codex.sandbox\setup_marker.json" /grant "USERNAME:F"

    immediately fixed the problem and Codex completed setup normally.

    This suggests the helper is successfully creating the sandbox but applying an ACL to setup_marker.json that prevents the non-elevated Codex process from reading/validating it. Worth investigating the marker security descriptor/interactive-user SID handling.

  6. 4sj9wrhgbp commented on Aug 29, 2026

    @4sj9wrhgbp

    Adding fresh evidence from Desktop 26.825.4187.0 on Windows 11 (CLI side: 0.150.1, npm install):

    • sandbox.2026-08-29.log shows the setup loop in two distinct waves: 10× sandbox setup marker missing or incompatible between 16:34:34-16:38:21, then 14× more between 17:46:02-17:52:53 (local time). Each cycle logs WFP setup succeeded ... 12 installed filters → setup binary completed → next check still reports the marker missing/incompatible.
    • New artifact in %USERPROFILE%\.codex\.sandbox\: deny_read_acl_state.json (first observed on this machine 2026-08-29, {"principals":{}}). A non-elevated process now gets Permission denied reading setup_marker.json. With deny-read ACEs in play, the classic "grant the user (R)" workaround stops working (deny wins over allow).
    • Notably, the loop also fired while the config already said [windows] sandbox = "unelevated" — same behavior as described in Windows Desktop: unelevated sandbox still repeatedly launches elevated setup helper #23712.
    • The elevated value appeared in config.toml written by the Desktop app itself (it mirrors its internally-remembered sandbox mode on launch); deleting the key while Desktop is running gets rewritten. Recovery that worked: fully quit Desktop → set [windows] sandbox = "unelevated" → relaunch. Since 17:52 the log shows zero further setup-required lines, and TEMP write probes inside the sandbox succeed again.
    • Impact beyond the nag dialog: during the loop window, sandboxed test runs inside Codex misreported ~20 failures (no usable temp dir); the same tests pass 288/288 when run locally after the workaround.

    Hope the timeline + the new deny-read state file helps pin down the marker reconciliation logic.

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

    appIssues related to the Codex desktop appbugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions