Windows elevated sandbox setup fails after Codex Desktop 26.609 update/reinstall: SetNamedSecurityInfoW failed: 5 on WindowsApps package directory
What version of the Codex App are you using (From “About Codex” dialog)?
26.609.30741
What subscription do you have?
pro
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What issue are you seeing?
After Codex Desktop appears to have updated/reinstalled from a previously working 26.602.x setup to 26.609.x, Windows elevated Agent sandbox setup no longer works. The setup creates sandbox users and WFP/firewall rules successfully, but fails during the read ACL phase when trying to grant a read ACE on the Codex WindowsApps package app directory.
diagnostics.txt
previous_working_config_summary.txt
sandbox.2026-06-12.log
setup_error.json
What steps can reproduce the bug?
Title:
Windows elevated sandbox setup fails after Codex Desktop 26.609 update/reinstall: SetNamedSecurityInfoW failed: 5 on WindowsApps package directory
Summary:
After Codex Desktop appears to have updated/reinstalled from a previously working 26.602.x setup to 26.609.x, Windows elevated Agent sandbox setup no longer works. The setup creates sandbox users and WFP/firewall rules successfully, but fails during the read ACL phase when trying to grant a read ACE on the Codex WindowsApps package app directory.
Environment:
- OS: Windows
- Current Codex Desktop app version shown in config: 26.609.30741
- Current WindowsApps package path involved in failure:
C:\Program Files\WindowsApps\OpenAI.Codex_26.609.3341.0_x64__2p2nqsd0c76g0\app
- Previous working Codex app version shown in old config: 26.602.71036
- Previous CODEX_HOME:
E:\softwareData\AI\codex
- Current CODEX_HOME:
C:\Users\zzy\.codex
What changed:
Previously elevated Agent sandbox worked normally with a config containing:
[windows]
sandbox = "elevated"
After Codex Desktop appears to have updated/reinstalled, my config was regenerated under C:\Users\zzy\.codex and no longer contains [windows] sandbox = "elevated". Runtime paths also changed from the older AppData\Local\OpenAI\Codex\bin layout to a C:\Program Files\WindowsApps\OpenAI.Codex_... package path.
Current behavior:
Agent sandbox setup fails. The sandbox users and WFP/firewall rules appear to be created successfully, but setup fails during the read ACL phase.
Relevant log:
From C:\Users\zzy\.codex\.sandbox\sandbox.2026-06-12.log:
[2026-06-12T14:30:22.040676400+00:00] read-acl-only mode: applying read ACLs
[2026-06-12T14:30:22.046154700+00:00] granting read ACE to C:\Program Files\WindowsApps\OpenAI.Codex_26.609.3341.0_x64__2p2nqsd0c76g0\app for sandbox users
[2026-06-12T14:30:22.047102100+00:00] grant read ACE failed on C:\Program Files\WindowsApps\OpenAI.Codex_26.609.3341.0_x64__2p2nqsd0c76g0\app for sandbox_group: SetNamedSecurityInfoW failed: 5
[2026-06-12T14:30:22.117232900+00:00] read ACL run completed with errors: ["grant read ACE failed on C:\\Program Files\\WindowsApps\\OpenAI.Codex_26.609.3341.0_x64__2p2nqsd0c76g0\\app for sandbox_group: SetNamedSecurityInfoW failed: 5"]
[2026-06-12T14:30:22.117328600+00:00] setup error: read ACL run had errors
setup_error.json:
{
"code": "helper_unknown_error",
"message": "read ACL run had errors"
}
Additional checks:
icaclson the target app directory shows WindowsApps-style protected ACLs. The directory is protected by SYSTEM/TrustedInstaller/package permissions, andBUILTIN\Administratorsdoes not have write/ACL modification rights on the target directory.whoami /groupsin the current Codex shell showsBUILTIN\AdministratorsasGroup used for deny onlyand the integrity level isMedium, so the current process token is not elevated.
Expected behavior:
Elevated sandbox setup should continue to work after Codex Desktop update/reinstall, or the setup helper should avoid needing to modify ACLs inside the protected WindowsApps package directory. If elevated sandbox requires [windows] sandbox = "elevated", the update should preserve/migrate the setting or surface a clear setup prompt.
Actual behavior:
Sandbox setup fails with helper_unknown_error / read ACL run had errors because SetNamedSecurityInfoW returns Access Denied when trying to grant a read ACE on the Codex WindowsApps package app directory.
Possible regression:
This may be a regression between 26.602.71036 and 26.609.30741, or a regression caused by changing the installation/runtime layout from the previous AppData\Local\OpenAI\Codex\bin paths to the protected WindowsApps package directory.
Attachments included locally:
- current_config_sanitized.toml
- previous_working_config_summary.txt
- sandbox.2026-06-12.log
- setup_error.json
- diagnostics.txt
What is the expected behavior?
After Codex Desktop appears to have updated/reinstalled from a previously working 26.602.x setup to 26.609.x, Windows elevated Agent sandbox setup no longer works. The setup creates sandbox users and WFP/firewall rules successfully, but fails during the read ACL phase when trying to grant a read ACE on the Codex WindowsApps package app directory.
Additional information
diagnostics.txt
previous_working_config_summary.txt
sandbox.2026-06-12.log
setup_error.json
10 Comments
Windows sandbox initialization fails with SetNamedSecurityInfoW ERROR_ACCESS_DENIED (5)
Summary
The Windows sandbox fails during initialization before any local command is executed.
As a consequence, every local action fails:
apply_patchGet-ContentAdd-ContentEnvironment
elevatedSteps to reproduce
test.txtcontaining:apply_patch.Alternatively, execute:
The same failure also occurs with:
Expected behavior
The Windows sandbox initializes successfully.
PowerShell starts normally.
Commands such as:
apply_patchAdd-ContentGet-Contentexecute successfully.
Example:
Actual behavior
No local command is executed.
PowerShell never starts.
The application immediately returns:
The sandbox log consistently reports:
Windows error code 5 corresponds to:
The failure appears to occur while the sandbox helper attempts to grant NTFS write ACL permissions during sandbox initialization.
Investigation already performed
The following checks have already been completed:
config.tomlverifiedsandbox = "elevated"test.txtapply_patchfailsAdd-ContentfailsGet-ContentfailsThe issue always occurs before PowerShell starts.
Comparison with existing issue #27889
My issue appears closely related to #27889 but differs in one important aspect.
Issue #27889 reports:
My issue (version 26.715.2305.0) reports:
Example:
The final error is identical:
This suggests the underlying sandbox ACL initialization problem still exists in the latest release, although it now affects workspace directories instead of the WindowsApps package directory.
Attachments
sandbox.2026-07-17.logconfig_sanitized.tomlAdditional note
The issue was reproduced through multiple controlled tests on different drives and clean workspaces.
sandbox.2026-07-17.log
The problem is fully reproducible and independent of the workspace location.
If additional diagnostics or testing are required, I would be happy to provide them.
I can reproduce the WindowsApps ACL failure on the current Windows Store Codex Desktop package
26.715.2305.0(CLI/helper0.145.0-alpha.18). I also found a second failure mode that makes the documentedunelevatedfallback unusable with least-privilege named permission profiles.Configuration under test: a custom named permission profile with split filesystem permissions (
:minimal = read, workspace/temp = write).[windows] sandbox = "elevated"apply_patchhangs whilecodex-windows-sandbox-setup.exetries to add a read ACE to the protected package resources directory:The setup process can remain active for tens of seconds/minutes, and
apply_patchdoes not return the setup error promptly.[windows] sandbox = "unelevated"Creating a brand-new file can succeed, but a patch that must read/update/delete an existing file fails immediately:
I searched this repository for that exact error and found no existing open issue.
Workaround
Switching back to the legacy configuration:
makes
apply_patchcreate/read/delete complete in under one second and avoidscodex-windows-sandbox-setup, but it restores broad:rootread access. Therefore this is not an equivalent least-privilege fallback.Expected: elevated mode should not need to mutate ACLs inside the protected MSIX/WindowsApps package, or unelevated mode should support/enforce split read/write named permission profiles. At minimum,
apply_patchshould return the setup error instead of hanging.Update – Improved fallback behavior in 26.715.52143 (sandbox issue still present)
I retested the issue after updating both ChatGPT Desktop and Windows.
Environment
---
Summary
The underlying Windows sandbox initialization failure is still present.
However, the behavior has noticeably improved compared to previous builds.
The application can now recover from several operations using fallback mechanisms, although
apply_patchremains unusable.---
Test 1 – Read-only inventory
Request
Perform a read-only inventory of the project.
Result
The sandbox still fails before PowerShell starts:
Instead of aborting completely, Work automatically switches to a read-only fallback and successfully completes the inventory.
Status
---
Test 2 – File creation
Request
Create:
containing:
Result
The verification phase initially reports the same sandbox initialization failure.
A second independent verification is then performed successfully.
The file is correctly created with the expected content.
Status
---
Test 3 – Targeted patch (
apply_patch)Request
Replace:
with
inside
test.txtusing a targeted patch.Result
The patch never starts.
The same error is reported:
The assistant correctly refuses to rewrite the entire file as a fallback.
An independent verification confirms that
test.txtremains unchanged.Status
apply_patch---
Current status
| Feature | Status |
|---------|:------:|
| Windows sandbox initialization | ❌ |
| Read-only fallback | ✅ |
| Simple file creation | ✅ |
| Independent verification | ✅ |
| Targeted patch (
apply_patch) | ❌ |---
Conclusion
This release significantly improves recovery behavior after a sandbox initialization failure.
Compared to previous versions:
However, the underlying Windows sandbox initialization issue remains unresolved, and
apply_patchis still blocked by the same:If helpful, I can also provide updated diagnostics and logs collected with this version.
I have met the same situation. After I chat with gpt😂, I found my computer does not rename, its name is set as default. And I rename my computer. It actucally works. Here is summary from Codex. All private imformation is exchange with common name.
Resolved: Windows sandbox setup failed because of an ambiguous local security authority name
I was able to resolve this issue on my machine. I am sharing the diagnostics and workaround in case they help others with the same combination of errors.
Environment
26.715.10079.0All personal account names, computer names, profile paths, workspace paths, and SID values below have been redacted.
Original symptoms
The elevated sandbox setup partially succeeded:
CodexSandboxOfflineandCodexSandboxOnlinewere created.It then failed while applying read ACLs to the protected Microsoft Store package directory:
setup_error.jsoncontained:There was also a second ACL problem: the normal desktop user could not read:
The parent sandbox directory contained an unusual ACL trustee similar to:
The account name after the backslash was empty. The SID used by that ACE was only the local machine/domain SID prefix, while the actual desktop user SID had an additional RID suffix. In other words, the permission was not granted to the real desktop user.
Important name mismatch
Windows exposed two different machine names on this system:
The old local security name and the user account name were identical when compared case-insensitively. My working theory is that the elevated setup helper resolved the unqualified account name to the local machine/domain SID rather than to the user SID. This would explain the missing user RID and the empty trustee shown by
icacls.This is an observed trigger on my system, not a confirmed upstream root-cause analysis.
What fixed it
After the reboot, the relevant Windows names were consistent and the sandbox account was qualified by the new computer name. Codex then refreshed the sandbox successfully.
The successful log changed to:
Commands now execute as:
setup_error.jsonis no longer present, normal read/write operations work, and the elevated Windows sandbox is active.I did not take ownership of
C:\Program Files\WindowsApps, recursively reset ACLs, or grantdanger-full-access.Optional narrow marker-file repair
If the PC has already been renamed but a stale
setup_marker.jsonis still unreadable, the following community workaround grants read permission to the actual current user SID on that single file. Run it from an elevated PowerShell window:Using the SID avoids another ambiguous account-name lookup. I would not use
takeown /R,icacls /T, or modify the entireWindowsAppstree.Related reports
I hope this gives the maintainers a reproducible clue: when writing the marker ACL, the setup helper should resolve and persist the invoking user's full SID, including the user RID, instead of relying on an ambiguous unqualified account name.
I can reproduce the same issue on the latest Codex Desktop build.
Environment
C:\Program Files\WindowsApps\OpenAI.Codex_26.721.4979.0_x64__2p2nqsd0c76g0Error
The elevated Windows sandbox setup repeatedly fails with:
The Codex Desktop app continues to display “Windows setup incomplete” after selecting “Retry Windows setup” and approving the UAC prompt.
Diagnostics performed
Ok.config.tomlfromunelevatedback toelevated.CodexSandboxOfflineCodexSandboxOnlineThis appears to be the same WindowsApps ACL failure reported here, still reproducible in Codex Desktop 26.721.4979.0 on Windows build 26200.
Please investigate a fix that does not require modifying the protected WindowsApps ACL manually.
Confirmed the workaround on Windows.
The original error was:
windows sandbox: helper_unknown_error: apply deny-read ACLsI closed Codex and renamed:
$HOME\.codex\.sandbox\deny_read_acl_state.jsonAfter reopening Codex, the original thread changed to:
windows sandbox: helper_unknown_error: setup refresh had errorsThat thread remained unable to spawn even a minimal command.
I then created a completely new Codex thread and ran:
cmd.exe /d /c echo codex-sandbox-okThe command completed successfully.
So recovery required both:
deny_read_acl_state.jsonso Codex rebuilds it.This appears consistent with the thread-scoped broker behavior described in #34842.
Renaming the state file instead of deleting it is useful because it preserves the corrupted file for diagnostics.
Still reproducible on Windows 11 Enterprise 25H2. Running
/setup-default-sandboxfailed twice. The setup created the sandbox users and firewall rules, but failed while applying the required permission to the protected WindowsApps directory.After selecting Quit,
%USERPROFILE%\.codex\config.tomlstill contains:No
%USERPROFILE%\.codex\.sandbox\sandbox.logwas created at the checked path.I uploaded the session diagnostics using
/feedback.Session ID:
019ff3d4-39d5-7a13-8891-d84179e29e54I can reproduce the same issue on a clean Windows 10 installation with a newer Codex build.
Environment:
The sandbox infrastructure is created successfully:
However, sandbox refresh still fails during the read-ACL phase.
setup_error.json:
{
"code": "helper_unknown_error",
"message": "read ACL run had errors"
}
Relevant sandbox log:
granting read ACE to C:\Program Files\WindowsApps\OpenAI.Codex_26.810.7004.0_x64__2p2nqsd0c76g0\app for sandbox users
grant read ACE failed on C:\Program Files\WindowsApps\OpenAI.Codex_26.810.7004.0_x64__2p2nqsd0c76g0\app for sandbox_group: SetNamedSecurityInfoW failed: 5
read ACL run completed with errors
setup error: read ACL run had errors
I also verified:
apppath is a normal directory, not a junction/reparse point.deny_read_acl_state.jsoncontains no principals.So this appears to still reproduce in Codex App 26.810.7004.0 on a clean Windows 10 installation.
I can confirm this is still reproducible on a newer Codex Desktop package.
Observed package path in my logs:
C:\Program Files\WindowsApps\OpenAI.Codex_26.818.5229.0_x64__2p2nqsd0c76g0\...With:
Codex Desktop stopped being able to start agent/chat turns.
The sandbox log repeatedly showed:
In the same setup cycle I also got:
Earlier, the same failure had occurred while applying deny-read ACLs to the repository's
.env.One notable side effect was that files/directories touched by the sandbox ended up owned by
CodexSandboxOffline. In particular,.gitwas left owned by the sandbox account, which then triggered Git'sdetected dubious ownershipprotection when Codex Desktop ran as my normal Windows user.Changing ownership of the affected
.env/.gitback to my interactive user fixed those individual filesystem failures, but did not fix the elevated sandbox because the WindowsAppscodex.exeACL operation still failed with error 5.Temporary recovery was:
I also had to stop selecting a custom
default_permissionsprofile that required deny-read restrictions, because the unelevated restricted-token sandbox correctly refused to run when those restrictions were still requested.After that change, new and existing Codex chats started working again. I did not delete or repair any session data.
So this appears to still affect the 26.818 package line and is not limited to the older 26.609 build reported originally.
I can provide sanitized sandbox/Desktop logs if useful.
I found a workaround that restored the elevated Windows sandbox on my PC.
In my original setup, the Windows account name and the computer name
were the same. I did not rename the computer. Instead, I did the
following:
Windows user name and computer name were different.
The sandbox has continued to work under that account after it was
changed back to a standard user. I did not take ownership of, or
manually modify ACLs inside, the WindowsApps package directory.
This is only a workaround, not proof of the root cause. However, it
suggests that either a collision between the Windows user name and
computer name, stale per-user state, or the initial elevated
installation/setup path may be relevant. It may be useful for others
affected by SetNamedSecurityInfoW failed: 5 to test the same sequence.