Repository navigation
Description
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:
- Windows elevated sandbox setup helper shows “The parameter is incorrect” even with clean CODEX_HOME and short ASCII npm path; unelevated works #24490
- Windows sandbox setup helper triggers UAC installer detection (os error 740) #24050
- Sandboxed shell commands fail on Windows with
CreateProcessWithLogonW failed: 1326/1909#18620 elevated_windows_sandboxcausing all agent commands to fail with(no output)(logs showCreateProcessAsUserW failed: 5) #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-ListObserved:
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.
Activity
PrzemyslawKlys commentedon May 31, 2026
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:{ "Path": "C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.6.2.0_x64__8wekyb3d8bbwe\\pwsh.exe", "IsAdmin": true, "Integrity": "High Mandatory Level" }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:
amatsuki5032 commentedon Jun 2, 2026
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.
amatsuki5032 commentedon Jun 2, 2026
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.amatsuki5032 commentedon Jun 2, 2026
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.JoeyGennaro commentedon Jun 2, 2026
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.
jlj001031 commentedon Jun 4, 2026
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 !
Tuo-Luo commentedon Jun 13, 2026
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.ZaunEkko commentedon Jun 16, 2026
Additional reproduction on a newer Microsoft Store build. This is the same machine/details I also posted on #28107: #28107 (comment)
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.PrzemyslawKlys commentedon Jun 16, 2026
Still works fine. You need to provide the do-not-de-elevete argument
MoFaShi12306 commentedon Nov 2, 2026
Verified Windows 10 case on 26.1027.6604.0: desktop, app-server, and tool shell all High via a detached physical-copy experiment
Adding a newer, independently verified result to the portable-copy experiment already discussed in this issue. Related Windows 10 report: #46682.
Environment
Original failure
Normal desktop launch worked, but the desktop agent/tool command environment lacked an elevated Windows token. The Start-menu administrator launch did not produce a working elevated desktop session. After fully exiting the app, direct Start-Process of the installed WindowsApps...\app\ChatGPT.exe from an already elevated PowerShell returned Access is denied, including with --do-not-de-elevate.
The same account could obtain High through normal UAC for PowerShell and a separate Codex CLI session. Elevating that separate CLI did not solve the user's requirement to work inside the desktop chat.
Combination that worked on this machine
Observed result on 2026-11-02
Redacted output; machine name, account name, profile path, and session/chat contents are omitted:
This confirms the actual desktop agent and command process were elevated, rather than only the parent launcher. The user reported spending roughly six hours on the overall investigation, including mistakes in our initial helper scripts.
Important interpretation limits
This is an experimental, modified detached copy, not a repair of the original signed MSIX or an official supported installation method. It removes the copied EXE's original signature, and update/package-identity behavior has not been validated. No UAC settings, WindowsApps ownership/ACLs, or original package files were changed.
The original EXE declares asInvoker and the package does not declare allowElevation. Those observations do not establish a unique root cause: asInvoker alone does not prohibit normal RunAs elevation, and absence of allowElevation alone does not prove which check returned Access denied. We changed several launch conditions together and did not run an ablation to establish which are individually necessary. Please do not generalize this result to every build/machine.
Helper-script lessons, separate from the product bug
Requested product improvements
Please provide a supported UAC/elevation path for the desktop agent, or a supported on-demand elevated helper, so users do not need to modify an executable copy and lose its signature. A diagnostic view showing the real integrity/elevation state of UI, app-server, and tool processes, with the concrete failure layer/error code, would also prevent a great deal of confusion. Clarifying Windows High tokens versus Full access and legacy elevated sandbox setup in troubleshooting would help.
Official documentation currently says the desktop agent should inherit administrator permission when the app is started as administrator:
https://learn.chatgpt.com/docs/app/windows
The attached reproduction package contains only the helper scripts, a redacted evidence summary, and the case analysis. It contains no application binaries, original transcripts, credentials, or chat exports.
CodexAdminFeedback-20261102.zip