Skip to content

Comparison

jai is not trying to replace Docker, bubblewrap, or any other container tool. It fills a different niche: ad-hoc sandboxing of CLI tools on the host machine you already use. This page compares them honestly.

When to use jai

  • You want to sandbox an AI agent or CLI tool right now, on your real machine
  • You don't want to build an image, write a Dockerfile, or maintain a wrapper script
  • You mostly care about preventing filesystem damage and want something better than nothing
  • You want your working directory to be live-accessible inside the sandbox

When to use something else

  • You need reproducible builds or CI environments → Docker
  • You need multi-tenant isolation with untrusted users → Docker, VM, or a proper container runtime
  • You need fine-grained seccomp / capability control → bubblewrap or custom container
  • You need cross-platform sandboxing → Docker

jai vs Docker

Docker is an image-based container runtime. You build an image with your tool installed, then run containers from that image. jai is a host-native sandbox that wraps commands on your existing system.

Rough Docker approximation

The following is a rough approximation of what jai codex does in casual mode. It is not an exact equivalent — Docker does not provide jai's overlay-on-home workflow.

bash
# Very rough approximation — not equivalent
docker run --rm -it \
  --mount type=bind,src="$PWD",dst="$PWD" \
  -w "$PWD" \
  --tmpfs /tmp \
  --tmpfs /var/tmp \
  your-image-with-codex \
  codex

Key differences

jaiDocker
Setupjai codexBuild image, configure bind mounts
Home directoryCopy-on-write overlay of your real homeNot available unless manually configured
Current directoryGranted by defaultExplicit bind mount required
Host toolsUses host-installed binariesMust be installed in the image
Isolation modelMount + PID namespacesFull container with cgroups, seccomp, etc.
Bind mount behaviorWritable dirs are explicitBind mounts are writable by default and modify host files
ReproducibilityRuns on your host as-isFully reproducible via Dockerfile
Image requiredNoYes
OverheadMinimalContainer + image storage

Docker is the right choice when you need reproducibility, image management, or strong multi-tenant isolation. jai is the right choice when you want to sandbox a command on your existing system with zero setup.


jai vs bubblewrap

bubblewrap (bwrap) is a powerful, unprivileged namespace sandbox. It starts from an empty mount namespace and lets you explicitly assemble the filesystem view the sandboxed process sees.

Rough bubblewrap approximation

The following is a rough approximation of what jai codex does. bubblewrap cannot easily set up an overlay filesystem (that would require fuse-overlayfs or root), so this version uses a read-only bind of your home directory instead — it is less capable than jai's overlay.

bash
# Very rough approximation — not equivalent
bwrap \
  --die-with-parent \
  --new-session \
  --unshare-pid \
  --ro-bind / / \
  --proc /proc \
  --dev /dev \
  --tmpfs /tmp \
  --tmpfs /var/tmp \
  --bind "$PWD" "$PWD" \
  --chdir "$PWD" \
  -- codex

Key differences

jaibubblewrap
Setupjai codexAssemble filesystem from scratch
Home directoryCopy-on-write overlayMust be explicitly bound (no overlay)
ConfigurationConfig files, auto-defaultsFlags only (often wrapped in a script)
OverlayfsBuilt-inNot available without fuse-overlayfs
PrivilegeSetuid root or sudoUnprivileged (uses user namespaces directly)
FlexibilityOpinionated defaultsFully explicit — you control everything
Typical usageOne-liner sandboxingFlatpak internals, custom sandboxes

bubblewrap is more flexible and works without root. jai is more opinionated and requires far less ceremony for the common case. The 15-flag bwrap invocation that turns into a wrapper script is exactly the friction jai is designed to remove.


jai vs chroot

chroot changes the root directory for a process. Linux documents it as not intended to be used as a security mechanism. It is not a serious equivalent to jai or any other sandbox.

  • No mount namespace isolation
  • No PID namespace isolation
  • No credential separation
  • Trivially escapable by root
  • Requires a full filesystem tree under the chroot path

If you are currently using chroot for sandboxing, any of the other tools on this page would be an improvement.


Summary

jaiDockerbubblewrapchroot
Primary useHost-native ad-hoc sandboxImage-based containersExplicit namespace sandboxRoot directory change
Setup effortMinimalModerate (images)Moderate (flags/scripts)High (full FS tree)
Overlay homeYesNoNo (without fuse-overlayfs)No
UnprivilegedNo (setuid/sudo)Rootless mode availableYesNo
Security modelCasual blast-radius reductionStrong container isolationStrong (if configured well)Not a security mechanism
Linux-onlyYesNo (cross-platform)YesYes

Stanford SCS