Your metal. Machines on demand.

VM sandboxes for your AI agents, on hardware you own. Each agent gets its own kernel, only the network you grant it, and secrets it can use but never read. Idle ones sleep and wake on the next request. Linux or macOS (Apple Silicon), open source.

curl -fsSL bhatti.sh/install | sudo bash
GitHub →
bhatti
CORE

Real machines. Zero waste.

01

Real VMs. Locked down by default.

Every machine runs its own Linux kernel, with its own filesystem and process space. It starts with no network at all: you grant each one the internet, a list of hosts, or nothing. A secret grant gives an agent a placeholder, never the key.

02

Snapshot everything. Fork anything.

Memory snapshots capture RAM, running processes, the root disk, attached-volume copies and network policy. Filesystem snapshots save only the root disk. Fork a running machine into an independent copy in about 150 ms, or export a snapshot and import it on another box.

03

Idle machines cost almost nothing.

Idle machines pause after 30 seconds and power off after 30 minutes, freeing their memory and keeping their disk. The next request or command wakes them, and the machine's init command brings its services back. Long agent sessions can stay hot.

SYS.PERFORMANCE // LATENCY
Operation p50
Create a machine 160ms
Fork a running machine 150ms
Snapshot / resume 98ms / 49ms
Cold start + first command 167ms
Wake on request (cold) 380ms
First command after pause (warm) 18ms
Run a command 13ms
Destroy a machine 66ms
Memory per idle 512MB machine ~58MB

agni-02 (Intel i9-9900K, Linux KVM), bhatti v2.5.0, p50 over the local unix socket.
Reproduce: bench/load. Release notes.

SYS.ARCHITECTURE

How it works

Click any component to explore.

Host Machine
bhatti daemon api.sock
REST / WS API
routes, proxy, NDJSON streaming
Thermal Manager
hot → warm → cold lifecycle
krucible engine
VMM helpers, snapshots, fork
SQLite + age
state, secrets, users
Binary wire protocol · vsock
daemon ⇌ lohar
bhatti-vmm guest ×N
Linux 6.12.94 · Ubuntu 24.04
hot ⇄ warm ⇄ cold
lohar PID 1
exec / shell
PTY sessions
file ops
port forward
eth0 (only with network)
Host Storage qcow2 · virtio-blk
root.qcow2
config.json → vsock
volumes/ + images/bases/
<data_dir>/
↕ virtio-net (opt-in)
bhatti-netd · gVisor
Unix stream link
egress + secret grants

CAPABILITIES

What people use it for

One sandbox per AI agent

The original use case for bhatti. Each agent gets its own Linux VM with no network until you grant one: here, just its model API, with the key swapped in on the way out so the agent never holds it. Snapshot at any tool call so you can branch from that exact moment if the run goes sideways.

# Reaches its model API, nothing else
$ bhatti create --name agent \
    --allow-host api.openai.com \
    --secret-grant OPENAI_KEY@api.openai.com
sandbox/agent created (1 vCPU, 1024 MB)

# Snapshot before a risky tool call
$ bhatti snapshot create agent --name pre
checkpoint "pre" created (1024MB)

# Run goes sideways? Branch from there:
$ bhatti snapshot resume pre --name retry

# Or fork the live one:
$ bhatti create --name try-2 --from agent

Preview environments per PR, free when idle

One sandbox per pull request. `bhatti publish` puts it on your domain with TLS. Idle previews pause after thirty seconds and power off after thirty minutes, keeping their disk; the next request boots them and `--init` brings the server back, about 380 ms on our test box. No rented infrastructure.

# CI spins up a preview from your image
$ bhatti create --name pr-247 --net \
    --image base --init "npm start"
$ bhatti exec pr-247 -- ./deploy.sh
$ bhatti publish pr-247 -p 3000 -a pr-247
Published: https://pr-247.bhatti.sh

# Days later: powered off, no memory used
# Reviewer opens the URL: it boots
$ curl -s https://pr-247.bhatti.sh
{"build":"ok"}    # wake + serve

Anything you can rootfs is yours

OCI pull, Docker import, or save a running sandbox. Whatever you put in a rootfs becomes a Linux VM that snapshots, forks, and idles for almost nothing. Postgres, browser automation, full desktops — it all just works.

# Pull an OCI image as a rootfs
$ bhatti image pull ghcr.io/org/dev
pulling ghcr.io/org/dev as "dev" (task: …)
done

# Or import a local Docker image
$ bhatti image import my-app
imported "my-app" (640MB)

# Or save a running sandbox as a base
$ bhatti image save dev --name stack
saved "stack" (1024MB)

# Either way: a VM you can snapshot
$ bhatti create --name web --image stack
$ bhatti snapshot create web --name ready
checkpoint "ready" created (1024MB)
CLI

Every command

Single binary. bhatti serve starts the daemon, everything else talks to its API.

