TartarOS

A local sandbox for AI coding agents that you can test yourself.

Let Claude Code, Codex or any agent run unattended. Your secrets stay out of its reach, its network stays on an allowlist, your repo stays clean, and nothing it leaves behind runs later outside the box.

It grew out of sandbox-conformance, the lab where I measure agent sandboxes: safe by default, every protection configurable per run. Alpha, under active development, open to contributions.

Open source, Apache-2.0. macOS and Linux. One binary: no Docker, no VM, no account, no login.

Every claim is a contract you can run security-bench/corpus/trust-handoff-nested-git.toml

The attack

Plant a git hook in a nested repo, so it runs the next time someone commits.

echo '#!/bin/sh' > \
  work/a/nested/.git/hooks/pre-commit

The control

Normal work in the same workspace must keep working, or the sandbox fails.

echo ok > work/src/f.txt

The effect

Checked on disk afterwards, not taken from the agent's exit code.

absent = "work/a/nested/
  .git/hooks/pre-commit"
Linux 6.8 pass macOS 15.7 pass gVisor microVM pass 31 more like this

What stays in the box

Your secrets
~/.ssh, ~/.aws, .env and anything you name are unreadable. Deny a directory and re-open one branch inside it; the most specific rule wins. The environment is scrubbed, so tokens in your shell never reach the agent, and the broker lets it use a credential it never holds.
Its network
Deny by default, with an allowlist of domains through a broker that defends against SSRF. UDP, ICMP and raw sockets are closed too, so DNS tunnels and QUIC don't slip out. Local ports open one at a time, not all of localhost.
Anything that runs later
Git hooks, .claude/settings.json, .mcp.json and CI files stay unwritable at any depth, through nested repos, submodules and renamed ancestors. That includes the sandbox's own config, so the agent can't switch it off.
The mess
git status shows only what the agent wrote, during the run and after it, and nothing is left in your working tree when it ends.
Runaway processes
Root-proof process and memory caps on Linux (cgroup v2), a CPU budget, and a timeout that also reaps daemons that tried to escape the run.
Silent downgrades
If a host can't give you a protection you asked for, TartarOS refuses to start or marks it unsupported. tartaros explain prints exactly what a policy grants before anything runs.

Where the wall is

The policy is compiled by a supervisor outside the agent and enforced by the kernel below it: Seatbelt on macOS; Landlock, seccomp, cgroups and namespaces on Linux; an OCI bundle under gVisor for the microVM backend. The agent can't negotiate with it, and it holds when the agent runs as root.

The TartarOS boundary The agent runs inside a bronze wall. Inside, it can write source files but not git hooks or agent configs. Reads of ~/.ssh and direct connections to the internet are blocked. The only way out is the broker, which reaches allowlisted domains. Later, you run git commit outside the wall and only your own hooks run. your machine tartaros agent repo/ (writable) src/fix.rs written .git/hooks locked .claude/ locked .mcp.json locked at any depth ~/.ssh ~/.aws, .env read denied broker github.com on the allowlist anything else connection denied you, later git commit runs only the hooks you installed
Every arrow above is a scenario in the corpus: the dashed ones are attacks that must fail, the solid ones are controls that must keep working.

Measured, not claimed

Each guarantee is a contract with an attack, a legitimate control and an assertion on the real effect. The mutation check removes one protection at a time and requires the suite to catch it, so a green run means something.

Run on 0.1.0-alpha.25 (2026-11-08)Result
Linux 6.8, Ubuntu 24.04, Landlock158 / 158 pass
macOS 15.7, Seatbelt (the rest are Linux/Windows-only)125 / 125 pass
Mutation check, both systems0 blind spots
microVM phase 1, under gVisor (2026-10-15)20 / 20 pass
Claude Code confined, egress to one domain (macOS)works

Every scenario, every platform, with the raw output. Run it on your own machine with ./scripts/verify.sh.

Get started

Build the binary:

git clone https://github.com/carlostapiacl/tartaros
cd tartaros
cargo build --release -p tartaros-cli
./target/release/tartaros version

Run an agent on a repo with its keys hidden and two domains allowed:

tartaros run --write ./repo \
  --read-deny ~/.ssh --read-deny ~/.aws \
  --allow-domain api.anthropic.com \
  --allow-domain github.com \
  -- claude -p "fix the failing tests"

Write the policy once in TOML and use it on both systems, or apply an existing sandbox-runtime settings.json with --settings. Every flag is in the CLI reference.

Know the edges

  • Landlock and Seatbelt share the host kernel, so a kernel exploit crosses them. For untrusted code, use the microVM backend: phase 1 is validated under gVisor, and phase 2 (Firecracker) is next.
  • macOS teardown is best effort for daemons that leave the process group; Linux reaps them.
  • On Linux, unix sockets are all or nothing: the default profile warns when docker.sock is reachable, and --deny-unix closes it.
  • Disk space isn't capped yet; memory, processes and CPU are.

All limits, per system

Help build it

The most useful contribution is a corpus scenario: one TOML file with an attack, a control and an effect check. A scenario that fails today is the best bug report there is, and the same file runs against any sandbox, not just this one.

Results from other kernels and distros are welcome too. Report vulnerabilities privately through GitHub security advisories.

What's coming next