Paste an error to match it against the wiki. / 粘贴报错后自动匹配。
Error text / 报错原文
CreateProcessWithLogonW failed: 5
What it means
Codex attempted to start a sandboxed command on Windows and received access denied from the operating system.
Most common causes
- Windows account policy blocks the logon method used by the sandbox
- The workspace is under a restricted directory
- Security software prevents the helper process from launching
- Native Windows sandbox mode is incompatible with the current environment
Fastest fix
- Move the workspace under a normal user directory
- Try the documented Windows sandbox mode for your build
- Restart Codex after changing sandbox settings
- Run a simple command like whoami before a full agent task
Safe fix
- Keep workspace paths narrow and Git-backed
- Use WSL for Linux-heavy projects
- Audit local security policy instead of disabling protection wholesale
- Capture sandbox logs before changing permissions
What not to do
- Do not grant broad write access to C:\ or WindowsApps
- Do not run arbitrary project commands elevated
- Do not turn off antivirus globally
How to confirm the fix
Run the smallest reproducible command first, then retry the agent task only after authentication, quota, and tool discovery are stable.
whoami /all Get-Location Get-ChildItem $env:USERPROFILE\.codex -Recurse -Filter *sandbox*
Related errors
- code=3221225477 - Codex Windows desktop crashes on launch →
- SetNamedSecurityInfoW failed: 5 - Codex WindowsApps ACL sandbox failure →
- MCP auth session does not refresh - Codex OAuth →
- Codex desktop unresponsive with long threads and MCP auto-start duplicates →
- You've hit your session limit / weekly limit - Claude Code →
- Prompt is too long - Claude Code context window →