Codex Desktop launched elevated still spawns medium-integrity shell
What issue are you seeing?
On Windows, Codex Desktop appears to be configured for the elevated Windows sandbox, and the Desktop process is launched with --do-not-de-elevate, but the actual tool shell spawned for agent commands still runs with a filtered medium-integrity token rather than a high-integrity/admin token.
This makes elevated/admin work impossible from the Codex Desktop shell even when the app was opened through UAC and the config requests elevated Windows sandbox behavior.
This is related to, but not the same as:
- #24490
- #24050
- #18620
- #10090
In this case the sandbox setup refresh is not currently failing before commands run. Commands do run, but the spawned shell is not elevated.
Environment
OS: Windows 11 x64
Codex App: 26.527.3686.0
Install location: C:\Program Files\WindowsApps\OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0
Shell: C:\Program Files\PowerShell\7\pwsh.exe
Relevant config.toml:
model = "gpt-5.5"
sandbox_mode = "danger-full-access"
approval_policy = "never"
[windows]
sandbox = "elevated"
Process tree
The agent shell is spawned under Codex Desktop like this:
pwsh.exe
parent: codex.exe app-server --analytics-default-enabled
parent: Codex.exe ... --do-not-de-elevate
Observed command line for Codex.exe includes:
--do-not-de-elevate
Actual behavior
The shell process is still not elevated.
PowerShell check:
$id = [Security.Principal.WindowsIdentity]::GetCurrent()
$p = [Security.Principal.WindowsPrincipal]$id
[pscustomobject]@{
User = $id.Name
IsAdmin = $p.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
PID = $PID
Process = (Get-Process -Id $PID).ProcessName
Integrity = ((whoami /groups | Select-String 'Mandatory Label').Line -replace '^\s+','')
} | Format-List
Observed:
User : EVOTEC\przemyslaw.klys
IsAdmin : False
Process : pwsh
Integrity : Mandatory Label\Medium Mandatory Level
whoami /groups also shows admin groups as filtered/deny-only, for example:
BUILTIN\Administrators Group used for deny only
EVOTEC\Domain Admins Group used for deny only
EVOTEC\Enterprise Admins Group used for deny only
Mandatory Label\Medium Mandatory Level
A protected-path write probe fails:
$path = 'C:\Program Files\codex-elevation-probe.tmp'
try {
Set-Content -LiteralPath $path -Value 'probe' -ErrorAction Stop
Remove-Item -LiteralPath $path -Force -ErrorAction Stop
'ProtectedWrite=SucceededAndRemoved'
} catch {
'ProtectedWrite=Failed'
'Error=' + $_.Exception.GetType().FullName
'Message=' + $_.Exception.Message
}
Observed:
ProtectedWrite=Failed
Error=System.UnauthorizedAccessException
Message=Access to the path 'C:\Program Files\codex-elevation-probe.tmp' is denied.
Sandbox log observations
Current sandbox logs show setup refreshes succeeding and the copied command runner being used:
setup refresh: processed 2 write roots (read roots delegated); errors=[]
codex-windows-sandbox-setup.exe setup binary completed
helper launch resolution: using copied command-runner path C:\Users\przemyslaw.klys.EVOTEC\.codex\.sandbox-bin\codex-command-runner-0.135.0-alpha.1.exe
There is an older stale setup error file from a previous date:
{
"code": "helper_unknown_error",
"message": "apply deny-read ACLs"
}
but its timestamp is older than the current successful setup refreshes.
UAC policy checks
EnableLUA : 1
ConsentPromptBehaviorAdmin : 5
PromptOnSecureDesktop : 1
EnableInstallerDetection : 1
Expected behavior
If Codex Desktop is launched elevated and configured with:
sandbox_mode = "danger-full-access"
[windows]
sandbox = "elevated"
then the shell/tool process used for commands that require administrator rights should either:
- run with a high-integrity/admin token, or
- clearly report that Codex Desktop cannot provide an elevated command token from this launch path/configuration.
At minimum, danger-full-access plus windows.sandbox="elevated" should not appear successful while command execution still uses a medium-integrity filtered token.
Why this matters
This breaks workflows such as installing MSI packages, modifying services, writing under C:\Program Files, or any other admin-required Windows operation. From the user perspective, UAC was approved and Codex appears to be running with elevated intent, but the actual agent shell cannot perform admin actions.
9 Comments
Consolidated local findings from the elevation repro:
What reproduces
Codex Desktop installed via MSIX starts the Electron main/app-server path at medium integrity, even when the user expects an elevated session.
Observed on:
Current Beta thread process chain:
Shell result:
Portable proof
Using the same installed Codex stable binaries, I copied the package
appfolder out ofC:\Program Files\WindowsAppsand patched only the copiedCodex.exeembedded manifest:Launching that copied Win32 app with
--do-not-de-elevateworks end-to-end:So Codex Desktop +
resources\codex.exe app-servercan run elevated when the Win32 launch path actually provides an elevated token.MSIX comparison with Store PowerShell
MSIX is not an absolute blocker to elevation. Store PowerShell is installed on the same machine:
It is also a
Windows.FullTrustApplication, usesrunFullTrust/unvirtualizedResources, andpwsh.exehasrequestedExecutionLevel level="asInvoker". But launching Storepwsh.exewithStart-Process -Verb RunAssucceeds:One visible package-shape difference:
Directly trying to launch Codex Beta's packaged EXE with
Start-Process -Verb RunAsfails before an elevated process is created:Refined interpretation
This does not look like "Codex cannot run elevated" and it also is not simply "MSIX can never elevate." The local evidence suggests the current Codex MSIX package/launch shape does not expose a working elevated app-server path.
Possible product directions:
I can reproduce the same class of issue on another Windows 11 machine.
Environment
26.527.3686.0OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0C:\Program Files\WindowsApps\OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g00.136.0What I did
Codex/codexprocesses.Actual result
The Codex session still reports a non-admin token:
Every visible Codex process also reports
Elevated=False, including the Desktop app process and bundled agent processes:This was after the user explicitly launched from the Start menu with Run as administrator and approved UAC.
Related observations
Start-Process -Verb RunAsagainst theWindowsAppsCodex.exepath fails with access denied from a normal PowerShell context. That may be expected for direct MSIX executable launching, but it makes shortcut/batch based admin relaunches unreliable.C:\Users\<redacted>\.codex\config.tomlset to:codex exec --sandbox workspace-writefailed with:Changing it to:
made the same
workspace-writeCLI/runner canary pass again. That works around normal non-admin CLI work, but does not solve the Desktop app not inheriting/admin-spawning an elevated token.Expected result
This matches the Windows docs expectation that launching Codex via Run as administrator should let the agent inherit that permission level. If the MSIX/Start-menu admin path cannot actually provide a high-integrity token to the app/server/agent shell, the app should surface that clearly instead of appearing to accept the elevated launch path while all spawned agent processes remain medium integrity.
Follow-up after reinstall:
The user reinstalled the Codex Desktop app from Microsoft Store / Marketplace. The app package updated from:
to:
After reinstall, the user again launched Codex from the Start menu using Run as administrator and approved UAC. The newly opened Codex session still reports:
and all observed
Codex/codexprocesses are stillElevated=False.So, at least on this machine, reinstalling/updating the MSIX package to
26.527.7698.0did not fix the issue.Additional debugging found a working workaround and narrows the failure boundary.
What does not work on this machine
runasactivationThose paths still produce a Codex session with
IsAdministrator: Falseand all observedCodex/codexprocesses at medium integrity.What does work
Launching an elevated PowerShell first, then starting the MSIX package executable directly from that already elevated token:
With this flow, the Codex session reports:
and the relevant
Codex.exe/codex.exe app-serverprocesses are observed withElevated=True. Electron child processes such as renderer/GPU may still showElevated=False, but the main app/server/agent shell path is elevated and admin-only commands such asfltmcsucceed from the Codex session.Interpretation
This suggests the issue is specifically in the Start-menu / AppsFolder / MSIX activation route for
Run as administrator, not in Codex's ability to run elevated onceapp\Codex.exeis launched from an already elevated token.A practical workaround is a two-stage launcher:
powershell.exe -Verb RunAs%InstallLocation%\app\Codex.exe --do-not-de-elevatedirectlyThis worked on the affected machine after reinstalling/updating Codex Desktop to
26.527.7698.0.I was running into exactly the same issue. Starting Codex from the Start menu -> right click -> run as admin -> all processes spawned by the runner with medium integrity instead of high -> all conceivable actions blocked by our group policy (appropriately so)
Using the two-stage launcher as the practical workaround works for me as well. Thank you so much.
I encountered the same issue, and the operation behavior was the same as above. In previous versions, if you ran Codex with administrator privileges, subsequent privilege escalation operations didn't require manual UAC confirmation. But after updating to the latest version, each privilege escalation requires manual UAC confirmation, which is very unfriendly for developers. I hope this is fixed soon. Thanks !
I opened #28107 with additional diagnostics for this same elevated-launch / medium-integrity tool-shell problem.
The new details there are:
26.609.4994.0: Windows 10 staysFull / High, while Windows 11 transitions toLimited / Medium.Codex.exeappears asFull / High, then a--no-startup-window --do-not-de-elevateCodex.exeappears asLimited / Mediumbeforecodex.exe app-serverstarts.Codex.exe --do-not-de-elevate, after whichCodex.exe,codex.exe app-server,node_repl.exe, and the tool shell all remainFull / Highon Windows 11.Additional reproduction on a newer Microsoft Store build. This is the same machine/details I also posted on #28107: https://github.com/openai/codex/issues/28107#issuecomment-4714594390
Environment:
This repro is slightly different from the earlier workaround comments here: on this machine, even the two-stage launch path did not preserve elevation.
Tested launch flow:
The helper log confirmed the launcher itself was elevated and
Start-Processsucceeded:After launch, the Store-package Codex process tree was present and the main process command line included
--do-not-de-elevate:But token checks via
OpenProcessToken+GetTokenInformation(TokenElevation)showed all Store-package Codex processes were still not elevated:I also checked the package manifest capabilities for this build. It declares:
I did not see
allowElevation.So on this Windows 11 / Store build, the Start Menu admin path does not produce an elevated agent, and launching
app\Codex.exefrom an already elevated helper process also still results in a medium/non-elevated Codex Desktop + app-server process tree.Still works fine. You need to provide the do-not-de-elevete argument