Skip to content

image: bubblewrap, socat and ripgrep, what agents sandbox their commands with - #235

Merged
aledbf merged 1 commit into
mainfrom
image/bubblewrap
Nov 12, 2026
Merged

aledbf merged 1 commit into
mainfrom
image/bubblewrap

Conversation

@aledbf

@aledbf aledbf commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

The coding agents a workspace runs sandbox their commands with bubblewrap. Following up on #221 (closed): neither Codex nor Claude Code uses Landlock. Both use bwrap + seccomp, and the guest kernel already gives them what they need: unprivileged user namespaces and seccomp filter.

What changes

image/mkosi.conf adds three packages, and image/build.sh asserts each binary in the finished image:

  • bubblewrap: Codex and sandbox-runtime both use it. Codex ships its own copy, but sandbox-runtime refuses to start if there is none on PATH.
  • socat: sandbox-runtime's proxy for getting the network out of the sandbox. It also refuses to start without it (checkLinuxDependencies).
  • ripgrep: sandbox-runtime runs rg --files to find .git/hooks, .git/config and editor configs in subdirectories, then mounts them read-only (linux-sandbox-utils.ts:582). Without rg the scan fails, it logs at debug level, and the command runs without those denies. The sandbox ends up weaker and nothing says so.

I checked the source on 2026-11-12: openai/codex @ 6bfdc75 and anthropic-experimental/sandbox-runtime @ 41501a6 (0.0.82).

Checked

  • task image:build: OK, and build.sh finds /usr/bin/bwrap, /usr/bin/socat and /usr/bin/rg. The image goes from 857M to 863M.
  • I booted it with spin-machine boot --init /bin/sh and ran as nobody (uid 65534):
    • bwrap --unshare-user --unshare-net --unshare-pid --ro-bind / / --proc /proc --dev /dev --tmpfs /tmp → BWRAP_OK uid=65534.
    • rg --files → RG_OK, and socat → SOCAT_OK.
  • Versions in the image: bubblewrap 0.11.1 (sandbox-runtime asks for ≥ 0.5.0), socat 1.8.1.1, ripgrep 15.1.0.

A new image is a new base for the next boot. The fingerprint does not hash the base image, so it does not move.

🤖 Generated with Claude Code

…nds with

Codex's Linux sandbox and Claude Code's (sandbox-runtime) are both bwrap plus seccomp;
neither uses Landlock (#221). sandbox-runtime refuses to start without bwrap and socat
on PATH, and without rg it silently skips the scan that mounts nested .git/hooks and
editor configs read-only. build.sh asserts all three in the finished image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit 02c58b9 into main Nov 12, 2026
3 checks passed
@aledbf
aledbf deleted the image/bubblewrap branch November 12, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant