openai/codex · error · anyhow::Error
`codex sandbox` is not supported on this operating system
Error message
`codex sandbox` is not supported on this operating system
What it means
The `codex sandbox` subcommand is gated by cfg attributes to macOS (Seatbelt), Linux (Landlock), and Windows; on any other operating system the platform-specific sandbox runners are not compiled and the CLI rejects the command at the fallthrough arm.
Solutions
- Run `codex sandbox` on macOS, Linux, or Windows where a sandbox backend exists
- Use an OS-level sandboxing tool supported by your platform instead
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/cli/src/main.rs:1669 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/ff0fcd777ed8ee6b.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/cli/src/main.rs:1669
.await?;
#[cfg(target_os = "linux")]
codex_cli::run_command_under_landlock(
sandbox_cli,
arg0_paths.codex_linux_sandbox_exe.clone(),
loader_overrides,
)
.await?;
#[cfg(target_os = "windows")]
codex_cli::run_command_under_windows_sandbox(
sandbox_cli,
arg0_paths.codex_linux_sandbox_exe.clone(),
loader_overrides,
)
.await?;
#[cfg(not(any(target_os = "macos", target_os = "linux", target_os = "windows")))]
{
let _ = loader_overrides;
anyhow::bail!("`codex sandbox` is not supported on this operating system");
}
}
Some(Subcommand::Debug(DebugCommand { subcommand })) => match subcommand {
DebugSubcommand::Models(cmd) => {
reject_remote_mode_for_subcommand(
root_remote.as_deref(),
root_remote_auth_token_env.as_deref(),
"debug models",
)?;
run_debug_models_command(cmd, root_config_overrides).await?;
}
DebugSubcommand::AppServer(cmd) => {
reject_remote_mode_for_subcommand(
root_remote.as_deref(),
root_remote_auth_token_env.as_deref(),
"debug app-server",
)?;
run_debug_app_server_command(cmd).await?;View on GitHub (pinned to 339751715c)