Repository navigation
Description
What version of Codex are you using?
codex-cli 0.151.0-alpha.7.2 (npm global), invoked as codex exec from a local
automation controller. ~/.codex/config.toml contains [windows] sandbox = "elevated".
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64 (Windows 11 Pro). Single interactive user,
member of BUILTIN\Administrators, UAC enabled.
What issue are you seeing?
With [windows] sandbox = "elevated", codex.exe spawns
codex-windows-sandbox-setup.exe once per sandboxed command, not once per
session and not only on marker invalidation. Each spawn requires elevation, so a
working day of agent runs produced 1,103 elevated helper spawns on a single
machine.
The distinguishing fact: every one of those spawns succeeded. All 1,103 logged
errors=[], and 1,046 of them reported processed N write roots with N > 0 — i.e.
the helper re-applied ACLs for a write root that a spawn moments earlier had already
processed successfully.
Marker invalidation is not the driver here. In the same 11,879-line log,
sandbox users missing or incompatible with marker version appears only 15 times
against 1,103 spawns.
Measurements (single day, ~/.codex/.sandbox/sandbox.2026-09-02.log)
| Log event | Count |
|---|---|
setup refresh: spawning …codex-windows-sandbox-setup.exe |
1103 |
setup refresh: … errors=[] |
1103 (100%) |
setup refresh: processed N write roots, N > 0 |
1046 |
setup refresh: processed 0 write roots |
57 |
sandbox users missing or incompatible with marker version |
15 |
hide users: failed to hide current user profile dir (C:\Users\Default) |
1094 |
Inter-spawn gap distribution (1102 gaps):
| Gap | Count |
|---|---|
| ≤ 1 s | 630 |
| 2–5 s | 118 |
| 6–15 s | 238 |
| 16–60 s | 97 |
| > 60 s | 19 |
Four consecutive spawns for the same cwd, ~90 ms apart, each preceded by a fresh
command-runner launch (paths redacted):
12:35:47.665 codex.exe] setup refresh: spawning …codex-windows-sandbox-setup.exe (cwd=C:\work\<projA>, payload_len=3832)
12:35:47.748 codex.exe] setup refresh: spawning …codex-windows-sandbox-setup.exe (cwd=C:\work\<projA>, payload_len=3832)
12:35:47.837 codex.exe] setup refresh: spawning …codex-windows-sandbox-setup.exe (cwd=C:\work\<projA>, payload_len=3832)
12:35:47.928 codex.exe] setup refresh: spawning …codex-windows-sandbox-setup.exe (cwd=C:\work\<projA>, payload_len=3832)
The repeating unit that precedes each spawn is always the same five lines:
codex.exe] helper copy: reused command-runner source=… destination=…\.sandbox-bin\codex-command-runner-0.151.0-alpha.7.2.exe
codex.exe] helper launch resolution: using copied command-runner path …
codex-command-runner-0.151.0-alpha.7.2.exe] hide users: failed to hide current user profile dir (C:\Users\Default): SetFileAttributesW failed for C:\Users\Default: 5 (access denied)
codex.exe] START: …\.sandbox-bin\codex.exe --codex-run-as-fs-helper
codex.exe] setup refresh: spawning …codex-windows-sandbox-setup.exe (cwd=…, payload_len=3832)
Impact
Each elevated spawn raises a UAC consent prompt on the interactive desktop. At the
observed rates (peak 41 spawns/minute; 630 of 1102 gaps under one second) the machine
becomes effectively unusable for the human at the keyboard — typing into other
applications is repeatedly interrupted for hours. We did not instrument the prompts
themselves, so we report the spawn count as measured and the prompt count only as
"one consent per elevated spawn" by mechanism, not by direct count.
Switching to [windows] sandbox = "unelevated" reduced setup-helper spawns to 0
across three subsequent verification runs (measured on four independent observation
paths over 31 minutes), confirming the elevated path as the source.
codex doctor --json reports checks.sandbox.helpers.status = "ok",
summary = "sandbox configuration is readable" throughout — the diagnostic does not
surface the loop.
Secondary observation
hide users: failed to hide current user profile dir (C:\Users\Default): SetFileAttributesW failed … 5 (access denied) occurs 1094 times, essentially once
per spawn. C:\Users\Default is a system-owned hidden profile template; the runner
appears to attempt an attribute change it will never be permitted to make from a
non-elevated context. It does not abort the run, but it is a per-command failed
privileged operation and may share a root cause with the unconditional refresh.
Relationship to existing reports
Filed separately because the observed mechanism differs from the nearby reports:
- Windows sandbox: elevated setup for one CODEX_HOME rotates a machine-wide secret and UAC-storms every other home #40627 — elevated setup for one
CODEX_HOMErotates a machine-wide secret and
invalidates other homes' markers. Different here: marker invalidation accounts
for 15 of 1103 spawns; the other 1088 occur with a valid marker and a successful
preceding refresh. - [Windows] Elevated sandbox re-provisions unconditionally every session and never persists the rotated credentials, causing a UAC prompt per session #42213 — elevated sandbox re-provisions unconditionally every session and
never persists rotated credentials. Different here: the cadence is per command
(630 gaps under 1 s within single sessions), and every refresh reports success
rather than leaving stale credentials. - [Windows] Desktop and npm CLI alternate elevated sandbox marker state, causing repeated setup/UAC prompts #36865 — Desktop and npm CLI alternate marker state. Different here: only
the npm CLI is installed and running; no Desktop or VS Code surface is involved. - Windows Desktop 26.721 repeats elevated sandbox setup; marker rewritten but unreadable/rejected #35407 / Windows sandbox setup marker ACL prevents Codex from starting sandbox after UAC setup #30445 / [Windows][VS Code] Windows sandbox setup repeatedly fails after helper completion; setup_marker.json ACL workaround #40217 — marker written but unreadable/rejected due to ACLs.
Different here: the marker is readable and accepted; nothing is rejected — the
refresh simply runs again on the next command.
Full log excerpts and per-cwd breakdowns available on request.
Activity
github-actions commentedon Sep 2, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Spongert commentedon Sep 13, 2026
I just want to confirm that this issue is still persistent exactly as described by the starter in codex-cli 0.154.0. I just started to use multi-agent setups using agents.md when this started to happen. Because of this I had to switch to a different codex client (not using the NPM version, according to the CLI itself) which has now introduced this issue.
It becomes impossible to do anything else on the machine, while a prompt is running.
lvasko commentedon Oct 8, 2026
I can confirm this issue is still reproducible with Codex CLI 0.161.0 on Windows 11, using the managed app-server daemon.
Environment:
0.161.00.161.00.161.07.6.6Observed behavior:
codex-windows-sandbox-setup.exeis repeatedly launched, causing recurring Windows UAC elevation prompts.The sandbox setup marker exists and is readable:
setup_marker.jsonversion:5The sandbox log repeatedly shows successful setup operations:
Some repeated setup operations originate from the managed daemon working directory (
.codex\app-server-daemon\workdir).Expected behavior:
Successful sandbox initialization should not trigger another elevated setup operation for every subsequent command when the sandbox configuration and write roots have not changed.
This appears to be the same unconditional refresh behavior described in this issue, now confirmed on version
0.161.0.The repeated UAC prompts significantly disrupt interactive use of Codex CLI.