bhatti create --name <name> [--cpus N] [--memory MB] [--image NAME] [--from SANDBOX] [--init CMD] [--env K=V] [--volume V:/mnt] [--mount HOST:GUEST] [--secret K] [--file local:guest] [--label K=V] [--keep-hot] [--disk-size MB]
Create a new machine, or fork one with --from
bhatti create --name <name> [--net] [--egress none|deny|public] [--allow-host H] [--allow-cidr C] [--allow-siblings] [--secret-grant NAME@host]
Network and credentials (no network by default)
bhatti destroy <name> [-y]
Destroy a machine (alias: rm)
bhatti edit <name> [--name N] [--label K=V] [--label-delete K] [--keep-hot] [--allow-cold]
Rename, relabel, or change thermal settings
bhatti list [-o wide] [--label K=V]
List your machines (alias: ls)
bhatti inspect <name>
Show machine details (alias: info)
bhatti start <name>
Boot a stopped machine
bhatti stop <name>
Power a machine off (disk kept)
Execution & shells
bhatti exec <name> -- <cmd> [--timeout S] [--detach] [--sync]
Run a command
bhatti shell <name> [--new]
Interactive terminal (Ctrl+\ to detach)
bhatti ps <name>
List active sessions in a machine
bhatti ports <name>
List listening TCP ports inside a machine
bhatti forward <name> <port-spec>... [--address ADDR]
Forward local TCP ports (PORT or LOCAL:GUEST) into a machine
Files & Secrets
bhatti file read <name> <path>
Read a file
bhatti file write <name> <path> < stdin
Write a file (atomic)
bhatti file ls <name> <path>
List a directory
bhatti secret set <name> <value>
Store an encrypted secret
bhatti secret list
List secret names
bhatti secret delete <name> [-y]
Delete a secret
bhatti secret grant <name> --sandbox S --host H [--ttl 24h]
Let a machine use a secret in HTTPS requests to a host, without seeing it
bhatti secret grants
List secret grants
bhatti secret revoke <id> [-y]
Revoke a secret grant
Images
bhatti image list
List available images
bhatti image pull <ref> [--name N] [--auth U:T]
Pull an OCI image from a registry
bhatti image import <docker-ref> [--tar <path>] [--name N]
Import from local Docker or a tarball
bhatti image save <sandbox> --name <image>
Save a running machine's rootfs as a reusable image
bhatti image delete <name> [-y]
Delete an image
bhatti image share <image> --user <name>... [--list]
Share an image with specific users (server-only)
bhatti image unshare <image> --user <name>...
Revoke image access (server-only)
Snapshots
bhatti snapshot create <sandbox> --name <snap> [--type memory|filesystem]
Save memory, root disk, volumes and network policy; filesystem: root disk only
bhatti snapshot list
List snapshots
bhatti snapshot resume <snap> [--name <new>]
Resume a snapshot into a new machine
bhatti snapshot delete <snap> [-y]
Delete a snapshot
bhatti snapshot export <snap> [-o <file>] [--include-base]
Write a snapshot to a portable archive
bhatti snapshot import <archive|-> [--name <snap>]
Import an archive from another host
Networking & Publishing
bhatti publish <name> -p <port> [-a <alias>] [--shell]
Publish a port → https://alias.your-domain
bhatti unpublish <name> -p <port>
Remove a published port
bhatti share <name> [--revoke]
Generate a web shell URL
Volumes
bhatti volume create --name <v> --size <MB>
Create a persistent volume
bhatti volume list
List volumes
bhatti volume delete <name> [-y]
Delete a volume
bhatti volume resize <name> --size <MB>
Resize a volume (grow only)
bhatti volume clone <src> --name <new>
Clone a volume (point-in-time copy)
bhatti volume backup <name>
Back up a volume to S3-compatible storage
bhatti volume backup-list <name>
List backups for a volume
bhatti volume restore <name> --backup-id <id>
Restore a volume from a backup
bhatti volume backup-delete <name> <id> [-y]
Delete a volume backup
Server & admin
bhatti serve
Start the daemon (server-only)
bhatti setup [--url URL] [--token KEY]
Point the CLI at a remote server
bhatti version
Print version and endpoint, check for updates
bhatti update [--cli-only] [--tiers <list>]
Update bhatti
bhatti completion <bash|zsh|fish|powershell>
Generate a shell completion script
bhatti user create --name <u> [--max-sandboxes N] [--max-cpus N] [--max-memory MB]
Create a user and API key, e.g. one per agent (server-only)
bhatti user list
List users (server-only)
bhatti user rotate-key <name>
Rotate a user's API key (server-only)
bhatti user delete <name> [-y]
Delete a user (server-only)
bhatti admin status
One-shot system overview (server-only)
bhatti admin events [--type T] [--since 24h] [--user U] [--sandbox S] [--limit N] [--count]
Query the event log (server-only)
bhatti admin metrics [--since 1h]
Query metrics snapshots (server-only)
bhatti admin migrate-images
Move images onto immutable bases (server-only)
bhatti admin gc-images [--dry-run]
Remove image bases nothing uses (server-only)
DEPLOY.SELF_HOST

Run it on your hardware.

One command. Any Linux machine with KVM, or an Apple Silicon Mac. Downloads one runtime bundle — daemon, VMM, network gateway, guest agent, kernel — and an Ubuntu 24.04 rootfs. No Docker, no containers, no orchestration layer.

Requirements

  • Linux (x86_64 or ARM64) with /dev/kvm, or macOS on Apple Silicon
  • Root for the installer (service + socket group)
  • A domain if agents connect from elsewhere (TLS)

Runs on a Raspberry Pi 5, a Hetzner dedicated box, a cloud VM with nested virtualization, or the Mac on your desk. Built for one owner and their agents, not for renting sandboxes to strangers.

# Install on a Linux box with KVM, or a Mac
$ curl -fsSL bhatti.sh/install | sudo bash
==> Installing bhatti (server, minimal tier)
    ✓ bhatti, bhatti-vmm, bhatti-netd, kernel, rootfs
    ✓ API on a local unix socket, no open port
    ✓ admin API key in ~/.bhatti/config.yaml
    ✓ service started (systemd or launchd)

# Create a sandbox — no setup step needed
$ bhatti create --name dev
sandbox/dev created (1 vCPU, 1024 MB)
  Net:   none (create with --net for internet access)
  Shell: bhatti shell dev

# One API key per agent, each with its own limits
$ sudo bhatti user create --name agent-1
  API key:  bht_3f9c...

# The agent, elsewhere, over your domain's TLS:
$ bhatti setup --url https://box.example.com \
               --token bht_3f9c...
✓ authenticated (0 sandboxes)