Windows sandbox: `SetTokenInformation(TokenDefaultDacl) failed: 1344` (ERROR_ALLOTTED_SPACE_EXCEEDED) — every command fails before start in workspace-write, on both elevated and unelevated

Open 💬 3 comments Opened Jun 4, 2026 by IVillanueva770

Related: #9062, #16780 (same "command-runner fails before process start in workspace-write on Windows" family, but a different error code — 1344, not 1385).

Summary

On Windows, with sandbox_mode = "workspace-write", every model-issued shell command fails before the process starts with:

ERROR codex_core::exec: exec error: windows sandbox: runner error: SetTokenInformation(TokenDefaultDacl) failed: 1344
exited -1 in 0ms

1344 = ERROR_ALLOTTED_SPACE_EXCEEDED ("No more memory is available for security information updates"): the default DACL being applied to the restricted token exceeds the token's allotted default-DACL space.

Environment

  • Codex CLI 0.137.0 (npm @openai/codex), Node v25.9.0, npm 11.12.1
  • Windows 11 Pro 10.0.26200 x64, OS language es-MX (localized profile)
  • User profile path contains a space: C:\Users\Ignacio Villanueva
  • Localized legacy junctions in the profile (Configuración local, Datos de programa, Menú Inicio, Reciente, SendTo, Plantillas, etc.)
  • Session: Medium integrity, non-elevated (Administrators present but "deny only")
  • Config: sandbox_mode = "workspace-write", [windows] sandbox = "elevated"

Minimal repro

codex exec --skip-git-repo-check -c approval_policy=never "Run Get-Location once."

exited -1 in 0ms, error 1344. The command it tried to run was pwsh.exe -Command Get-Location — it never reaches PowerShell.

Isolation matrix (all from cwd = user home)

| Mode | Result |
|------|--------|
| workspace-write, windows.sandbox = elevated | ❌ FAIL 1344 |
| workspace-write, windows.sandbox = unelevated | ❌ FAIL 1344 (so it's not elevation-specific) |
| read-only | ✅ OK |
| danger-full-access | ✅ OK |
| codex sandbox <cmd> subcommand (runs read-only) | ✅ OK |

The failure is specific to building the writable default DACL for workspace-write. Read-only never builds it; full-access uses no restricted token. Running an elevated terminal (Administrator) does not fix it — fails identically.

Logs

~/.codex/.sandbox/sandbox.YYYY-MM-DD.log shows the setup binary completing fine:

setup refresh: processed 121 write roots (read roots delegated); errors=[]
codex-windows-sandbox-setup.exe: setup binary completed
START: ...pwsh.exe -Command Get-Location

…then the runner fails at token creation (1344). Note 121 write roots — on a localized (es-MX) profile the duplicated legacy junction folders inflate the write root set, which I suspect overflows the token's default-DACL allotted space.

Suspected root cause

When the command-runner constructs the restricted token's default DACL for workspace-write, the ACE set (one per write root × the inflated localized-profile roots) exceeds the token default-DACL allotted space → ERROR_ALLOTTED_SPACE_EXCEEDED (1344). Likely reproducible on any non-English / localized Windows profile, and cwd-independent (fails the same from a no-space path like C:\tmp\codex-test).

Workarounds (for other users hitting this)

  • -s read-only (loses write) or --dangerously-bypass-approvals-and-sandbox (no sandbox).
  • Switching elevated ↔ unelevated does not help.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