Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.915.3509.0
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Codex Feedback Session ID: 01a0b2b4-8970-7c40-9bce-1afa23215a09
Summary
Codex Windows elevated sandbox setup failed after an application upgrade because re-provisioning attempted to modify an existing .sandbox-bin directory whose ACL had previously been locked by Codex itself.
The failure was:
helper_sandbox_lock_failed
SetNamedSecurityInfoW sandbox dir failed: 5
Windows error 5 = Access Denied.
After investigation and remediation, I confirmed that this is not a general failure of using Codex from a standard Windows user account with UAC elevation through a separate Administrator account.
The same standard-user / separate-administrator security model works correctly when the sandbox generated state starts clean.
The issue appears to be an upgrade/reconfiguration idempotency problem against previously locked generated sandbox ACL state.
Environment
- Codex App version:
26.915.3509.0 - Windows 11 x64
- Windows build:
26200 - Interactive Windows account: standard user
- Separate local Administrator account used for UAC credential elevation
- Codex configuration:
[windows] sandbox = "elevated"
The interactive user remains a standard user and is not a member of BUILTIN\Administrators.
Initial failure
After the Codex upgrade, sandbox setup was triggered again because the previous setup marker was reported as missing or incompatible.
The elevated setup proceeded partially successfully:
- sandbox accounts were created;
- WFP / firewall setup succeeded;
- approximately 12 filters were created;
- UAC administrative elevation therefore completed successfully.
Setup then failed while attempting to secure the existing .sandbox-bin directory:
helper_sandbox_lock_failed
SetNamedSecurityInfoW sandbox dir failed: 5
The affected generated directory was:
C:\Users\<USER>\.codex\.sandbox-bin
At the time of failure, its relevant security state was:
- owner: interactive standard user;
- inheritance: disabled / protected;
- interactive standard user could modify the ACL;
BUILTIN\AdministratorshadModify, Synchronize;BUILTIN\Administratorsdid not haveChangePermissions / WRITE_DAC.
Because UAC elevation was performed using a separate Administrator account, the elevated helper did not have sufficient permission to rewrite the DACL of this already-locked directory.
No Windows error 1385 was observed, so this did not appear to be a sandbox-account logon-right issue.
Investigation result
The original hypothesis was that Windows standard-user → separate-administrator credential elevation itself might be incompatible with the elevated sandbox setup.
That hypothesis was disproved.
I performed a clean-state remediation without changing the long-term Windows account security model and without manually patching the sandbox ACL.
Remediation procedure
- Fully stopped Codex.
- Preserved the existing sandbox evidence.
- Renamed the existing generated directory to:
.sandbox-bin.pre-20260918
- Did not perform a broad ACL reset.
- Did not change directory ownership.
- Did not grant
Full Control. - Did not add the standard user to
Administrators. - Did not access or modify
.sandbox-secrets. - Created a fresh empty
.sandbox-bindirectory with normal initial ACL inheritance. - Reran elevated sandbox setup using the same:
- standard interactive user;
- separate Administrator account for UAC elevation.
The setup then completed successfully.
Successful post-remediation state
The repaired environment now passes elevated sandbox setup.
Observed result:
- setup marker v5 created successfully;
- provisioning binary completed;
- WFP setup completed successfully;
- final WFP state contains 12 filters;
- subsequent setup refreshes report
errors=[]; - no new
SetNamedSecurityInfoW ... error 5; - no new
helper_sandbox_lock_failed; - sandbox service runs normally;
- one Offline and one Online sandbox account are present;
- temporary setup scheduled tasks cleaned themselves up successfully;
- Codex App works normally after restart;
- sandbox commands run successfully as
CodexSandboxOffline; - workspace reading works;
- workspace ACL grants
CodexSandboxUsersModify.
The interactive user still remains a standard Windows user.
No manual ACL patch was required.
Key root-cause observation
After successful clean provisioning, Codex once again locks the newly generated .sandbox-bin directory into essentially the same ACL state:
- owner: interactive standard user;
- inheritance: disabled / protected;
BUILTIN\Administrators:Modify, Synchronize;- no
ChangePermissions / WRITE_DAC.
This means a successful setup recreates the ACL condition that caused the next upgrade-time re-provisioning to fail.
This strongly suggests the underlying problem is:
Codex Windows sandbox upgrade/re-provisioning is not idempotent against generated sandbox state previously locked by Codex itself.
A later version or setup-marker migration may attempt to provision the existing directory again, but the elevated helper running under a separate Administrator account can no longer rewrite its security descriptor because WRITE_DAC is absent.
The resulting failure is then:
helper_sandbox_lock_failed
SetNamedSecurityInfoW sandbox dir failed: 5
Additional recovery behavior observed
There was another relevant behavior during remediation.
Renaming the old .sandbox-bin was not sufficient by itself.
When .sandbox-bin was completely absent, the current Codex version first failed while attempting to open the missing directory.
Codex did not automatically recreate it.
Creating a new empty .sandbox-bin directory allowed provisioning to proceed successfully.
So the recovery/re-provisioning path appears to make two conflicting assumptions:
.sandbox-binalready exists;- the elevated helper can modify its security descriptor.
This makes recovery from stale or incompatible generated sandbox state fragile.
Expected behavior
When an upgrade or setup-marker migration requires Windows sandbox re-provisioning, Codex should safely handle generated state created by an older Codex version.
Ideally the setup process should be idempotent and support at least one of the following:
- detect that the existing generated ACL is incompatible and safely recreate the generated directory;
- temporarily obtain or arrange the ACL rights required for re-provisioning;
- recreate generated sandbox state rather than attempting to mutate an ACL it previously locked;
- automatically create
.sandbox-binwhen it is missing; - provide an explicit recovery action instead of leaving setup partially provisioned.
A standard Windows configuration where:
- the developer uses a standard account; and
- administrative operations are approved using a separate Administrator account
should remain supported across Codex upgrades.
This account model works correctly after clean provisioning.
Actual behavior
Upgrade-triggered re-provisioning against the existing Codex-generated sandbox state failed with Access Denied.
The setup had already created privileged sandbox resources and WFP rules before failing at the directory security stage.
A manual clean generated-state rebuild was required to recover.
Current assessment
Root cause classification:
Upgrade stale / non-idempotent generated ACL state
Not:
General incompatibility with standard-user → separate-administrator UAC elevation
The relevant sequence appears to be:
successful Codex sandbox setup
→ Codex locks .sandbox-bin
→ Administrators no longer have WRITE_DAC
→ later Codex upgrade requires re-provisioning
→ elevated helper attempts to modify the existing DACL
→ SetNamedSecurityInfoW returns error 5
→ elevated sandbox setup fails.
Remaining risk
The environment is currently fully operational, but the final successful setup has again removed WRITE_DAC from BUILTIN\Administrators.
Therefore a future Codex upgrade that requires another provisioning pass against the existing locked .sandbox-bin may reproduce the same failure.
No further local workaround is currently required, but the generated-state lifecycle appears capable of recreating the precondition for this bug.
Diagnostic evidence
I am attaching a sanitized sandbox log corresponding to the failed setup attempt.
The attachment has been sanitized as follows:
- Windows username redacted;
- machine name redacted;
- local user paths redacted;
- sandbox/local SID redacted;
- diagnostic event ordering preserved;
- sandbox setup events preserved.
The available sanitized log did not itself contain the Codex version or Windows build, so those values are provided explicitly in this report.
setup_error.json was observed during the failure but is transient and was removed by the Codex sandbox setup lifecycle before the sanitized submission package was generated.
The historical error recorded in that file was:
helper_sandbox_lock_failed
SetNamedSecurityInfoW sandbox dir failed: 5
I did not recreate or fabricate the missing file.
.sandbox-secrets was not accessed, read, modified, or attached.
Attached file
sandbox-36f753f1b0bc1d09.sanitized.log
Additional remediation evidence has been preserved locally and can be provided if required.
What steps can reproduce the bug?
-
Use Codex App on Windows from a standard Windows user account.
-
Configure:
[windows] sandbox = "elevated" -
Approve UAC elevation using credentials for a separate local Administrator account.
-
Successfully complete elevated sandbox provisioning once.
-
After provisioning,
.sandbox-binis left with:- owner = standard interactive user
- inheritance disabled/protected
BUILTIN\Administrators=Modify, Synchronize- no
WRITE_DAC / Change permissions
-
Upgrade Codex, or otherwise trigger sandbox re-provisioning because the setup marker is missing/incompatible.
-
Allow elevated setup to run again using the same Administrator account.
-
Sandbox account / WFP setup proceeds, but setup fails while securing the existing
.sandbox-binwith:helper_sandbox_lock_failed
SetNamedSecurityInfoW sandbox dir failed: 5
Recovery observation:
- Renaming the old
.sandbox-binand creating a fresh empty.sandbox-binallows provisioning to succeed. - No manual ACL patch, ownership change, or administrator-membership change is required.
What is the expected behavior?
Sandbox re-provisioning after a Codex upgrade should be idempotent against sandbox state created and locked by a previous successful Codex setup.
If the existing generated .sandbox-bin ACL is incompatible with re-provisioning, Codex should safely recreate or migrate that generated state rather than failing with Access Denied.
The setup path should also recreate .sandbox-bin automatically if the generated directory is missing.
Additional information
Codex Feedback Session ID:
01a0b2b4-8970-7c40-9bce-1afa23215a09
Clean-state remediation result:
- PASS
- interactive account remained a standard user
- sandbox mode remained
elevated - no broad ACL reset
- no ownership change
- no manual ACL patch
- no addition of the user to
Administrators
After clean provisioning, Codex again leaves .sandbox-bin protected with BUILTIN\Administrators lacking WRITE_DAC, so a future upgrade requiring re-provisioning may recreate the same failure condition.
I have a sanitized failure log:
sandbox-36f753f1b0bc1d09.sanitized.log
The log has Windows username, machine name, local paths, and SID values redacted. .sandbox-secrets was not accessed or included.
setup_error.json was transient and disappeared before the sanitized submission package was generated.
Activity
github-actions commentedon Sep 18, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Yuhanbravo commentedon Sep 18, 2026
Possibly related to #45734 and #40550.
#45734 reports the same
helper_sandbox_lock_failed / SetNamedSecurityInfoW ... failed: 5failure on.sandbox-bin.My additional finding is that a clean generated-state rebuild succeeds
under the same standard-user / separate-administrator elevation model,
but successful provisioning recreates a protected
.sandbox-binACLwithout
WRITE_DACfor Administrators. This suggests anupgrade/re-provisioning idempotency issue rather than a general
alternate-credential elevation failure.
Yuhanbravo commentedon Sep 18, 2026
After reviewing the related reports, #45153 and #36475 appear especially relevant.
#45153 contains a useful minimum-rights reproduction:
adding only
WRITE_DAC / ChangePermissionsto.sandbox-binallowssandbox initialization to succeed, after which Codex rewrites the ACL
and removes
WRITE_DAC; the next initialization then fails again withSetNamedSecurityInfoW ... error 5.#36475 documents the same failure in the CLI refresh path and discusses
an idempotency / ownership-lifecycle issue. It also contains reproductions
under different token/creation paths where a fresh
.sandbox-bincanstill fail.
So I would narrow my report as follows:
re-provisioning encountered previously locked generated
.sandbox-binstate.
of
helper_sandbox_lock_failed..sandbox-binACL/ownership/WRITE_DAC lifecycle and non-idempotency between
provisioning and subsequent refreshes.
My clean-state A/B result still confirms that standard-user →
separate-administrator credential elevation itself works in this
environment and is not the general failure condition.
cilantro7 commentedon Sep 30, 2026
0.159.0 的补充复现证据与候选修复建议
目标问题:#46380
用户名、机器名、个人 SID、工作项目、完整本机路径和聊天标识均未包含在材料中。未使用包含项目名称的原始截图。
新增复现证据
本机在 Codex CLI 0.158.0-alpha.2.1 中遇到 Windows elevated 沙盒安装失败。临时补充 .sandbox-bin 对 SYSTEM 和 Administrators 的 WRITE_DAC 后,官方安装流程成功;命令实际以 CodexSandboxOffline 执行。
升级至 Codex CLI 0.159.0 后,于 2026-09-30 09:24(UTC+08:00)再次出现相同失败。已观察到的桌面包版本为 26.928.1915.0,来自沙盒服务可执行文件所在的包路径;没有从“关于 Codex”窗口独立核实桌面版本。
Windows 11 x64,内部版本 26200。当前临时使用 [windows] sandbox = "unelevated" 恢复使用。
实际日志(脱敏摘录)
以下保留真实事件顺序,但去掉机器信息和无关详情:
setup_error.json 中记录:
{ "code": "helper_sandbox_lock_failed", "message": "lock sandbox bin dir <CODEX_HOME>/.sandbox-bin failed: open directory <CODEX_HOME>/.sandbox-bin" }最新记录没有保留底层 Windows 错误码,因此本次不声称日志已直接证明错误码为 5。
失败时的权限状态
目录禁止权限继承。SYSTEM 和 Administrators 均没有 ChangePermissions / WRITE_DAC。
沙盒服务以 LocalSystem 身份运行。调查时 CodexSandboxOffline 和 CodexSandboxOnline 均已启用。
对 0.159.0 源码的核对
源码版本:https://github.com/openai/codex/blob/rust-v0.159.0/codex-rs/windows-sandbox-rs/src/setup_provisioning.rs
lock_sandbox_dir 在 ProvisionOnly 模式下打开目录时请求:
但为 SYSTEM 和 Administrators 生成的访问掩码为:
该访问掩码不包含 WRITE_DAC。
SetEntriesInAclW 的原权限表参数为 null,随后新表被写入目录。日常刷新也调用 lock_sandbox_bin_dir。因此,手动追加的 WRITE_DAC 会在之后的刷新中被覆盖;更新后再次触发安装时,服务无法打开先前已由 Codex 限制权限的目录。
这是日志、当前权限和代码共同支持的根因判断。未在本次报告准备过程中再次修改系统权限或重新触发失败。
最小修复建议
下方附上用于讨论的候选补丁,基于 0.159.0。
它仅在 DaclInheritance::Protected 情况下,为 SYSTEM 和 Administrators 增加 WRITE_DAC。已核对当前源码,调用 lock_sandbox_dir 时传入 Protected 的位置仅对应 .sandbox-bin。
现有交互用户权限、沙盒用户组权限以及其他目录的权限保持不变。
该补丁只处理“正确权限被后续刷新删除”的复发问题,不包含旧安装状态的迁移,也不能单独作为完整修复发布。具体 API 和实现仍应由维护者评估。
旧安装状态需要额外处理
已存在的目录可能在新代码写入权限前就拒绝服务打开。正式修复还需要一个受控迁移步骤:
验证情况
已完成:候选补丁通过 git apply --check,能应用到 0.159.0 对应源码。
未完成:Windows 构建、SYSTEM 身份的权限回归测试、旧目录迁移测试和产品集成验证。本次未创建 CI/CD 自动化,未改变或删除现有测试。
建议维护者手工验证:
相关问题
同一根因的已有报告:#46380
另一个报告同时涉及 full-access 权限配置阻止 setupStart 和目录权限恢复:#49299
本补充材料聚焦目录权限复发,不把两个失败入口当成已证实的同一问题。
候选补丁全文
Yuhanbravo commentedon Sep 30, 2026
I reproduced the same failure condition again after the latest Codex Desktop upgrade and performed a minimal ACL-only recovery test.
Before remediation,
.sandbox-binhad the following effective ACL state:This matches the failure precondition described in the original report:
SYSTEMandAdministratorsdid not haveWRITE_DAC.I then made only the following change:
I did not change ownership, enable inheritance, grant Full Control, modify the sandbox user group, or recreate
.sandbox-bin.Immediately before rerunning the official sandbox setup, the ACL was:
The official Codex sandbox setup then completed successfully.
However, immediately after the setup completed, the ACL had been rewritten to:
So the normal Codex sandbox setup itself removed
WRITE_DACagain from bothSYSTEMandAdministrators.This provides a minimal before/after reproduction of the ACL lifecycle problem:
This also further supports that the issue is not caused by using a standard interactive account with a separate Administrator account for UAC elevation. The same account model works once the required ACL permission is temporarily restored.
The remaining problem appears to be that the sandbox ACL written by Codex is not compatible with the access required by a later provisioning pass.
spidikor commentedon Oct 1, 2026
Your
WRITE_DACbefore/after result matches what I saw in a related LocalSystem service case. In this test, adding the missing right to SYSTEM alone was enough; other helper identities may need a different scoped repair.On Codex Desktop 26.928.2636.0 / Windows 11 Home, build 26300, the service was running as LocalSystem, while SYSTEM had Modify but lacked
WRITE_DACon the protected.sandbox-bindirectory.After saving the DACL and checking that the path wasn't redirected, I added only SYSTEM's
WRITE_DAC, additively on that directory itself, and retried the normal setup. Actual sandbox PowerShell commands then exited 0, and workspace/ACL reads worked! Ownership, Administrators' rights and the sandbox user group's rights stayed unchanged.Full anonymized steps, backup/path checks, and source comparison.
The catch: Codex removed the temporary permission afterward. Shell startup and reads were verified; workspace writes, an upgrade and another provisioning cycle weren't. So this is a temporary workaround for the matching LocalSystem/ACL case, with recurrence still possible.
Titor01 commentedon Oct 2, 2026
I can reproduce what appears to be the same issue on a newer Codex build, and it has happened more than once on the same machine.
Environment:
codex doctor: 10.0.26300Failure from
codex doctor:This was not the first occurrence. The Windows sandbox had previously completed setup successfully, but later Codex again showed that Windows setup was not completed. During the broken state, I also observed that agent actions required approval much more frequently.
Troubleshooting:
Enabled inheritance on the existing directory:
This succeeded, but
codex doctorstill reportedhelper_sandbox_lock_failed.Checked ACLs. The interactive user, SYSTEM, and Administrators already had access, including inherited Full Control for the interactive user.
The existing
.sandbox-bincontained many oldcodex-command-runner-*.exebinaries from previous Codex versions pluscodex.exe.Renamed the generated directory:
Reopened Codex Desktop and retried Windows setup.
Result:
codex doctornow reports:So on this system, simply allowing Codex to recreate
.sandbox-binfixed the problem, while enabling inheritance on the existing directory did not.Because this has recurred after the sandbox had previously been configured successfully, this looks consistent with a re-provisioning / stale generated-state problem rather than a one-time setup failure. It would be useful if Codex could automatically detect and safely recover from an unusable generated
.sandbox-binstate instead of requiring the user to rename or delete it manually.Yuhanbravo commentedon Oct 15, 2026
Follow-up: Recurrence on Codex Desktop 26.1007.9446.0 — SYSTEM-only WRITE_DAC recovery successful
I encountered the same Windows elevated sandbox provisioning failure again on my development workstation after upgrading Codex Desktop to
26.1007.9446.0.This is a recurrence on the same machine previously documented in this issue.
Environment
26.1007.9446.0elevatedCodexSandboxService.OpenAI.CodexLocalSystemRunningFailure observed
The current
setup_error.jsoncontained:Unlike my original September report, the current structured error did not explicitly include Windows error code 5.
However, the ACL inspection identified the same relevant missing permission.
ACL state before remediation
Both SYSTEM and Administrators lacked
WRITE_DAC, while the sandbox service was running as LocalSystem.Minimal remediation
This time, instead of renaming or recreating
.sandbox-bin, I used a narrowly scoped ACL repair.First, I preserved the original ACL and setup error evidence.
Then I added only
WRITE_DACto the SYSTEM identity on the existing.sandbox-bindirectory:No recursive permission changes were performed.
I did not:
.sandbox-bin;unelevated;.sandbox-secrets.Result
The remediation succeeded and Codex functionality was restored.
This provides another successful recovery using only the specific permission required by the LocalSystem setup path.
It also confirms that a full generated-state rebuild is not necessary for this failure condition on my machine.
Updated assessment
Across two incidents on the same workstation:
.sandbox-binstate.26.1007.9446.0was resolved by adding only SYSTEM'sWRITE_DACto the existing directory.These results further support an ACL lifecycle / re-provisioning issue affecting
.sandbox-bin, rather than a general failure of Windows alternate-credential UAC elevation.The latest test establishes that the missing permission can be repaired minimally. It does not yet establish whether the successful setup subsequently removed SYSTEM's
WRITE_DACagain.Related independent findings:
A durable upstream solution should preserve the necessary authority across provisioning and refresh, while supporting safe migration of existing restricted ACL state.
Yuhanbravo commentedon Oct 28, 2026
Follow-up: Recurrent sandbox ACL failure on Codex Desktop 26.1023.6123.0 — SYSTEM-only WRITE_DAC recovery
I encountered the same Windows elevated sandbox provisioning failure again on October 28, 2026, following another Codex Desktop upgrade.
This is another recurrence on the same workstation previously documented in this issue.
1. Environment
26.1023.6123.0CodexSandboxService.OpenAI.CodexLocalSystem2. Failure evidence
The structured
setup_error.jsoncontained:Unlike my October 15 report, the current error explicitly includes
NtCreateFileand Windows error 5 (Access Denied).The affected
.sandbox-binwas an ordinary directory, not a reparse point.3. ACL before remediation
As in the previous incidents,
SYSTEMandAdministratorslackedWRITE_DAC, while the interactive account retainedChangePermissions.4. Minimal remediation performed
Before changing permissions, I:
icacls /save.setup_error.json.I then executed only:
Result:
Immediately afterward, the ACL showed:
No ownership changes, inheritance changes, recursive grants, Full Control grants, directory recreation, or sandbox configuration downgrade were performed.
5. Post-remediation result
Following the remediation:
setup_error.jsonwas no longer present.setup_marker.jsonwas readable and reported version 5..sandbox-binACL had been rewritten to its previous protected state:In particular, the temporary
SYSTEM WRITE_DACgrant had disappeared again.The structured provisioning error was cleared and the setup marker was valid. A separate post-restart sandbox command execution test has not yet been documented in this follow-up.
6. Updated assessment
This recurrence provides additional evidence for the same ACL lifecycle problem:
This is now a repeated failure across multiple Codex Desktop upgrades on the same workstation, with reproducible recovery using a minimal ACL change.
The issue is not resolved by the latest tested version,
26.1023.6123.0.7. Request to maintainers
Could the Windows sandbox maintainers review the
.sandbox-binACL lifecycle across provisioning and subsequent refresh operations, particularly:LocalSystemprovisioning path can consistently obtain its requiredWRITE_DACaccess.The repeated local workaround restores provisioning state, but does not constitute a durable upstream fix.
Current local outcome: Provisioning-state recovery observed.
Remaining issue: Recurrent ACL self-lockout on later provisioning attempts.
Upstream status: Unresolved in the latest tested build.