openai/codex · error · SandboxErr

Landlock was not able to fully enforce all sandbox rules

Error message

Landlock was not able to fully enforce all sandbox rules

What it means

Linux-only error raised during sandbox setup when the Landlock LSM could not apply the full set of filesystem access restrictions requested for the session. It fires on kernels or filesystems with partial/no Landlock support, meaning the command would run with weaker isolation than configured.

Solutions

  1. Run on a kernel 5.13+ with Landlock enabled (check /sys/kernel/security/lsm)
  2. Use a different sandbox mode (e.g. seatbelt on macOS or another Linux mechanism) where Landlock is unavailable
  3. Avoid filesystems that do not support Landlock for the working directory
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at codex-rs/protocol/src/error.rs:66 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/2ccb21870f4f32cd. Report an issue: GitHub.

Appendix: source

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

    #[cfg(target_os = "linux")]
    #[error("seccomp setup error")]
    SeccompInstall(#[from] seccompiler::Error),

    /// Error from linux seccomp backend
    #[cfg(target_os = "linux")]
    #[error("seccomp backend error")]
    SeccompBackend(#[from] seccompiler::BackendError),

    /// Command timed out
    #[error("command timed out")]
    Timeout { output: Box<ExecToolCallOutput> },

    /// Command was killed by a signal
    #[error("command was killed by a signal")]
    Signal(i32),

    /// Error from linux landlock
    #[error("Landlock was not able to fully enforce all sandbox rules")]
    LandlockRestrict,
}

pub struct CodexErr {
    details: CodexErrorDetails,
    retry_delay: Option<Duration>,
}

/// The semantic category and diagnostic payload for a [`CodexErr`].
#[derive(Error, Debug, EnumDiscriminants)]
#[strum_discriminants(name(CodexErrKind))]
#[strum_discriminants(derive(serde::Serialize))]
#[strum_discriminants(serde(rename_all = "snake_case"))]
#[strum_discriminants(doc = "The payload-free semantic category used for analytics.")]
pub enum CodexErrorDetails {
    #[error("turn aborted. Something went wrong? Hit `/feedback` to report the issue.")]
    TurnAborted,

View on GitHub (pinned to 339751715c)