Skip to content

codex: document and check Linux bubblewrap/AppArmor prerequisites #1251

Closed

Description

@sumanthratna

The coder-labs/codex module installs and validates the Codex CLI, but does not check or document its Linux sandbox prerequisites. A workspace can therefore have a working codex --version while still missing the recommended system bwrap executable.

Observed environment

  • Module: registry.coder.com/coder-labs/codex/coder v5.5.0
  • OS: Ubuntu 24.04.5 LTS, amd64, EC2 workspace
  • Installed CLI: codex-cli 0.169.0
  • command -v bwrap: no output, exit status 1

Module configuration:

module "codex" {
  source  = "registry.coder.com/coder-labs/codex/coder"
  version = "5.5.0"

  agent_id      = coder_agent.main.id
  manage_config = false
}

The workspace bootstrap does not install bubblewrap. Codex reports:

Codex could not find bubblewrap on PATH. Install bubblewrap with your OS package manager. See the sandbox prerequisites: https://developers.openai.com/codex/concepts/sandboxing#prerequisites. Codex will use the bundled bubblewrap in the meantime.

The missing executable was checked in the current shell, so the observation is not based solely on a potentially stale daemon warning.

Why this matters

OpenAI's sandbox prerequisites recommend installing the distribution's bubblewrap package. Codex uses the first bwrap on PATH; its bundled fallback depends on support for unprivileged user namespace creation. The documentation also describes an additional AppArmor profile setup that may be needed on Ubuntu 24.04.

The module's install script delegates installation to OpenAI's installer and validates codex --version, but has no sandbox prerequisite check. The README does not cover bubblewrap or the Ubuntu AppArmor prerequisite.

Suggested improvement

  • Document the Linux prerequisites and link to OpenAI's OS-specific instructions, including the Ubuntu 24.04 AppArmor caveat.
  • Add a non-fatal Linux preflight warning when bwrap is missing, explaining that the workspace image/template should provide it and that the bundled fallback has additional requirements.
  • Consider opt-in dependency installation if it fits the module's scope. Automatic privileged package installation or host security changes should not be assumed.

A missing bwrap should not automatically fail installation: Codex has a bundled fallback, and the module supports different environments. Template owners can install the OS dependencies themselves; documenting and detecting the prerequisite would make that responsibility clear.

Separate runtime observation

During read-only sandboxed commands in this environment, the sandbox also returned:

bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted

We have not established the cause of that runtime error or verified that installing the distribution package resolves it. This issue's primary request is prerequisite documentation and detection.

Activity

  1. linear-code commented on Nov 14, 2026

    @linear-code
  2. added a commit that references this issue on Nov 19, 2026
    b405252
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions