Windows: PowerShell fails with error 8009001d (NTE_PROVIDER_DLL_FAIL) in sandbox

Open 💬 5 comments Opened Mar 9, 2026 by eiei114

Description

On Windows 11 (10.0.26200), Codex CLI v0.111.0 always uses powershell.exe as the shell for command execution. However, PowerShell fails to start with error 8009001d (NTE_PROVIDER_DLL_FAIL - cryptographic provider DLL initialization failure) when spawned by Codex.

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Codex CLI: v0.111.0
  • PowerShell: 5.1.26100.7705
  • Node: via npm global install

Steps to Reproduce

  1. Install codex-cli on Windows
  2. Run any command:

``
codex exec --full-auto "echo hello"
``

  1. Observe that all PowerShell invocations fail with:

``
Windows PowerShell のキャリブレーションがエラー 8009001d で失敗しました
``

Key Findings

  • powershell.exe -NoProfile -Command "echo test" works fine when called from bash/cmd directly
  • codex sandbox windows -- powershell.exe -NoProfile -Command "echo test" fails with 8009001d
  • codex sandbox windows -- cmd.exe /c "echo test" works fine
  • Error persists with ALL sandbox modes: read-only, workspace-write, danger-full-access
  • Error persists with both [windows] sandbox = "elevated" and "unelevated" config
  • Error persists with --dangerously-bypass-approvals-and-sandbox

Root Cause Analysis

The Windows restricted token created by Codex's sandbox (even in full-access mode) appears to strip privileges or SIDs required by PowerShell's cryptographic service provider initialization. Error 0x8009001d (NTE_PROVIDER_DLL_FAIL) indicates the RSA/AES crypto provider DLL cannot initialize under the restricted process token.

Since cmd.exe doesn't require cryptographic services, it works fine under the same restricted token.

Current Workaround

The model (gpt-5.3-codex) can self-correct by falling back to cmd.exe /c commands after PowerShell failure, but this wastes tokens on every session. Adding instructions to AGENTS.md to prefer cmd.exe helps.

Expected Behavior

Either:

  1. Codex should use cmd.exe as the default shell on Windows (since PowerShell requires crypto providers that the restricted token blocks)
  2. Or the restricted token should preserve the privileges needed for PowerShell crypto initialization
  3. Or provide a config option to select the shell (e.g., [windows] shell = "cmd")

Feature Flags

Relevant feature flags from codex features list:

  • elevated_windows_sandbox: removed
  • experimental_windows_sandbox: removed
  • powershell_utf8: stable (true)
  • shell_tool: stable (true)

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