Skip to content

Windows Sandbox setup fails with helper_sandbox_lock_failed / SetNamedSecurityInfoW failed: 5 #45734

Open

Description

@MaloyAtlet

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

26.908.9136.0

What subscription do you have?

ChatGPT Go

What platform is your computer?

Windows NT 10.0.22621.0 x64

What issue are you seeing?

When I try to finish Windows setup in the Codex desktop app, I approve the UAC prompt, but the setup fails with helper_failed.

The sandbox setup error is:

helper_sandbox_lock_failed
lock sandbox bin dir <USER_PROFILE>\.codex\.sandbox-bin failed:
SetNamedSecurityInfoW sandbox dir failed: 5

<img width="1082" height="750" alt="Image" src="https://github.com/user-attachments/assets/9f03f220-80bc-4fea-a187-b52e5e545cf0" />

### What steps can reproduce the bug?

1. Install and launch the Codex desktop app on Windows 11.
2. Open the Windows setup / sandbox setup prompt.
3. Click "Yes" on the UAC prompt.
4. Wait for the setup process to complete.
5. The setup fails with `helper_failed`.
6. The Codex sandbox log reports:

text:
helper_sandbox_lock_failed
SetNamedSecurityInfoW sandbox dir failed: 5

### What is the expected behavior?

I expect the Windows setup to complete successfully after approving the UAC prompt.
The Codex Windows sandbox should be configured successfully without returning `helper_failed` or `SetNamedSecurityInfoW ... failed: 5`.

### Additional information

Installed Codex CLI:

0.154.0-alpha.6.2
windows-x86_64

Codex Desktop:

26.908.9136.0

The installed package is:

OpenAI.Codex_26.908.9136.0_x64__2p2nqsd0c76g0

The helper has a valid Authenticode signature from:

OpenAI OpCo, LLC
Windows environment
Windows 11 Pro
Version 22H2
OS Build 22621.6060
64-bit
OS language: ru-RU

Codex Doctor reports:

Windows 10.0.22621 (Windows 11 Professional) [64-bit]
Sandbox directory ACL

The affected directory is:

C:\Users\<user>\.codex\.sandbox-bin

Current ACLs are:

NT AUTHORITY\SYSTEM        Modify
BUILTIN\Administrators     Modify
<user>                     Modify
CodexSandboxUsers          ReadAndExecute

icacls confirms:

CodexSandboxUsers:(OI)(CI)(RX)
SYSTEM:(OI)(CI)(M)
Administrators:(OI)(CI)(M)
<user>:(OI)(CI)(M)

The directory is a normal directory and does not have an unusual reparse/link type.

Sandbox accounts

The expected Codex sandbox accounts are present:

CodexSandboxOffline
CodexSandboxOnline

Both accounts are enabled and belong to:

CodexSandboxUsers
Manual security descriptor test

The following operation was successfully executed from an elevated Administrator PowerShell:

$path = "$env:USERPROFILE\.codex\.sandbox-bin"
$acl = Get-Acl $path
$acl.SetSecurityDescriptorSddlForm($acl.Sddl)
Set-Acl -Path $path -AclObject $acl

The command completed without an error.

This demonstrates that an elevated Administrator process can modify the security descriptor of .sandbox-bin.

SeSecurityPrivilege

The elevated PowerShell token contains:

SeSecurityPrivilege

but its current state is:

Отключен

The privilege is assigned to the built-in Administrators group according to the local security policy.

Therefore, the privilege exists on the system, but it is not enabled by default in the current process token.

Defender investigation

Current Microsoft Defender exclusions are:

C:\Users\<user>\Desktop\memesense
C:\Users\<user>\Downloads

There are currently no Codex-specific exclusions.

A search of Defender threat detections for:

Codex
codex-windows-sandbox-setup

returned no results.

A search of the Microsoft Defender Operational event log for the last two hours for:

Codex
sandbox-setup
codex-windows
Access Denied
blocked
Controlled Folder

also returned no results.

Therefore, there is currently no direct evidence that Microsoft Defender is blocking the Codex sandbox helper.

Helper execution tests

The packaged helper exists and is correctly signed, but direct execution of the packaged helper from the WindowsApps installation directory results in:

Access Denied

The locally installed helper can start successfully and reports:

helper_request_args_failed: expected payload argument

