Skip to content

Windows app: sandbox setup fails with "setup refresh had errors" after reinstall with a fresh .codex — DACL change on %LOCALAPPDATA%\Temp denied (ESET HIPS suspected) #50916

Open

Description

@n2dea6542845

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

26.930.41038 (Microsoft Store package OpenAI.Codex 26.930.4958.0)

What subscription do you have?

Pro

What platform is your computer?

Windows 11 Pro build 26300.9457 (Insider build), x64. Security software: ESET Internet Security 19.2.10.0. [windows] sandbox = "elevated" (default).

What issue are you seeing?

I uninstalled the Windows app, moved the old %USERPROFILE%\.codex folder away, and installed the app again. After that, every shell command fails before it starts:

exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: helper_unknown_error: setup refresh had errors\")" }

File edits still work. Commands worked on the same machine before the reinstall.

Sandbox log (%USERPROFILE%\.codex\.sandbox\sandbox.<date>.log):

granting write ACE to C:\Users\<user>\AppData\Local\Temp for sandbox group and capability SID
write ACE grant failed on C:\Users\<user>\AppData\Local\Temp: SetSecurityInfo failed: 5
setup refresh completed with errors: ["write ACE failed on C:\\Users\\<user>\\AppData\\Local\\Temp: SetSecurityInfo failed: 5"]
setup error: setup refresh had errors

In the same run, the write ACEs for the workspace folder and for .codex\... were granted successfully. Only %LOCALAPPDATA%\Temp failed.

Tests on this PC strongly suggest that ESET's HIPS-related protection blocks the DACL change on the Temp folder itself. I checked this on one PC running a Windows Insider build. Other environments were not tested, and not every other factor was ruled out.

  • The user owns Temp and has Full Control. The folder can be opened with WRITE_DAC, but writing the DACL is denied:
    • .NET Directory.SetAccessControl: UnauthorizedAccessException
    • NtSetSecurityObject (DACL only, no inheritance propagation): 0xC0000022 STATUS_ACCESS_DENIED. Same result from an elevated PowerShell.
  • The same call succeeds on subfolders of Temp. Only Temp itself is denied.
  • Pausing ESET's real-time file system protection did not change the result.
  • As a diagnostic experiment, with the network cable unplugged, I disabled HIPS for a short time. With HIPS disabled, the same non-elevated NtSetSecurityObject call succeeded (0x00000000), which added the ACE for the new capability SID to Temp.
  • I then turned HIPS back on and rebooted. Commands now run in the sandbox with HIPS enabled, because the ACE stays on Temp and setup no longer needs to write it.

What I observed about the SID: after the old .codex was moved away and recreated, a new capability SID was created (in the new %USERPROFILE%\.codex\cap_sid), and setup tried to add an ACE for this new SID to Temp. Temp also has ACEs for 4 other existing capability SIDs that were added earlier. I did not test whether a reinstall alone (keeping .codex) creates a new SID.

What steps can reproduce the bug?

Reproduced only on this one PC:

  1. Windows 11 (Insider build 26300) with ESET Internet Security, HIPS enabled (default).
  2. Uninstall the Codex app, move %USERPROFILE%\.codex away, then install the app again. A new .codex\cap_sid is created.
  3. Open a local project and ask Codex to run any command (e.g. dir).
  4. The command fails with helper_unknown_error: setup refresh had errors. The sandbox log shows SetSecurityInfo failed: 5 on %LOCALAPPDATA%\Temp.

What is the expected behavior?

  • A solution that works with ESET HIPS kept enabled and the sandbox isolation kept intact. Disabling HIPS is not an acceptable workaround, because it also turns off other ESET protections.
  • An official way to recover from this state without weakening the sandbox (for example, a documented repair step).
  • The UI should show which path failed and the Win32 error, not only "setup refresh had errors". With the real path, users can see that a security product may be involved.
  • If HIPS-type products are known to conflict with the Windows sandbox setup, a short note in the docs would help.

Additional information

Activity

  1. added
    app
    on Oct 4, 2026
  2. added
    bug
    windows-os
    sandbox
    on Oct 4, 2026
  3. oyishyi commented on Oct 4, 2026

    @oyishyi

    same issue

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