Stanford's jai packages Linux containment for coding agents into casual, strict, and bare modes with mount namespaces, overlayfs, and private /tmp. Try the safer mode for writable projects and decide whether patch or diff handoff is better than direct edits.

/tmp, a private PID namespace, and a read-only rest of filesystem..pyc, .venv, or git hooks that can execute later outside it.diff, apply, and reset commands instead of direct writes.You can browse jai's homepage, jump to the GitHub repo, and read the HN thread where the interesting bits show up fast: direct project write access, overlayfs edge cases, and a separate complaint that sandboxing in Claude Code has been flaky enough that one commenter now tests restrictions by trying to read a forbidden file.
jai - easy containment for AI agents
635 upvotes · 329 comments
Jai is pitched as almost no-setup containment: run jai --init, then prefix an agent command like jai codex in the launch description. The packaging is simple enough to feel obvious in retrospect, which is probably why the post took off.
The three modes split cleanly:
That means jai is not trying to be a full VM or container platform. The core HN summary frames it as a reference point for local agent containment, especially for people who want something lighter than heavier isolation stacks.
Discussion around Go hard on agents, not on your filesystem
635 upvotes · 329 comments
The thread's best point is that writable project access may be the dangerous part even if the rest of the machine is locked down. As the discussion recap notes, commenters called out artifacts like .pyc, virtualenvs, and git hooks as persistence paths that can survive the sandbox and fire later in a normal shell.
A deeper thread in the same discussion describes a different handoff model: the agent works inside a full copy of the repo, then only an explicit patch crosses back into the real tree via diff, apply, or reset in the copy-out workflow example. That is a much more opinionated trade, but it is the cleanest alternative surfaced in the launch conversation.
Go hard on agents, not on your filesystem
635 upvotes · 329 comments
The HN comments also got into implementation detail. One sandbox-tool author asked how jai handles overlayfs limits around reusing an upper layer across multiple mounts, and whether repeated jai bash sessions share or isolate writable home overlays.
The final useful wrinkle came from outside jai itself. Another highlighted comment said sandboxing in Claude Code has been unreliable on both Linux and macOS, and suggested verifying a sandbox by asking the assistant to read something it should not be able to access. That turned a launch thread about a small Stanford tool into a broader reminder that agent sandboxing is still full of sharp edges.