Improved sandbox diagnostics

Resolved 💬 5 comments Opened Feb 19, 2026 by solomatov Closed May 2, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.104.0

What subscription do you have?

plus

Which model were you using?

gpt-5.3-codex

What platform is your computer?

apple container on arm64 macos

What terminal emulator and version are you using (if applicable)?

_No response_

What issue are you seeing?

I run an agent in apple container. I noticed strange behavior of sandbox. When I run codex sandbox linux mkdir -p .codex I got this error:

thread 'main' (12504) panicked at linux-sandbox/src/linux_run_main.rs:138:9:
error applying legacy Linux sandbox restrictions: Sandbox(LandlockRestrict)

Would be nice to at least warn that sandbox can't be applied to the current directory.

What steps can reproduce the bug?

Run codex sandbox linux mkdir -p .codex in a directory where this directory doesn't exist

What is the expected behavior?

Error due to sandbox forbidding this operation

Additional information

_No response_

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 6 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #10772

Powered by Codex Action

solomatov · 6 months ago

I asked codex for help, and it said to run:

``❯ cat /sys/kernel/security/lsm 2>/dev/null | tr ',' '\n' | grep -i landlock || echo "no landlock lsm"``
The result is

``no landlock lsm``

So, it seems that the kernel doesn't have landlock.

solomatov · 6 months ago

Bubblewrap also doesn't work, though the error is different:

``bwrap: Unexpected capabilities but not setuid, old file caps config?``

skilbjo · 5 months ago

i am getting this,

my codex.yml action

  codex:
    runs-on: ubuntu-slim # https://docs.github.com/en/actions/reference/runners/github-hosted-runners#single-cpu-runners
    timeout-minutes: ${{ inputs.timeout-minutes }}
    if: github.actor != 'dependabot[bot]'
    permissions:
      contents: read
    outputs:
      final_message: ${{ steps.run_codex.outputs.final-message }}
    steps:
      - uses: actions/checkout@v6
        with:
          # Explicitly check out the PR's merge commit.
          ref: refs/pull/${{ github.event.pull_request.number }}/merge

      - name: Pre-fetch base and head refs for the PR
        run: |
          git fetch --no-tags origin \
            ${{ github.event.pull_request.base.ref }} \
            +refs/pull/${{ github.event.pull_request.number }}/head

      - name: Run Codex
        id: run_codex
        uses: openai/codex-action@v1
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          CODEX_API_KEY: ${{ secrets.OPENAI_API_KEY }} # per AI needs to be set to avoid 401 errors
        with:
          openai-api-key: ${{ secrets.OPENAI_API_KEY }}
          safety-strategy: drop-sudo
          sandbox: workspace-write
          prompt: |
            The workspace is /home/runner/work/${{ github.repository }}/${{ github.repository }}

            This is PR #${{ github.event.pull_request.number }} for ${{ github.repository }}.
            Base SHA: ${{ github.event.pull_request.base.sha }}
            Head SHA: ${{ github.event.pull_request.head.sha }}

            Review ONLY the changes introduced by the PR.
            Suggest any improvements, potential bugs, or issues.
            Be concise and specific in your feedback.

            Pull request title and body:
            ----
            ${{ github.event.pull_request.title }}
            ${{ github.event.pull_request.body }}

logs

