Windows sandbox HTTPS via Schannel fails with `SEC_E_NO_CREDENTIALS`
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.org
Observed:
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.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #17458
Powered by Codex Action
Still an issue.
Additional reproduction: Schannel fails under CodexSandboxOnline
I can reproduce this issue with the current Windows elevated sandbox.
Environment
- Windows 11 25H2, build
26200.8894 - Codex command runner
0.146.0-alpha.3.1 - Native Windows sandbox:
[windows]
sandbox = "elevated"
- Active project sandbox configuration:
sandbox_mode = "workspace-write"
[sandbox_workspace_write]
network_access = true
Sandbox identity
Unlike the restricted real-user context described in the original report, the current command process is running as the dedicated sandbox account:
Identity: <machine>\CodexSandboxOnline
AuthenticationType: NTLM
Integrity level: Medium
Outside the sandbox, the same process runs as the normal Windows user with CloudAP authentication.
USERPROFILE inside the sandbox still points to the normal user's profile directory rather than a dedicated CodexSandboxOnline profile.
Reproduction
Inside the sandbox:
Invoke-RestMethod -Uri https://api.github.com/ -TimeoutSec 20
curl.exe -I https://www.microsoft.com/
Both fail before the TLS handshake:
SEC_E_NO_CREDENTIALS (0x8009030E)
schannel: AcquireCredentialsHandle failed
This reproduces with:
- Windows PowerShell 5.1
- PowerShell 7.6.4
- curl 8.21.0 using Schannel
- Explicitly forcing either TLS 1.2 or TLS 1.3
Control tests
The same commands executed outside the sandbox succeed:
Invoke-RestMethod: success
curl.exe: HTTP 200
Windows PowerShell 5.1: success
Node.js using OpenSSL succeeds inside the sandbox:
Node.js 24.18.0
OpenSSL 3.5.7
HTTP 200
This rules out general DNS, TCP, firewall, certificate trust, and network access problems.
Additional checks:
CryptSvcandKeyIsoare running- FIPS mode is disabled
- No cipher-suite or ECC policy overrides are configured
- 28 TLS cipher suites are available
- SHA-256, AES, RSA, and ECDH-P256 operations succeed
- The Microsoft RSA Schannel Cryptographic Provider opens successfully
- Sandbox setup refresh reports
errors=[]
Current conclusion
The failure is specific to Schannel/SSPI credential acquisition under the CodexSandboxOnline logon 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.
Analysis: current elevated-sandbox path launches CodexSandboxOnline with dwLogonFlags=0 and no profile initialization anywhere — still present at current HEAD
Issue anchor: #17459, with the 2026-07-27 reproduction by @Revolt3738 on command runner 0.146.0-alpha.3.1 (process identity CodexSandboxOnline, errors=[] from setup refresh, PowerShell 5.1 / 7.6.4 / Schannel curl all failing pre-handshake with SEC_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 under codex-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.- #17458 shows profile-directory existence alone can be insufficient (profiles present, still failing).
- The three restricted-token flags and the restricting-SID set remain confounded with the profile state — no per-flag A/B has ever been run.
- The failing
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_PROFILE fixes everything. A definitive fix decision needs a Windows A/B matrix:
- current
dwLogonFlags=0baseline; LOGON_WITH_PROFILE;- explicit
LoadUserProfile/CreateEnvironmentBlock; - the restricted-token flags varied one at a time;
- assert Schannel
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_FAILURE retry — 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.
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
- Windows 11, build
26200 - Codex app package
26.721.11231.0 - Codex CLI
0.146.0-alpha.3.1 sandbox_mode = "workspace-write"[windows] sandbox = "elevated"sandbox_workspace_write.network_access = true- approval policy
on-request
Reproduction and controls
-
A shell command launched by Codex Desktop runs as:
<machine>\CodexSandboxOffline -
Schannel HTTPS fails before the handshake:
curl: (35) schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030e) -
The configured CLI under that sandbox identity has no usable cached login:
codex login status Not logged in exit 1 -
The exact same CLI outside the Desktop sandbox, under the normal Windows user, reports:
codex login status Logged in using ChatGPT exit 0 -
Launching a second
codex execfrom the Desktop sandbox fails on both WebSocket and HTTP fallback with:native_root_error_count=1 invalid peer certificate: UnknownIssuer -
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:TLS_PROBE_OK RESTART_HOST_OK -
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:
- Schannel and the authenticated CLI should work under the documented Windows sandbox when network access is enabled; or
- Desktop should expose a supported, scoped host-launch/auth-brokering mechanism for nested
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.
Analysis (community)
@EvilHumphrey — your nested Codex CLI case (app 26.721.11231.0, CLI 0.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 main 3b45c2906): the elevated runner still starts CodexSandboxOnline with no profile load. Microsoft TLS/Schannel then fails AcquireCredentialsHandle (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).- Setup still
NetUserAdds the dedicated account withoutLoadUserProfile(sandbox_users.rsprovision path). - Repo grep:
LOGON_WITH_PROFILE/LoadUserProfilestill absent underwindows-sandbox-rs/src.
Honest boundary (unchanged): this does not prove that LOGON_WITH_PROFILE alone 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=0 vs LOGON_WITH_PROFILE vs explicit LoadUserProfile, asserting both Schannel HTTPS and whether ~/.codex/host login files are visible to the nested CLI.
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
- Windows 11, build
26200 - ChatGPT/Codex desktop package:
26.814.5517.0 - Codex CLI:
0.148.0-alpha.15 sandbox_mode = "workspace-write"sandbox_workspace_write.network_access = true- Tested both:
[windows] sandbox = "elevated"[windows] sandbox = "unelevated"
Reproduction matrix
| Execution context | Windows token | PowerShell / Schannel curl | Node.js HTTPS |
|---|---|---|---|
| Normal host process | IsTokenRestricted=False |
succeeds (HTTP 200) | succeeds |
Elevated Codex sandbox (CodexSandboxOnline) |
IsTokenRestricted=True |
fails with SEC_E_NO_CREDENTIALS |
succeeds (HTTP 200) |
| Unelevated Codex sandbox (normal user identity) | IsTokenRestricted=True |
fails with SEC_E_NO_CREDENTIALS |
succeeds (HTTP 200) |
The failing commands include:
Invoke-WebRequest -UseBasicParsing -Uri 'https://www.microsoft.com/'
curl.exe -I https://www.microsoft.com/
The curl failure is:
curl: (35) schannel: AcquireCredentialsHandle failed:
SEC_E_NO_CREDENTIALS (0x8009030e)
No credentials are available in the security package
A Node.js HTTPS request to the same destination succeeds from the same sandboxed process context.
Additional controls:
- DNS resolution succeeds.
- TCP connectivity to port 443 succeeds.
- The same PowerShell and
curl.execommands succeed outside the sandbox. - Elevated sandbox setup completed without reported errors (
errors=[]). - No Windows error 1385 or sandbox-user logon failure was observed.
Diagnostic implication
This reproduction follows the restricted sandbox token in both native sandbox implementations:
- Elevated mode reproduces under the dedicated
CodexSandboxOnlineidentity. - Unelevated mode reproduces under the normal Windows user identity.
- The normal host token does not reproduce it.
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 Schannel AcquireCredentialsHandle behavior.
No credentials, private repository names, or user-specific paths are included in this report.
Analysis (community)
@braze-taffo — your 2026-08-20 matrix on #17459 (Desktop 26.814.5517.0, CLI 0.148.0-alpha.15) is the first public split I have seen that unconfounds missing profile from restricted-token. Both elevated CodexSandboxOnline and unelevated (real-user identity) fail Schannel with SEC_E_NO_CREDENTIALS while IsTokenRestricted=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 main 536f86e5c): Schannel/AcquireCredentialsHandle is breaking on the restricted token, not only on a missing CodexSandboxOnline profile. Unelevated never calls CreateProcessWithLogonW. It takes the interactive user’s token, runs CreateRestrictedToken with DISABLE_MAX_PRIVILEGE | LUA_TOKEN | WRITE_RESTRICTED, then CreateProcessAsUserW. The child is still the signed-in user (so HKCU/profile can exist) and still IsTokenRestricted=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/):
- Unelevated / restricted-token spawn (your new row).
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. - Elevated / dedicated-account spawn (previous row). Still
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. - What this does not prove. I have not A/B’d the three flags one at a time on a Windows box.
WRITE_RESTRICTEDplus extra restricting SIDs is the most plausible Schannel/CAPI break, but #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 = true command under (a) current restricted token, (b) restricted token without WRITE_RESTRICTED, (c) unrestricted CreateProcessAsUserW of the same user, asserting Invoke-WebRequest / curl.exe Schannel vs Node HTTPS. Elevated dwLogonFlags=0 vs LOGON_WITH_PROFILE remains a second axis, not a replacement for (a)–(c).
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:
- In the
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. - Inside that sandbox, DNS resolution and TCP/443 connectivity to
chatgpt.comsucceed. However, Schannel curl fails withSEC_E_NO_CREDENTIALS (0x8009030e)/AcquireCredentialsHandle failed.codex doctoralso reports WebSocket TLS and provider reachability failures. - In the same sandbox, Node.js (OpenSSL 3.5.7) successfully performs HTTPS to
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. - There is also a credential-context discrepancy: host
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. - Importantly, GitHub access is not universally broken. Through an authorized/system execution path,
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.
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
- Windows reported by PowerShell: Microsoft Windows 10.0.19045.
- PowerShell Core 7.6.5.
- Effective task settings included
workspace-write; failures reproduced with network access both restricted and enabled. - Exact desktop package / bundled runner version was not established in this test, so I am not inferring one.
Read-only comparison
The same PowerShell HEAD requests were executed inside the sandbox and then through an explicitly user-approved execution outside it:
| URL | Sandboxed PowerShell | Approved outside-sandbox execution |
|---|---|---|
| https://github.com | SSL/authentication failure | HTTP 200 |
| https://api.github.com | SSL/authentication failure | HTTP 200 |
| https://codeload.github.com/alchaincyf/darwin-skill/zip/5539516444cff4eed7865daf61a707590acda485 | SSL/authentication failure | HTTP 200 |
| https://registry.npmjs.org/skills | SSL/authentication failure | HTTP 200 |
Request form:
Invoke-WebRequest -Uri $url -Method Head -TimeoutSec 12
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:
The SSL connection could not be established, see inner exception.
Authentication failed, see inner exception.
安全包中没有可用的凭证
(No credentials are available in the security package)
An earlier actual ZIP download in this same session also failed with Windows curl:
curl: (35) schannel: AcquireCredentialsHandle failed:
SEC_E_NO_CREDENTIALS (0x8009030E)
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.
还没打算修复吗,难顶啊
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 CreateRestrictedToken and ImpersonateLoggedOnUser, then calls Schannel AcquireCredentialsHandleW. 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.
| Token change | Schannel result |
|---|---|
| Original normal-user token | SEC_E_OK |
| DISABLE_MAX_PRIVILEGE alone, no restricting SID | SEC_E_OK |
| LUA_TOKEN alone, no restricting SID | SEC_E_OK |
| One restricting SID: Everyone, flags 0 | 0x8009030e |
| Same restricting SID, WRITE_RESTRICTED | 0x8009030e |
| Same restricting SID, combined flags 0x0D | 0x8009030e |
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.
The legacy elevated and unelevated sandboxes still fail; under MXC, Schannel works on the same machine
Tested 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:
- The failure still reproduces: in
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). - With the MXC implementation on the same machine (0.167.0-alpha.3.2 only), the same probe succeeds, and
curl.exeandInvoke-WebRequestdownload over HTTPS withnetwork_access=true. - This machine had
[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 saved windows.sandbox = "elevated" (no option), from codex sandbox -c 'windows.sandbox="unelevated"' ..., or from codex -c windows.sandbox=mxc sandbox --include-managed-config .... "Schannel" means Microsoft Unified Security Protocol Provider with SCHANNEL_CRED version 4; dwFlags=0x18 (SCH_CRED_NO_DEFAULT_CREDS | SCH_CRED_MANUAL_CRED_VALIDATION) and dwFlags=0 gave the same value in every row.
| Implementation | Codex CLI | Process token | Schannel | Negotiate | NTLM |
|---|---|---|---|---|---|
elevated |
0.167.0-alpha.3.2 (the codex.exe bundled with the desktop app, run from a terminal) |
restricted, 5 restricting SIDs, medium integrity | 0x8009030E |
0x8009030E |
0x8009030E |
unelevated |
0.167.0-alpha.3.2, 0.167.1, 0.169.0-alpha.11 | restricted, 4 restricting SIDs; medium integrity (integrity read on 0.167.0-alpha.3.2 only) | 0x8009030E |
0x8009030E |
0x8009030E |
mxc |
0.167.0-alpha.3.2 | AppContainer, not restricted, low integrity | 0x00000000 |
0x00000000 |
0x00000000 |
| none (signed-in user, outside the sandbox) | - | not restricted, medium integrity | 0x00000000 |
0x00000000 |
0x00000000 |
Not run: elevated and mxc with the 0.167.1 and 0.169.0-alpha.11 release binaries (those two ran unelevated only, with CODEX_HOME set to an empty folder), and the desktop app's own sessions. The codex-rs/windows-sandbox-rs tree of rust-v0.169.0-alpha.11 is identical to the one on main at e58bf8f (same git tree hash), and token.rs is unchanged between rust-v0.167.0-alpha.3.2, rust-v0.167.1 and main.
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.- the same command plus
-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, Schannel AcquireCredentialsHandleW with SCHANNEL_CRED version 4, dwFlags=0x18) repeated the restricting-SID result: a copy of the signed-in user's token with one restricting SID (Everyone) gives 0x8009030E. One control is new: DISABLE_MAX_PRIVILEGE | LUA_TOKEN | WRITE_RESTRICTED (0x0D, the flags token.rs passes) without a restricting SID returns 0x00000000 in this harness.
In unelevated mode 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
EnumerateSecurityPackagesW on this build:
| Package | fCapabilities |
SECPKG_FLAG_RESTRICTED_TOKENS (0x80000) |
SECPKG_FLAG_APPCONTAINER_PASSTHROUGH (0x400000) |
|---|---|---|---|
| Schannel, Microsoft Unified Security Protocol Provider, Default TLS SSP | 0x004107B3 |
not set | set |
| Negotiate | 0x00883BB3 |
set | not set |
| Kerberos | 0x028F3BBF |
set | not set |
| NTLM | 0x02882B37 |
set | not set |
Microsoft 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_CREDENTIALS to 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 return SEC_E_NO_CREDENTIALS for 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_CREDENTIALS failure. 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)
$src = @'
using System; using System.Runtime.InteropServices;
public static class Sspi {
[StructLayout(LayoutKind.Sequential)] public struct SecHandle { public IntPtr Lower; public IntPtr Upper; }
[StructLayout(LayoutKind.Sequential)] public struct TimeStamp { public uint Low; public int High; }
[StructLayout(LayoutKind.Sequential)] public struct SCHANNEL_CRED {
public int dwVersion; public int cCreds; public IntPtr paCred; public IntPtr hRootStore; public int cMappers; public IntPtr aphMappers;
public int cSupportedAlgs; public IntPtr palgSupportedAlgs; public int grbitEnabledProtocols; public int dwMinimumCipherStrength;
public int dwMaximumCipherStrength; public int dwSessionLifespan; public int dwFlags; public int dwCredFormat; }
[DllImport("secur32.dll", CharSet=CharSet.Unicode)] public static extern int AcquireCredentialsHandleW(string p, string pkg, int use, IntPtr luid, ref SCHANNEL_CRED a, IntPtr f, IntPtr arg, out SecHandle h, out TimeStamp t);
[DllImport("secur32.dll", CharSet=CharSet.Unicode, EntryPoint="AcquireCredentialsHandleW")] public static extern int AcquireNull(string p, string pkg, int use, IntPtr luid, IntPtr a, IntPtr f, IntPtr arg, out SecHandle h, out TimeStamp t);
[DllImport("secur32.dll")] public static extern int FreeCredentialsHandle(ref SecHandle h);
// SECPKG_CRED_OUTBOUND = 2; SCHANNEL_CRED_VERSION = 4; 0x18 = SCH_CRED_NO_DEFAULT_CREDS | SCH_CRED_MANUAL_CRED_VALIDATION
public static string Sch(int flags) { var c = new SCHANNEL_CRED(); c.dwVersion = 4; c.dwFlags = flags; SecHandle h; TimeStamp t;
int r = AcquireCredentialsHandleW(null, "Microsoft Unified Security Protocol Provider", 2, IntPtr.Zero, ref c, IntPtr.Zero, IntPtr.Zero, out h, out t);
if (r == 0) FreeCredentialsHandle(ref h); return "0x" + r.ToString("X8"); }
public static string Pkg(string pkg) { SecHandle h; TimeStamp t; int r = AcquireNull(null, pkg, 2, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, out h, out t);
if (r == 0) FreeCredentialsHandle(ref h); return "0x" + r.ToString("X8"); }
}
'@
Add-Type -TypeDefinition $src
"schannel NO_DEFAULT_CREDS|MANUAL_VALIDATION=" + [Sspi]::Sch(0x18)
"schannel flags 0=" + [Sspi]::Sch(0)
"negotiate outbound=" + [Sspi]::Pkg("Negotiate")
"ntlm outbound=" + [Sspi]::Pkg("NTLM")
I can share the token-variant and package-enumeration harnesses if useful.
Another data point on codex-cli 0.162.0 (source checked at rust-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 scratch CODEX_HOME and workspace. Permission profile extends = ":workspace" with [permissions.<p>.network] enabled = true.
codex sandbox -P <p> -C <scratch> cmd /c 'curl -sS -o NUL -w "%{http_code}" https://www.baidu.com'
# curl: (35) schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030E)
# 000
Results:
- Inside the same sandbox: curl (Schannel) fails, including with
--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. - Outside the sandbox, the same user gets 200 from curl, PowerShell and Python. app-server
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.- CurrentUser\My has zero client certs in both, including the working control.
The token differs: Win32 IsTokenRestricted is True in the failing sandbox and False in the working control. At the pin, windows-sandbox-rs/src/spawn_prep.rs uses the current user token for the unelevated path, and token.rs applies DISABLE_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.
How's it going?
Problem is still here!