Repository navigation
Description
Summary
On Windows, HTTPS requests that use the Windows TLS stack (Schannel) fail inside the current sandboxed shell with:
- PowerShell / .NET:
Authentication failed, see inner exception - inner Win32 error:
SEC_E_NO_CREDENTIALS (0x8009030e) curl.exe(Schannel build):schannel: AcquireCredentialsHandle failed
At the same time:
- Python HTTPS works in the same sandbox
- the same PowerShell HTTPS call works outside the sandbox
- sandbox users can do Schannel HTTPS successfully after their profiles are initialized
I started investigating sandbox-user profile initialization because the Schannel failure was SEC_E_NO_CREDENTIALS, which strongly suggested missing or inaccessible per-user Windows state. The fact that the sandbox users initially had no profile directories made that look like a credible lead.
Related issue: #17458 ("Windows sandbox users are created but their profiles are not initialized until manual first logon").
Version / platform
- Date observed: April 11, 2026
- Platform: Windows 11 / Windows 10.0.26200
- PowerShell: 7.5.5
curl.exe: 8.18.0 withSchannel
Failing behavior
Inside the sandboxed shell:
Invoke-WebRequest -UseBasicParsing -Uri 'https://api.ipify.org'fails with:
The SSL connection could not be established, see inner exception.
Authentication failed, see inner exception.
SEC_E_NO_CREDENTIALS (0x8009030e)
Raw .NET TLS fails too:
$tcp = [System.Net.Sockets.TcpClient]::new('api.ipify.org',443)
$ssl = [System.Net.Security.SslStream]::new($tcp.GetStream(), $false, ({$true}))
$ssl.AuthenticateAsClient('api.ipify.org')and curl.exe fails with:
curl: (35) schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS
What works
- Python HTTPS in the same sandbox
- raw TCP connectivity to port 443
- PowerShell HTTPS outside the sandbox
- Schannel HTTPS when run manually as
CodexSandboxOnlineafter profile creation - Schannel HTTPS when run manually as
CodexSandboxOfflineafter profile creation
Important observations
1. The failing current sandboxed shell is running as the real user
Inside the failing shell:
whoami->ELIOT-PC2\EliotUSERPROFILE->C:\Users\Eliot
So the failing shell appears to be a restricted real-user context, not an actual dedicated sandbox-user process.
2. Dedicated sandbox users succeed after profile creation
After manually forcing first logon for:
CodexSandboxOnlineCodexSandboxOffline
both can do:
- PowerShell HTTPS
- raw
.NET SslStream curl.exeHTTPS
successfully.
That manual profile initialization is tracked separately in #17458.
3. There is also an env inheritance bug
In those sandbox-user sessions, env is still inherited from the real user:
USERNAME=EliotUSERPROFILE=C:\Users\EliotAPPDATA=C:\Users\Eliot\AppData\RoamingLOCALAPPDATA=C:\Users\Eliot\AppData\LocalTEMP/TMP=C:\Users\Eliot\AppData\Local\Temp
That looks like a real bug in the elevated Windows sandbox path, but it is not sufficient by itself to explain the Schannel failure, because the sandbox users still succeed despite the wrong env.
Why this looks like a sandbox-specific Schannel issue
The failure is specific to the Windows TLS stack:
- PowerShell / .NET / Schannel
curl.exefail - Python HTTPS succeeds
That points to a Schannel / SSPI / token / user-profile interaction, not general network failure.
Repro
Inside sandbox:
whoami
Invoke-WebRequest -UseBasicParsing -Uri 'https://api.ipify.org'
curl.exe https://api.ipify.orgObserved:
whoami= real user- Schannel HTTPS fails with
SEC_E_NO_CREDENTIALS
Outside sandbox, the same PowerShell HTTPS call succeeds.
Expected behavior
HTTPS requests using Schannel should work in the Windows sandbox when network access is allowed.
Actual behavior
Schannel HTTPS fails in the current sandboxed shell with SEC_E_NO_CREDENTIALS.
Related issue discovered during investigation
The offline firewall setup also appears broken:
setup_error.json contains:
{
"code": "helper_firewall_rule_create_or_add_failed",
"message": "SetRemotePorts failed: Error { code: HRESULT(0x80070057), message: \"Параметр задан неверно.\" }"
}That may be a separate Windows sandbox bug.
Suggested investigation areas
- Determine whether the active Windows shell sandbox path is using:
- dedicated sandbox users
- or a restricted-token-on-real-user path
- Compare the failing shell token/context with the successful
CodexSandboxOnline/CodexSandboxOfflinesessions. - Investigate what Schannel/SSPI state is missing in the restricted real-user sandbox context.
- Separately fix the incorrect env inheritance in the elevated sandbox path.
- Consider whether
#17458is a prerequisite or partial trigger for this issue, even if it is not the full root cause.
Activity
github-actions commentedon Apr 11, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
arandomhooman commentedon Jul 19, 2026
Still an issue.
Revolt3738 commentedon Jul 27, 2026
Additional reproduction: Schannel fails under
CodexSandboxOnlineI can reproduce this issue with the current Windows elevated sandbox.
Environment
26200.88940.146.0-alpha.3.1Sandbox identity
Unlike the restricted real-user context described in the original report, the current command process is running as the dedicated sandbox account:
Outside the sandbox, the same process runs as the normal Windows user with
CloudAPauthentication.USERPROFILEinside the sandbox still points to the normal user's profile directory rather than a dedicatedCodexSandboxOnlineprofile.Reproduction
Inside the sandbox:
Both fail before the TLS handshake:
This reproduces with:
Control tests
The same commands executed outside the sandbox succeed:
Node.js using OpenSSL succeeds inside the sandbox:
This rules out general DNS, TCP, firewall, certificate trust, and network access problems.
Additional checks:
CryptSvcandKeyIsoare runningerrors=[]Current conclusion
The failure is specific to Schannel/SSPI credential acquisition under the
CodexSandboxOnlinelogon context. The dedicated sandbox identity does not appear to have the per-user or logon state required for Schannel to acquire its default outbound credential handle.Because
network_access = true, standard Windows HTTPS clients should work inside the sandbox, or this limitation should be documented explicitly.bbingz commentedon Jul 28, 2026
Analysis: current elevated-sandbox path launches
CodexSandboxOnlinewithdwLogonFlags=0and no profile initialization anywhere — still present at current HEADIssue anchor: #17459, with the 2026-07-27 reproduction by @Revolt3738 on command runner
0.146.0-alpha.3.1(process identityCodexSandboxOnline,errors=[]from setup refresh, PowerShell 5.1 / 7.6.4 / Schannel curl all failing pre-handshake withSEC_E_NO_CREDENTIALS, Node/OpenSSL fine in the same sandbox).The current-source precondition for that reproduction is live (verified 2026-07-28 at
main=4c434651; paths below are undercodex-rs/):Setup creates the dedicated accounts without initializing a profile.
provision_sandbox_users→ensure_local_usercallsNetUserAdd(codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs:70-115,NetUserAddat :115). Nothing in the setup path callsLoadUserProfile.The elevated runner launches the dedicated account with
dwLogonFlags=0.CreateProcessWithLogonW(..., /*dwlogonflags*/ 0, ...)with the in-code comment "Sandbox users have no profile state that commands should inherit" (codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs:346-352). Microsoft's documentation forCreateProcessWithLogonWstates the profile is not loaded by default and callers needing normal HKCU state must useLOGON_WITH_PROFILE(or load it explicitly). A repo-wide grep confirmsLoadUserProfile,LOGON_WITH_PROFILE, andCreateEnvironmentBlockappear nowhere inwindows-sandbox-rs/src.The child then runs under a restricted token derived from that profile-less logon. The command runner derives the restricted token from its current dedicated-user token (
codex-rs/windows-sandbox-rs/src/bin/command_runner/win.rs:269-287) and spawns the child viaCreateProcessAsUserW(codex-rs/windows-sandbox-rs/src/conpty/mod.rs:146-158). The restricted token still usesDISABLE_MAX_PRIVILEGE | LUA_TOKEN | WRITE_RESTRICTED(codex-rs/windows-sandbox-rs/src/token.rs:480).No test coverage on this axis.
token_tests.rsasserts restricting-SID presence only; nothing exercises Schannel credential acquisition, profile loading, or HTTPS from inside the sandbox.Honest causal boundary. The bug and the current no-profile launch precondition are high-confidence; the exact SSPI causality is not proven:
SEC_E_NO_CREDENTIALSis a credential-acquisition failure, but that alone doesn't identify which missing profile/logon/token property causes it in each mode.AcquireCredentialsHandlecall lives in external child software (curl/PowerShell/Git), not in Codex itself; the repo contains no Schannel/SSPI handling at all.So this is not a claim that restoring
LOGON_WITH_PROFILEfixes everything. A definitive fix decision needs a Windows A/B matrix:dwLogonFlags=0baseline;LOGON_WITH_PROFILE;LoadUserProfile/CreateEnvironmentBlock;AcquireCredentialsHandle+ HTTPS behavior and inspectUSERPROFILE/HKCU in the child.For completeness: merged PR #27944 (stale-credential recovery) touches this same launch call but only handles
ERROR_LOGON_FAILUREretry — it doesn't change profile loading.Analysis only; no PR attached per contribution policy.
No unsolicited PR from me; happy to refine or draft fail-first tests if maintainers invite a fix direction.
Root-cause hypothesis: see mechanism chain above.
EvilHumphrey commentedon Jul 31, 2026
Additional reproduction: a nested Codex CLI loses both Windows TLS credentials and the host ChatGPT login
Reproduced on 2026-07-31 after restarting the app.
Environment
2620026.721.11231.00.146.0-alpha.3.1sandbox_mode = "workspace-write"[windows] sandbox = "elevated"sandbox_workspace_write.network_access = trueon-requestReproduction and controls
A shell command launched by Codex Desktop runs as:
Schannel HTTPS fails before the handshake:
The configured CLI under that sandbox identity has no usable cached login:
The exact same CLI outside the Desktop sandbox, under the normal Windows user, reports:
Launching a second
codex execfrom the Desktop sandbox fails on both WebSocket and HTTP fallback with:Setting
CODEX_CA_CERTIFICATEto a valid PEM CA bundle changes the failure rather than fixing it: TLS reaches the service, then the nested CLI receives HTTP401 Missing bearer or basic authentication. This separates the certificate-trust problem from the missing-login problem.Launching the exact same non-sensitive, read-only
codex execthrough an explicitly approved host boundary succeeds. Two clean control runs returned exactly:Adding the intended workspace roots and restarting with the elevated Windows sandbox fixed split-root file patching, but did not change the
CodexSandboxOfflineTLS/login behavior.Impact
Codex Desktop cannot directly launch an authenticated child Codex CLI from its sandbox, even though the Desktop app and host CLI are already signed in. The safe current workaround is to approve a host-boundary launch and then keep the child CLI inside its own read-only/workspace-write sandbox.
Expected behavior / product question
Either:
codex execworkflows.Copying
auth.json, injecting long-lived tokens, or disabling TLS verification would weaken the security boundary and should not be necessary.Related: #21470 and #31073. Matching in-app feedback with logs was submitted. Feedback ID:
019fb996-7f0e-7421-9136-2083b18cf271.bbingz commentedon Aug 20, 2026
Analysis (community)
@EvilHumphrey — your nested Codex CLI case (app
26.721.11231.0, CLI0.146.0-alpha.3.1, elevated sandbox,network_access = true) is the same launch precondition I posted on #17459, plus a second symptom (host ChatGPT login missing inside the nested CLI).Root-cause hypothesis (re-checked 2026-08-20 at
main3b45c2906): the elevated runner still startsCodexSandboxOnlinewith no profile load. Microsoft TLS/Schannel then failsAcquireCredentialsHandle(SEC_E_NO_CREDENTIALS). A nested CLI in that identity can also fail to see the host login store for the same reason: HKCU/profile/logon state was never initialized.Still live:
CreateProcessWithLogonW(..., /*dwlogonflags*/ 0, ...)with the comment that sandbox users have no profile state (codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs:348-352).NetUserAdds the dedicated account withoutLoadUserProfile(sandbox_users.rsprovision path).LOGON_WITH_PROFILE/LoadUserProfilestill absent underwindows-sandbox-rs/src.Honest boundary (unchanged): this does not prove that
LOGON_WITH_PROFILEalone fixes every mode. #17458 already showed profile directories can exist and Schannel can still fail. Nested CLI losing ChatGPT login is consistent with missing HKCU, but I have not A/B'd that on Windows here.No unsolicited PR. Useful A/B if anyone has a Windows box: current
dwLogonFlags=0vsLOGON_WITH_PROFILEvs explicitLoadUserProfile, asserting both Schannel HTTPS and whether~/.codex/host login files are visible to the nested CLI.braze-taffo commentedon Aug 20, 2026
Additional current reproduction: both elevated and unelevated restricted tokens fail Schannel
I independently reproduced this issue on 2026-08-20 with the current native Windows sandbox.
Environment
2620026.814.5517.00.148.0-alpha.15sandbox_mode = "workspace-write"sandbox_workspace_write.network_access = true[windows] sandbox = "elevated"[windows] sandbox = "unelevated"Reproduction matrix
IsTokenRestricted=FalseCodexSandboxOnline)IsTokenRestricted=TrueSEC_E_NO_CREDENTIALSIsTokenRestricted=TrueSEC_E_NO_CREDENTIALSThe failing commands include:
The curl failure is:
A Node.js HTTPS request to the same destination succeeds from the same sandboxed process context.
Additional controls:
curl.execommands succeed outside the sandbox.errors=[]).Diagnostic implication
This reproduction follows the restricted sandbox token in both native sandbox implementations:
CodexSandboxOnlineidentity.That makes missing dedicated-user profile state a plausible contributing factor for elevated mode, but not a complete explanation by itself. The shared condition across both failing modes is the restricted token, while the success of Node/OpenSSL rules out a general DNS, TCP, firewall, or certificate-trust failure.
A useful next A/B would be to vary the restricted-token flags and restricting SID set one at a time, while separately testing profile loading (
LOGON_WITH_PROFILE/LoadUserProfile) and asserting SchannelAcquireCredentialsHandlebehavior.No credentials, private repository names, or user-specific paths are included in this report.
bbingz commentedon Aug 21, 2026
Analysis (community)
@braze-taffo — your 2026-08-20 matrix on #17459 (Desktop
26.814.5517.0, CLI0.148.0-alpha.15) is the first public split I have seen that unconfounds missing profile from restricted-token. Both elevatedCodexSandboxOnlineand unelevated (real-user identity) fail Schannel withSEC_E_NO_CREDENTIALSwhileIsTokenRestricted=True; the unrestricted host process succeeds; Node.js HTTPS in the same sandboxed process succeeds. That is a different residual than the nested-CLI / no-profile note I posted earlier.Root-cause hypothesis (re-checked 2026-08-21 at
main536f86e5c): Schannel/AcquireCredentialsHandleis breaking on the restricted token, not only on a missingCodexSandboxOnlineprofile. Unelevated never callsCreateProcessWithLogonW. It takes the interactive user’s token, runsCreateRestrictedTokenwithDISABLE_MAX_PRIVILEGE | LUA_TOKEN | WRITE_RESTRICTED, thenCreateProcessAsUserW. The child is still the signed-in user (so HKCU/profile can exist) and stillIsTokenRestricted=True. That matches your unelevated row. Node/OpenSSL never talk to Schannel, so they stay green in every row.Live path (paths under
codex-rs/):CreateRestrictedTokenflags areDISABLE_MAX_PRIVILEGE | LUA_TOKEN | WRITE_RESTRICTED(windows-sandbox-rs/src/token.rs:42-44, 480-483). The restricting SID list is capabilities + logon + Everyone (:461-477). Spawn isCreateProcessAsUserW(windows-sandbox-rs/src/process.rs:153-165), notCreateProcessWithLogonW. Repo grep:LOGON_WITH_PROFILE/LoadUserProfilestill absent underwindows-sandbox-rs/src.CreateProcessWithLogonW(..., /*dwlogonflags*/ 0, ...)with the comment that sandbox users have no profile state (windows-sandbox-rs/src/elevated/runner_client.rs:346-352). After that logon the command runner still derives a restricted token with the same three flags. So elevated is no profile plus restricted token; unelevated is real profile plus restricted token. Your matrix says both fail Schannel, which is why I no longer treatdwLogonFlags=0as the only live precondition.WRITE_RESTRICTEDplus extra restricting SIDs is the most plausible Schannel/CAPI break, but Windows sandbox users are created but their profiles are not initialized until manual first logon #17458 already showed “profile directory exists” is not sufficient. Node succeeding is TLS-stack evidence, not a proof thatnetwork_access = trueis a no-op (the capability SID is still attached).No unsolicited PR. Useful next A/B if anyone has a Windows host: same
workspace-write+network_access = truecommand under (a) current restricted token, (b) restricted token withoutWRITE_RESTRICTED, (c) unrestrictedCreateProcessAsUserWof the same user, assertingInvoke-WebRequest/curl.exeSchannel vs Node HTTPS. ElevateddwLogonFlags=0vsLOGON_WITH_PROFILEremains a second axis, not a replacement for (a)–(c).docs: record 2026-09-04 upstream sandbox review
Qin-14 commentedon Sep 11, 2026
Additional A/B evidence from two Windows 11 systems (build 26200) using Codex CLI 0.153.4 / Codex Desktop, with
sandbox_mode = "workspace-write"and network access enabled.I am reporting observations, not claiming a definitive root cause:
CodexSandboxOnlinecontext on both machines,ProfileRegistered = FalseandHiveLoaded = False.USERPROFILEstill points at the host profile path. This is a profile/context observation only; it does not prove which SSPI or token property is causal.chatgpt.comsucceed. However, Schannel curl fails withSEC_E_NO_CREDENTIALS (0x8009030e)/AcquireCredentialsHandle failed.codex doctoralso reports WebSocket TLS and provider reachability failures.chatgpt.comand receivesHTTP 403from Cloudflare. The normal host PowerShell curl control also completes TLS and receives an HTTP 403. So this is not a general DNS, TCP, or outbound HTTPS failure.gh auth statusreports a valid Windows-keyring login, while sandboxgh auth statusreports the default token as invalid. This is separate evidence; it does not by itself prove the same cause as the Schannel failure.gh repo view <private-repo>succeeded, andgit ls-remote originagainst that private repository returned HEAD andrefs/heads/main. Browser-based GitHub login, private-repository creation, and a baseline push also succeeded previously.The current boundary therefore appears narrower than “network/GitHub authentication is broken”: Node/OpenSSL HTTPS and some Git credential paths work, while particular restricted Windows sandbox contexts and credential/TLS consumers fail. The two-machine reproduction supports that this is not isolated to one host, but I do not have an A/B result that identifies the exact internal cause.
cyjxl0507 commentedon Sep 11, 2026
Additional Windows 10 reproduction: four public HTTPS destinations fail in sandbox, all succeed through an approved host execution
Observed on 2026-09-11 in the Codex desktop app.
Environment
workspace-write; failures reproduced with network access both restricted and enabled.Read-only comparison
The same PowerShell HEAD requests were executed inside the sandbox and then through an explicitly user-approved execution outside it:
Request form:
DNS resolution succeeded for all four hosts in both contexts. The sandboxed batch failed quickly (under one second of reported command execution), rather than hitting the 12-second timeouts.
Exception chain:
An earlier actual ZIP download in this same session also failed with Windows curl:
PowerShell download likewise failed inside the sandbox, then succeeded through user-approved outside-sandbox execution. Subsequent permission changes that still retained workspace sandboxing did not resolve the HEAD failures, including a configuration reporting network access enabled.
Limits / diagnostic value
No certificate verification was disabled, and no certificate or proxy configuration was changed for this comparison. CC Switch is also used on this machine, but we did not establish that these requests traverse it and did not perform a CC Switch on/off comparison; this report does not attribute the failure to it or conclusively exclude it.
We did not inspect token flags/profile loading or run the Node/Python comparison reported by others. The concrete evidence is that the same public HTTPS operations fail with the Windows credential/TLS error in the sandbox and succeed across the approved host boundary. Please include Windows 10 in investigation of this failure mode.
hey-miro commentedon Sep 24, 2026
还没打算修复吗,难顶啊
psychodissection-ship-it commentedon Oct 2, 2026
Additional reproduction: restricting SID alone reproduces Schannel failure without invoking Codex
Observed on 2026-10-03, Windows 11 Home Insider Preview 10.0.26220. Bundled Codex CLI: 0.159.0-alpha.12.1.
The same system curl succeeds on the host and fails in the native Windows workspace sandbox with
SEC_E_NO_CREDENTIALS (0x8009030e). Both elevated and unelevated sandbox modes reproduce. Forcing TLS 1.2 does not resolve it. Certificate-verified Python HTTPS succeeds in the sandbox.To separate Codex account provisioning from the restricted-token behavior, I ran a standalone ctypes harness under the normal user. It uses
CreateRestrictedTokenandImpersonateLoggedOnUser, then calls SchannelAcquireCredentialsHandleW. It does not invoke Codex, create accounts, change profile or registry permissions, or connect to a remote server. DLLs and forwarded function pointers are resolved before impersonation to avoid unrelated DLL-read failures.An explicit SCHANNEL_CRED v4 with SCH_CRED_NO_DEFAULT_CREDS and SCH_USE_STRONG_CRYPTO also fails when a restricting SID is present. LsaConnectUntrusted succeeds in all cases. NTLM and Negotiate outbound default-credential acquisition return the same failure in the restricted cases.
This establishes the restricting-SID interaction on this machine. It does not establish whether the behavior is an intentional Windows restriction, a Windows defect, or a Codex compatibility limitation. The Insider build is an environment fact, not a proven cause.
As a functional alternative, official curl 8.22.0 with LibreSSL succeeds inside the sandbox when supplied with the current sandbox's public trusted CA certificates from Python's default SSL context. The bundled Mozilla CA list alone succeeds on the host but does not validate the sandbox connection on this machine. No new Windows trust was imported, private keys were not exported, and verification remained enabled.
The alternative also passed the actual Work command path: HTTP/2 200, exit 0. Offline networking remained blocked; an attempted write outside the workspace remained blocked. This is a workaround, not a native Schannel repair.
Can the Windows sandbox maintainers confirm whether SSPI is expected to reject these restricted tokens, and whether a non-Schannel HTTPS client is the supported route while this remains unresolved? Is there a planned sandbox-native solution for PowerShell/.NET HTTPS that preserves filesystem and network isolation?
I have a portable two-file Python reproduction and captured result matrix available. This report contains no local username, computer name, private project path, credentials, image assets, or private repository URLs.
fix:Windows 上给 Codex 的说明写明沙箱里 Schannel HTTPS 会失败,联网改用 Node / Python
dennev commentedon Nov 11, 2026
The legacy
elevatedandunelevatedsandboxes still fail; under MXC, Schannel works on the same machineTested on 2026-11-11 on one x64 Windows 11 Pro 26H2 machine (10.0.26300.9711). The credential probe at the end runs locally with
codex sandbox, without a model call or network access.In short:
elevatedon 0.167.0-alpha.3.2, and inunelevatedon 0.167.0-alpha.3.2, 0.167.1 and 0.169.0-alpha.11 (the latest release and pre-release on 2026-11-11).curl.exeandInvoke-WebRequestdownload over HTTPS withnetwork_access=true.[windows] sandbox = "elevated"saved and nofeatures.prefer_mxc, and the CLI used the legacy sandbox although the documentation'sMXC_OKtest passes here. With-c features.prefer_mxc=true, the setting the Windows sandbox documentation gives for standalone CLI use (codex features listshows it as under development), the process got an AppContainer token and the probe succeeded.codex -c windows.sandbox=mxc sandbox --include-managed-config ..., the form of the documentation's one-command test, gave the same result.1. The three implementations
Base command:
codex sandbox -P :workspace -C <probe-folder> -- pwsh -NoProfile -File probe.ps1. The implementation came from the savedwindows.sandbox = "elevated"(no option), fromcodex sandbox -c 'windows.sandbox="unelevated"' ..., or fromcodex -c windows.sandbox=mxc sandbox --include-managed-config .... "Schannel" meansMicrosoft Unified Security Protocol ProviderwithSCHANNEL_CREDversion 4;dwFlags=0x18(SCH_CRED_NO_DEFAULT_CREDS | SCH_CRED_MANUAL_CRED_VALIDATION) anddwFlags=0gave the same value in every row.elevatedcodex.exebundled with the desktop app, run from a terminal)0x8009030E0x8009030E0x8009030Eunelevated0x8009030E0x8009030E0x8009030Emxc0x000000000x000000000x000000000x000000000x000000000x00000000Not run:
elevatedandmxcwith the 0.167.1 and 0.169.0-alpha.11 release binaries (those two ranunelevatedonly, withCODEX_HOMEset to an empty folder), and the desktop app's own sessions. Thecodex-rs/windows-sandbox-rstree ofrust-v0.169.0-alpha.11is identical to the one onmainate58bf8f(same git tree hash), andtoken.rsis unchanged betweenrust-v0.167.0-alpha.3.2,rust-v0.167.1andmain.Model-driven runs on 0.167.0-alpha.3.2 with
codex exec -s workspace-write -c sandbox_workspace_write.network_access=true:elevated(saved configuration):curl.exeprintscurl: (35) schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030e)followed by the system's message text, also with--ssl-no-revoke;Invoke-WebRequestfails withWin32Exception (0x8009030E)inSslStreamPal.AcquireCredentialsHandle; plain HTTP returns 200; HTTPS through Pythonurllib, Nodefetchand Bunfetchreturns 200.-c features.prefer_mxc=true:curl.exeandInvoke-WebRequestboth return 200 over HTTPS, and a write outside the workspace is refused.2. The restricting-SID result, repeated
The legacy rows above repeat the elevated/unelevated matrix, and a separate harness on this machine (
CreateRestrictedToken,ImpersonateLoggedOnUser, SchannelAcquireCredentialsHandleWwithSCHANNEL_CREDversion 4,dwFlags=0x18) repeated the restricting-SID result: a copy of the signed-in user's token with one restricting SID (Everyone) gives0x8009030E. One control is new:DISABLE_MAX_PRIVILEGE | LUA_TOKEN | WRITE_RESTRICTED(0x0D, the flagstoken.rspasses) without a restricting SID returns0x00000000in this harness.In
unelevatedmode the process used the signed-in user's own interactive logon session (the logon ID matched the desktop session), had four restricting SIDs, and failed the same way, so the failure reproduces without a separate sandbox account or logon session.3. What Windows declares for these packages
EnumerateSecurityPackagesWon this build:fCapabilitiesSECPKG_FLAG_RESTRICTED_TOKENS(0x80000)SECPKG_FLAG_APPCONTAINER_PASSTHROUGH(0x400000)0x004107B30x00883BB30x028F3BBF0x02882B37Microsoft documents the first flag as "Supports callers with restricted tokens" and the second as "This package receives all calls from app container apps" (SecPkgInfo). That is consistent with the table in section 1: Schannel fails for the restricted tokens of the legacy sandboxes and works for MXC's AppContainer token. I found no Microsoft page that says what a package does with a restricted-token caller or that ties
SEC_E_NO_CREDENTIALSto restricted tokens, so whether this is an intentional Windows restriction, the question raised in the restricting-SID comment, stays open: the flags make it plausible but do not show it. The flag is also not the whole story, because Negotiate and NTLM declare it and still returnSEC_E_NO_CREDENTIALSfor default outbound credentials in the legacy rows of section 1.So on this machine, with 0.167.0-alpha.3.2 and full network access, selecting MXC avoided the
SEC_E_NO_CREDENTIALSfailure. I did not test MXC with the managed network proxy, for which #53276 reports a different Schannel failure (certificate chain and revocation). The two legacy implementations still fail, which matters where MXC is unavailable, disabled by policy or does not start.probe.ps1 (PowerShell 7; prints four results; an SSPI failure does not set a nonzero exit code)
I can share the token-variant and package-enumeration harnesses if useful.
lywaterman commentedon Nov 18, 2026
Another data point on
codex-cli 0.162.0(source checked atrust-v0.162.0,1f3f9347), Windows 10 x64 19045. It suggests the trigger is the restricted token, not only a missing profile.Setup: native unelevated sandbox, run from a normal non-admin terminal (interactive Limited token, not
runas /trustlevel). Fresh scratchCODEX_HOMEand workspace. Permission profileextends = ":workspace"with[permissions.<p>.network] enabled = true.Results:
--ssl-no-revokeor--no-ssl-auto-client-cert. PowerShellInvoke-WebRequestfails with the same "no credentials" error. Pythonurllib(OpenSSL 3.0.16) returns 200, with certificate verification on.command/execwithdangerFullAccessalso returns 200.The profile is loaded in the failing case:
whoami/ WindowsIdentity show the same signed-in user inside and outside.USERPROFILEis the real profile, and HKCU Volatile Environment exists in both.The token differs: Win32
IsTokenRestrictedis True in the failing sandbox and False in the working control. At the pin,windows-sandbox-rs/src/spawn_prep.rsuses the current user token for the unelevated path, andtoken.rsappliesDISABLE_MAX_PRIVILEGE | LUA_TOKEN | WRITE_RESTRICTED.So for the unelevated path, Schannel credential acquisition seems to fail under the write-restricted token even with the user profile loaded (compare #50582). OpenSSL-based clients are unaffected.
MXC: we also tried the pinned MXC backend. It returns
failed to prepare MXC sandbox: native MXC is unavailable on this executor.