openai/codex · error · anyhow::Error

Seatbelt sandbox is only available on macOS

Error message

Seatbelt sandbox is only available on macOS

What it means

Compile-time stub of run_command_under_seatbelt for non-macOS platforms: the Seatbelt sandbox relies on macOS sandbox-exec, so any attempt to invoke it elsewhere hits this unconditional bail. It is a platform guard, not a runtime failure.

Solutions

  1. Run Seatbelt sandboxing only on macOS
  2. On Linux use the Landlock sandbox instead
  3. On Windows use the Windows sandbox backend
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/cli/src/debug_sandbox.rs:92 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/ee5ceffc6382beef. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/cli/src/debug_sandbox.rs:92

            loader_overrides,
        },
        command,
        config_overrides,
        codex_linux_sandbox_exe,
        SandboxType::Seatbelt,
        log_denials,
        &allow_unix_sockets,
    )
    .await
}

#[cfg(not(target_os = "macos"))]
pub async fn run_command_under_seatbelt(
    _command: SeatbeltCommand,
    _codex_linux_sandbox_exe: Option<PathBuf>,
    _loader_overrides: LoaderOverrides,
) -> anyhow::Result<()> {
    anyhow::bail!("Seatbelt sandbox is only available on macOS");
}

pub async fn run_command_under_landlock(
    command: LandlockCommand,
    codex_linux_sandbox_exe: Option<PathBuf>,
    loader_overrides: LoaderOverrides,
) -> anyhow::Result<()> {
    let LandlockCommand {
        sandbox_state,
        permissions_profile,
        config_profile: _,
        cwd,
        include_managed_config,
        config_overrides,
        command,
    } = command;
    let managed_requirements_mode = ManagedRequirementsMode::for_profile_invocation(
        &permissions_profile,

View on GitHub (pinned to 339751715c)