Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.1023.6621.0
What subscription do you have?
Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Sandbox provisioning fails on every normal (non-elevated) launch:
helper_sandbox_lock_failed: lock sandbox bin dir C:\Users<user>.codex.sandbox-bin failed: SetNamedSecurityInfoW sandbox dir failed: 5
The failed provisioning is NOT rolled back: the whole user profile is left at Low integrity (Mandatory Label\Low Mandatory Level). Because AppData\Local sits inside the profile, every program launched from it inherits Low:
- Desktop shortcuts (.lnk) render as blank white pages — Explorer refuses to extract icons from Low-IL locations. Clearing iconcache_*.db does not help.
- Edge's App-Bound Encryption service ends up stopped and cannot validate against the Low-IL User Data directory, so saved passwords (v20 format) and all session cookies become unreadable — the user appears logged out of everything.
- py.exe (C:\Users<user>\AppData\Local\Programs\Python\Launcher\py.exe) inherits Low, so EVERY
py -3process starts at Low integrity: it cannot create files in Medium-IL temp dirs (E:\Temp → PermissionError [Errno 13]), and cannot launch Medium-IL Edge — webbrowser.open() returns True but nothing opens.
Framing note: Low integrity itself is by design for the sandbox user — I am not arguing the mechanism is wrong. The bug is the SCOPE of the label left behind: the sandbox has no reason for py.exe, Edge User Data, or Explorer's Desktop icon extraction to run at Low.
Verified with before/after controls — restoring only the integrity level to Medium fixes all three symptoms:
| Object | Before (Low) | After (Medium) |
|---|---|---|
| Desktop .lnk icons | all blank white | all restored |
| Edge credentials | unreadable, logged out everywhere | service auto-starts, credentials OK |
| py -3 launched Python | S-1-16-4096, no TEMP, cannot open browser | S-1-16-8192, everything works |
Notably D:\Python\python.exe (outside the profile) stayed Medium the whole time — the same Python version behaved differently depending on which launcher started it, which made this very hard to diagnose.
Environment: Windows 11 Pro 10.0.26200 x64 (zh-CN). Account is the built-in Administrator with a UAC-filtered token (BUILTIN\Administrators shows "Group used for deny only", process IL = Medium).
Related: #27889, #36475 (same SetNamedSecurityInfoW ... 5 on .sandbox-bin), and #55908 (elevated sandbox provisioning SUCCEEDS but the sandbox user still cannot write the workspace — a different failure point).
What steps can reproduce the bug?
- Use a Windows account whose token is UAC-filtered (Administrators = "Group used for deny only"), so Codex Desktop runs at Medium integrity.
- Launch Codex Desktop normally (NOT "Run as administrator") with
[windows] sandbox = "elevated". - Provisioning fails: %USERPROFILE%.codex\setup_error.json is written with
helper_sandbox_lock_failed / SetNamedSecurityInfoW sandbox dir failed: 5 - Inspect the leftover state (this is the actual bug — nothing rolled it back):
icacls %USERPROFILE% → Mandatory Label\Low Mandatory Level
icacls %USERPROFILE%\Desktop → same
icacls "%LOCALAPPDATA%\Programs\Python\Launcher\py.exe" → Low Mandatory Level - Confirm the Python consequence:
py -3 -c "import subprocess;subprocess.run(['whoami','/groups'])"
→ Mandatory Label\Low Mandatory Level S-1-16-4096 - Observe the user-visible damage: Desktop shortcut icons are blank white; Edge is logged out of every site;
py -3cannot write E:\Temp and cannot open a browser. - Repair: icacls /setintegritylevel "(OI)(CI)M" /T /C on the affected paths → all three symptoms disappear.
Note: reproduction does NOT require the sandbox to ever work. The damage happens at the failed-provisioning step, before any sandbox command can run.
What is the expected behavior?
A failed sandbox provisioning should roll back any integrity-level changes it already applied to the user profile.
At minimum it should detect that the profile was left at Low integrity — which silently breaks Explorer icons, browser credentials and Python launchers — and surface an explicit warning plus a repair command.
Right now the failure mode looks like unrelated system corruption, which sends users down a completely wrong diagnostic path (hours of chasing icon caches and browser profiles) before they find the integrity label.
Additional information
No response
Activity
github-actions commentedon Oct 29, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
sdiouci11 commentedon Oct 29, 2026
Not a duplicate. #57617 covers how to make provisioning succeed (ACL/ownership repair on .sandbox-bin). This issue reports what a FAILED provisioning leaves behind: the user profile is left at Low integrity and never rolled back, silently breaking Explorer icons, Edge credentials and Python launchers.
The concrete error also differs: #57617 hits
NtCreateFile: Access is deniedwhile opening the directory, whereas here it isSetNamedSecurityInfoW sandbox dir failed: 5.sdiouci11 commentedon Oct 30, 2026
Thanks, the DACL/SACL distinction is correct and I accept it: DACL_SECURITY_INFORMATION alone cannot write a mandatory label, so lock_sandbox_dir() is not the SACL writer. I've also corrected my framing — what I established is that the profile ends up at Low IL after a failed provisioning and that restoring only the integrity level fixes all three symptoms. I have not established which component wrote the label.
Two questions I'd like answered:
I'm not trying to assign blame to a specific function — I want to know whether the invariant will be enforced, because on a real machine this failure mode is indistinguishable from system corruption.
sdiouci11 commentedon Nov 1, 2026
Correction to the reproduction steps in the original report (posted 2026-11-02).
Two statements above are wrong, and one of them is unsafe to follow. Correcting them here so nobody copies them.
1. Do not use
/Tin the repair command.The original text suggests
icacls /setintegritylevel "(OI)(CI)M" /T /C. Run against the profile, that also flips%LOCALAPPDATA%\LocalLowand everyAppData\Local\Packages\<pkg>\ACdirectory to Medium. Those are legitimately Low (AppContainer / low-rights sandboxes), and raising them breaks browsers and UWP apps.Change the root object only, with this single command:
Inherited labels on children are computed dynamically, so no
/Tand no per-directory pass is needed.2. "Explorer refuses to extract icons from Low-IL locations" is not accurate.
Windows integrity policy only forbids write-up — a lower-integrity subject writing to a higher-integrity object. A Medium-integrity subject reading from a Low-integrity object is permitted. The icon anomaly and the Low label were observed together, but the mechanism is unverified and should not be stated as the cause.
3. Minor:
icacls /save//restorecover DACLs only.A mandatory integrity label lives in the SACL, so those switches cannot snapshot or roll it back. Use a full SDDL snapshot instead, e.g.
(Get-Acl -Path ... -Audit).Sddl.The core observation is unchanged: after a failed provisioning, the profile is left with an explicit, inheritable
Low Mandatory Level:(OI)(CI)(NW)label, and restoring only the root to Medium makes the sandbox, the shell icons and the Python launcher work again — the sandbox recovery in particular is immediate.If it helps triage, I can provide pre/post SDDL snapshots (
GetNamedSecurityInfo, SACL included) taken on a disposable profile across the provisioning boundary.