openai/codex · error

missing required {SANDBOX_LEVEL_FLAG}

Error message

missing required {SANDBOX_LEVEL_FLAG}

What it means

Error "missing required {SANDBOX_LEVEL_FLAG}" thrown in openai/codex.

Source

Thrown at codex-rs/windows-sandbox-rs/src/wrapper.rs:305

    if !codex_home.is_absolute() {
        bail!(
            "{CODEX_HOME_FLAG} must be absolute: {}",
            codex_home.display()
        );
    }
    let command_cwd = command_cwd.ok_or_else(|| anyhow!("missing required {COMMAND_CWD_FLAG}"))?;
    if workspace_roots.is_empty() {
        workspace_roots.push(command_cwd.clone());
    }
    Ok(WindowsSandboxWrapperRequest {
        codex_home,
        command_cwd,
        workspace_roots,
        env_map: env_map.ok_or_else(|| anyhow!("missing required {ENV_JSON_FLAG}"))?,
        permission_profile: permission_profile
            .ok_or_else(|| anyhow!("missing required {PERMISSION_PROFILE_FLAG}"))?,
        windows_sandbox_level: windows_sandbox_level
            .ok_or_else(|| anyhow!("missing required {SANDBOX_LEVEL_FLAG}"))?,
        windows_sandbox_private_desktop,
        proxy_enforced,
        network_proxy_restricting_sid,
        proxy_settings_mode,
        read_roots_override,
        read_roots_include_platform_defaults,
        write_roots_override,
        deny_read_paths_override,
        deny_write_paths_override,
        command: command.ok_or_else(|| anyhow!("missing sandboxed command separator --"))?,
    })
}

fn next_flag_value(args: &mut impl Iterator<Item = String>, flag: &str) -> Result<String> {
    args.next()
        .ok_or_else(|| anyhow!("missing value for {flag}"))
}

View on GitHub (pinned to 339751715c)

Solutions

  1. Pass the required sandbox-level flag to the wrapper.

When it happens

Trigger: Thrown at codex-rs/windows-sandbox-rs/src/wrapper.rs:305 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/65672c9e2dbd3977. Report an issue: GitHub.