Sandboxed shell commands fail on Windows with `CreateProcessWithLogonW failed: 1326` / `1909`
What version of the Codex App are you using (From “About Codex” dialog)?
26.415.40636
What subscription do you have?
Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Shell commands fail when run inside the Codex workspace sandbox on Windows. The commands do not appear to reach PowerShell at all. Instead, process creation fails with CreateProcessWithLogonW errors.
Running the same harmless commands outside the sandbox with escalation works correctly, and file edits inside the workspace still work.
What steps can reproduce the bug?
- Start a Codex session on Windows with filesystem sandboxing enabled.
- Run a harmless sandboxed shell command from the workspace, for example:
``powershell``
Get-Location
- Run another harmless sandboxed command, for example:
``powershell``
Get-Content -LiteralPath .\sandbox-check.txt
What is the expected behavior?
Sandboxed shell commands should start successfully inside the configured workspace sandbox and execute normally, subject to the workspace-write restrictions.
For example, Get-Location should return the current workspace path.
Additional information
Running the same harmless command outside the sandbox with escalation succeeds:
Get-Location
returns:
C:\Users\ASUS\Documents\Codex\2026-04-20-check-if-the-sandbox-works
A directory listing also succeeds outside the sandbox:
Get-ChildItem -Force
File edits inside the workspace using the patch/edit mechanism also succeed. For example, creating and deleting a temporary file in the workspace worked as expected.
This suggests the workspace path and normal PowerShell execution are valid. The failure appears specific to the Windows sandbox process-launch path.
7 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I’m seeing what appears to be the same Windows elevated sandbox failure, with a few additional observations.
Environment
26200OpenAI.Codex_26.519.11010.0_x64codex-cli 0.133.0codex-cli 0.130.0Current blocking error
The command appears to fail before the requested PowerShell command runs.
Timeline
Earlier in the investigation I saw:
At that time,
CodexSandboxOfflineappeared to be locked. After waiting for the lockout cooldown, both sandbox users became active and no longer showed locked status.Later, I also saw:
during setup refresh attempts. This looked related to elevation. After launching Codex with an elevated/admin context, later sandbox logs showed setup refresh success-like entries.
The current persistent failure is now:
Current sandbox user state
Both sandbox users appear active and not locked:
State file observations
Metadata only:
setup_marker.jsononly appeared to contain setup metadata such as:No secrets were included in the inspected masked output.
Relevant masked sandbox.log excerpts
The full log is not attached. Representative masked excerpts:
A previous elevation-related example:
Recovery attempts
I tried the following carefully and rolled back after failed regeneration attempts:
1909lockout state to clear.CodexSandboxOfflineandCodexSandboxOnlinewere active and not locked.codex-cli 0.133.0for later checks..sandbox-secretsto test whether Codex would regenerate sandbox credentials..sandbox-secretswas not regenerated..sandbox-secretsand.sandbox\setup_marker.jsonto test whether Codex would regenerate both setup marker and sandbox credentials.Actions intentionally not performed
auth.jsoncontents..sandbox-secretscontents.sandbox_users.jsoncontents.CodexSandboxOfflineorCodexSandboxOnlinepasswords.config.toml.Question
Is there a supported way to reset or regenerate the Windows elevated sandbox credentials / account state after
1909,740, and persistent1326?In particular:
CODEX_HOME?CreateProcessWithLogonWstill returns1326, what is the recommended recovery sequence?.sandbox-secretsorsetup_marker.jsonunsupported?CODEX_HOMEfiles should be preserved or removed?Additional update after reinstall and explicit admin launch:
I reinstalled the Store version of Codex, then fully closed all Codex-related processes.
After confirming there were no running Codex processes, I launched Codex from the Start menu using:
However, checking the actual running Codex processes shows that they are still not elevated:
Representative paths:
This was after reinstalling and launching from Start menu with “Run as administrator” plus UAC approval.
I did not proceed to run sandbox
whoami, because the elevation precondition appears not to be satisfied. This may explain why the elevated sandbox setup/helper previously hitos error 740, and why the sandbox remains stuck at:Question:
Is this expected for the Windows Store/MSIX Codex app? If “Run as administrator” is approved via UAC, should
Codex.exe/codex.exeshowTokenElevation=True, or is there a different supported way to launch the Codex app with an elevated token for Windows elevated sandbox setup?Correction / clarification on OS version:
My environment is Windows 11 Home, version 25H2, OS build 26200.8524.
Some tooling / issue context reports the platform as:
I hit a similar elevated Windows sandbox failure, but with a different CreateProcessWithLogonW code: 1907.
Codex managed to solve it.
Environment:
Initial symptom:
CreateProcessWithLogonW failed: 1907
Additional diagnostics:
So this may be another variant of the elevated sandbox account/logon failure class: the sandbox local users can enter a password-expired/must-change state, and on some managed Windows configurations normal account repair paths may be blocked by policy.
Additional update:
doctorreports0.135.0is available, but app-bundled CLI update cannot detect the installation method.After removing the duplicate npm-installed Codex CLI from PATH, I tested the app-bundled CLI directly from an elevated PowerShell.
Current state:
codex --version:codex doctor --summary --no-color --asciireports:However, running update from the same app-bundled CLI:
returns:
After that,
codex --versionstill reports:Also, Microsoft Store reports no update available for the Codex app.
So the current situation is:
I did not run:
Question:
Is
codex updateexpected to work from the app-bundled CLI on Windows Store/MSIX installations, or should Store/MSIX users wait for the Store app update instead?Also, could the
search command could not be verifiedwarning indicate a broken bundled package that is related to the Windows sandbox failure, or is it unrelated?Update: resolved the local 1326 state.
The key was that reprovision did not happen on app launch alone. It happened on first sandbox use after renaming the full sandbox state.
Steps that worked:
.sandbox.sandbox-secrets.sandbox-binAdditional data point (Windows 11, build 10.0.26200; codex-cli 0.139.0;
[windows] sandbox = "elevated") that may help characterize the 1326 → 1909 progression:Parallel
codex execturns an intermittent credential failure into a persistent lockout. Running ~6codex execinstances concurrently, the per-command logons viaCreateProcessWithLogonWfail, and the burst of failed logons trips Windows' account-lockout policy on theCodexSandboxUser. After the first parallel burst, every subsequent run — including single, serial ones — fails with 1909 (account locked out) rather than the initial 1326 (bad username/password). So once it's been hit under concurrency, elevated stays broken until the lockout window clears or the account is reset.File-edit / patch operations keep working; only sandboxed shell execution fails (git, rg, Get-Content all return the logon error), which silently degrades an agent run to "reviewing blind" — the model proceeds from partial context and can hallucinate findings rather than erroring out.
Workaround that fully resolves it: set
[windows] sandbox = "unelevated"in~/.codex/config.toml. Unelevated uses a restricted token derived from the current user (no dedicatedCodexSandboxUser, noCreateProcessWithLogonW), so it avoids both 1326 and 1909. Verified here: after the switch, an identical 6-way parallel run had 0 sandbox failures and executed commands normally.Suggestions:
CreateProcessWithLogonW failed: 1909, and consider auto-falling back to unelevated when the elevated logon path is unavailable.I have the same issue on Windows.
Codex version: [Settings → About Codex]
Windows version: [nhấn Win+R, nhập winver]
Error:
windows sandbox: helper_unknown_error: apply deny-read ACLs
Restarting Codex and reopening the workspace did not fix it.