openai/codex · error · CodexErr

sandbox error

Error message

sandbox error: {0}

What it means

Wrapper variant forwarding an inner sandbox-setup error (seccomp, seatbelt, Landlock, or policy backend). It fires when initializing the OS-level sandbox for a command fails; the inner error identifies which mechanism and why. Note this is distinct from the Linux-only seccomp/landlock variants in the exec error enum.

Solutions

  1. Inspect the inner error to identify the failing sandbox mechanism
  2. Run with a less restrictive sandbox mode (e.g. read-only instead of workspace-write) as a workaround
  3. Check OS support/permissions for the sandbox backend (Landlock/seccomp on Linux, sandbox-exec on macOS)
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at codex-rs/protocol/src/error.rs:156 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/436d443a69ea3c3e. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/protocol/src/error.rs:156

    ResponseStreamFailed(ResponseStreamFailed),
    #[error("{0}")]
    ConnectionFailed(ConnectionFailedError),
    #[error("Quota exceeded. Check your plan and billing details.")]
    QuotaExceeded,
    #[error(
        "To use Codex with your ChatGPT plan, upgrade to Plus: https://chatgpt.com/explore/plus."
    )]
    UsageNotIncluded,
    #[error("We're currently experiencing high demand, which may cause temporary errors.")]
    InternalServerError,
    /// Retry limit exceeded.
    #[error("{0}")]
    RetryLimit(RetryLimitReachedError),
    /// Agent loop died unexpectedly
    #[error("internal error; agent loop died unexpectedly")]
    InternalAgentDied,
    /// Sandbox error
    #[error("sandbox error: {0}")]
    Sandbox(#[from] SandboxErr),
    #[error("codex-linux-sandbox was required but not provided")]
    LandlockSandboxExecutableNotProvided,
    #[error("unsupported operation: {0}")]
    UnsupportedOperation(String),
    #[error("{0}")]
    RefreshTokenFailed(RefreshTokenFailedError),
    #[error("Fatal error: {0}")]
    Fatal(String),
    // -----------------------------------------------------------------
    // Automatic conversions for common external error types
    // -----------------------------------------------------------------
    #[error(transparent)]
    Io(#[from] io::Error),
    #[error(transparent)]
    Json(#[from] serde_json::Error),
    #[cfg(target_os = "linux")]
    #[error(transparent)]

View on GitHub (pinned to 339751715c)