This indicates that the local helper executable itself is capable of launching and is expecting its normal setup payload.

Codex Doctor

codex doctor reports:

Security:
Microsoft Defender can interfere with Codex. Verify Codex exclusions.

However, this is a diagnostic warning and there is no corresponding Defender detection or blocking event.

Other diagnostics are healthy:

Disk space: OK
Configuration: OK
Authentication: OK
Network connectivity: OK
State databases: OK
Desktop installation: OK

Codex Doctor reports the configured sandbox mode as:

restricted fs + restricted network
approval OnRequest

but also reports:

sandbox backend = disabled
Configuration

The Codex configuration file is successfully parsed:

C:\Users\<user>\.codex\config.toml

No [windows] sandbox = ... override was found in the inspected configuration.

Workspace

The problem is not limited to a particular project. The sandbox provisioning failure occurs at the Codex sandbox directory level:

C:\Users\<user>\.codex\.sandbox-bin

Therefore, the failure occurs before normal project-specific sandbox operation.

Troubleshooting already performed

The following actions have already been tested:

Windows reboot
Elevated PowerShell
Verification of .sandbox-bin ACLs
Manual Set-Acl security descriptor test
Verification of CodexSandboxOffline
Verification of CodexSandboxOnline
Verification of CodexSandboxUsers
Verification of the packaged helper
Authenticode signature verification
Direct helper execution test
Local helper execution test
Microsoft Defender threat detection search
Microsoft Defender Operational event log search
Codex Doctor diagnostics
Configuration parsing verification
Network/authentication checks

No manual takeown operation was performed.

.sandbox-bin was not deleted.

The Codex sandbox accounts were not manually deleted or recreated.

No broad Windows security permissions were manually granted.

Current conclusion

The system already has the expected Codex sandbox accounts and ACL entries, and an elevated Administrator can manually modify the .sandbox-bin security descriptor.

However, the official Codex sandbox setup helper fails when performing its own security descriptor operation:

SetNamedSecurityInfoW sandbox dir failed: 5

There is currently no evidence of a Microsoft Defender detection or explicit Defender block.

The failure therefore appears to be specifically related to the Codex Windows sandbox helper's security-descriptor operation, potentially involving Windows privilege handling, rather than a simple missing NTFS permission.

Further investigation of the Codex Windows sandbox helper is required.

Короткая суть для разработчиков Codex:

The Windows Codex sandbox provisioning helper consistently fails with helper_sandbox_lock_failed / SetNamedSecurityInfoW ... failed: 5 when locking .codex\.sandbox-bin. The expected sandbox accounts and ACLs already exist, and an elevated Administrator can successfully modify the directory security descriptor manually. No Defender detection or blocking event was found. This appears to be a helper-level Windows security descriptor/privilege handling_

Activity

  1. added
    app
    on Sep 15, 2026
  2. added
    bug
    windows-os
    sandbox
    on Sep 15, 2026
  3. formacionpersonalcom-creator commented on Sep 16, 2026

    @formacionpersonalcom-creator

    Same error here, on Windows 10, and renaming .sandbox-bin fixed it for me.

    Environment

    • Windows 10 22H2, OS build 19045.6456 (x64)
    • Account is a local Administrator, UAC at default level

    Symptom
    Clicking "Continue" on the Windows setup banner showed no UAC prompt and failed after a few seconds with "Windows setup didn't finish". Every attempt logged:

    setup error: helper_sandbox_lock_failed: lock sandbox bin dir C:\Users\<user>\.codex\.sandbox-bin failed: SetNamedSecurityInfoW sandbox dir failed: 5
    setup refresh: exited with status ExitStatus(ExitStatus(1))
    

    setup_marker.json already existed from an earlier run, and deny_read_acl_state.json was valid (22 bytes).

    Workaround
    With the app fully closed:

    Rename-Item "$env:USERPROFILE\.codex\.sandbox-bin" ".sandbox-bin.bak"

    Then I opened the app and clicked Continue. The window went black, the app restarted, and the banner was gone. The log then showed:

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

    setup_error.json was removed, and a sandboxed task (creating a file in a test project folder) worked.

    I don't know the root cause. It looks like the helper fails to re-lock an existing .sandbox-bin but succeeds when it creates the directory from scratch.

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