Run openai/codex-action@v1
Run actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
Attempting to download 20...
Acquiring 20.20.1 - x64 from https://github.com/actions/node-versions/releases/download/20.20.1-22746716736/node-20.20.1-linux-x64.tar.gz
Extracting ...
/usr/bin/tar xz --strip 1 --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/bb8d7fcc-865a-4684-a5b6-3fac7f861bba -f /home/runner/work/_temp/ba4a19f4-7c90-45c2-8b24-fb15359e48a4
Adding to the cache ...
Environment details
Run node "/home/runner/work/_actions/openai/codex-action/v1/dist/main.js" check-write-access \
Checking write access for actor 'skilbjo' on xhrdev/proxy
Actor 'skilbjo' has permission level 'admin'.
Actor 'skilbjo' is permitted to continue.
Run npm install -g "@openai/codex@"
added 2 packages in 3s
Run npm install -g "@openai/codex-responses-api-proxy@"
added 1 package in 1s
Run node "/home/runner/work/_actions/openai/codex-action/v1/dist/main.js" resolve-codex-home \
Resolved Codex home: /home/runner/.codex
Run server_info_file="/home/runner/.codex/22838956934.json"
Run server_info_file="/home/runner/.codex/22838956934.json"
Run upstream_url=""
responses-api-proxy listening on 127.0.0.1:35341
Run server_info_file="/home/runner/.codex/22838956934.json"
Run node "/home/runner/work/_actions/openai/codex-action/v1/dist/main.js" read-server-info "/home/runner/.codex/22838956934.json"
Run node "/home/runner/work/_actions/openai/codex-action/v1/dist/main.js" write-proxy-config \
  
Run server_info_file="/home/runner/.codex/22838956934.json"
Run node "/home/runner/work/_actions/openai/codex-action/v1/dist/main.js" read-server-info "/home/runner/.codex/22838956934.json"
Run node "/home/runner/work/_actions/openai/codex-action/v1/dist/main.js" write-proxy-config \
  
Run case "${RUNNER_OS}" in
  
runner is not a member of the sudo group.
Removed runner entry from /etc/sudoers.d/runner
No runner entries found in /etc/sudoers requiring changes.
Groups for runner after cleanup: runner adm users systemd-journal
Run if sudo -n true 2>/dev/null; then
Confirmed sudo privilege is disabled.
Run node "/home/runner/work/_actions/openai/codex-action/v1/dist/main.js" run-codex-exec \
Running: CODEX_HOME=/home/runner/.codex codex "exec" "--skip-git-repo-check" "--cd" "/home/runner/work/proxy/proxy" "--output-last-message" "/tmp/codex-exec-ZdhtpR/output.md" "--sandbox" "workspace-write"
Reading prompt from stdin...
OpenAI Codex v0.112.0 (research preview)
--------
workdir: /home/runner/work/proxy/proxy
model: gpt-5.3-codex
provider: codex-action-responses-proxy
approval: never
sandbox: workspace-write [workdir, /tmp, $TMPDIR, /home/runner/.codex/memories]
reasoning effort: none
reasoning summaries: none
session id: 019cd0f9-7cd4-7d70-9b6a-306cc932c2ad
--------
user
This is PR #538 for xhrdev/proxy.
Base SHA: b6140a84ad23b2e0cd9b63d9b19bbe543a665d12
Head SHA: 6321660ae37451290fc27754020a81ab9bda0467
Review ONLY the changes introduced by the PR.
Suggest any improvements, potential bugs, or issues.
Be concise and specific in your feedback.
Pull request title and body:
----
refactor: remove hardcoded ua
mcp startup: no servers
codex
Reviewing PR `#538` by diffing `b6140a84...` to `6321660a...` and inspecting only changed files for regressions and edge cases. I’ll report concrete findings with file/line references and keep it concise.
codex
I hit a sandbox runtime error when invoking shell commands, so I’m trying a minimal command path next to verify whether any local git inspection is possible in this session.
codex
Unable to review this PR’s changes from the repo in the current session because every shell command fails before execution with:
Unable to review this PR’s changes from the repo in the current session because every shell command fails before execution with:
`error applying legacy Linux sandbox restrictions: Sandbox(LandlockRestrict)`
`error applying legacy Linux sandbox restrictions: Sandbox(LandlockRestrict)`
So I can’t access `git diff b6140a84..6321660a` locally.
So I can’t access `git diff b6140a84..6321660a` locally.
``
etraut-openai contributor · 3 months ago

This feature request hasn't received enough upvotes, so I'm closing it.