Skip to content

bubblewrap

bubblewrap is the Linux namespace primitive behind Fence and many other sandboxes. Use it directly when you want a minimal DIY jail without Fence’s policy layer.

Terminal window
# Debian / Ubuntu
sudo apt install bubblewrap
# Fedora
sudo dnf install bubblewrap

For a higher-level wrapper around per-project bubblewrap configs, see sandbox-run.

Share the host network so the jail can reach varlock on loopback, bind your project read-write, and keep the rest of $HOME out:

Terminal window
eval "$(varlock proxy env)"
bwrap \
--die-with-parent \
--unshare-pid \
--share-net \
--ro-bind /usr /usr \
--ro-bind /bin /bin \
--ro-bind /lib /lib \
--ro-bind /lib64 /lib64 \
--ro-bind /etc /etc \
--bind "$PWD" "$PWD" \
--chdir "$PWD" \
--dev /dev \
--proc /proc \
--tmpfs /tmp \
-- claude

Adjust binds for your distro layout and tools (node, agent binaries under /home, etc.). Prefer Fence if you want packaged agent templates and domain allowlisting without maintaining a long bwrap line.