Let your agents loose. On a machine that isn’t yours.

Hangar gives Claude Code, Codex or any agent its own macOS, Linux or Windows VM, right on your Mac. It can install and run anything, and reach only the hosts you allow, with every connection watched from outside the guest. The same goes for CI runners, test machines and anything you’d rather not install on your Mac.

  • Runs on your Mac
  • macOS 27 or later
  • Apple silicon
~ — zsh
$ hangar create kestrel --os macos --image base
$ hangar policy kestrel --mode allowlist \
--allow anthropic.com --allow github.com
$ hangar run kestrel --background
$ ssh admin@$(hangar ip kestrel --wait 60)
# inside, let it rip: claude, approvals off
# it reaches anthropic.com and github.com. that’s all ☕
$

Every VM in one window, with what it uses and what it sends.

Hangar's window: a list of macOS, Linux and Windows VMs, and a running Debian VM's processor, memory, disk and traffic.

Made for everyday work

Different jobs.
The same sandbox.

AI agentsClaude Code, Codex or your own, with approvals off.

AI agents

Give the agent a whole machine and only the hosts it needs. The worst it can break is a VM.

$ hangar create kestrel --os macos --image base
$ hangar policy kestrel --mode allowlist --allow anthropic.com --allow claude.ai --allow github.com
Start from the Claude Code template
CI runnersA clean machine for every job.

CI runners

Every job starts from your team’s image, fenced off to the registries it pulls from.

$ hangar create osprey --os linux --image ghcr.io/acme/ci-linux:1.0
$ hangar policy osprey --mode allowlist --allow github.com --allow '*.npmjs.org'
Start from the CI runner template
TestingmacOS, Windows and Linux, fresh every run.

Testing

Install, test, restore. Every run starts from the same snapshot, on the systems your users have.

$ hangar snapshot take merlin clean
$ hangar stop merlin
$ hangar snapshot restore merlin clean
Snapshots and clones
Software you don’t trustSee what it installs and who it calls.

Software you don’t trust

Run the installer in a VM and watch every connection it makes, from outside, where it can’t hide.

$ hangar run heron --background
$ hangar traffic heron --follow
How traffic rules work
Team environmentsOne image, every Mac on the team.

Team environments

Push a VM to the registry you already use, and everyone creates the same machine from its tag.

$ hangar export kestrel ghcr.io/acme/dev:1.0
$ hangar create kestrel --os macos --image ghcr.io/acme/dev:1.0
Share a VM through a registry

Hangar. A sandbox you can see into

Every VM gets its own network, watched from the Mac, a way back to where it started, and a way to hand the same machine to your whole team.

Read the docs

Traffic rules

Everything your agent talks to, in plain sight

Hangar watches from the Mac, so an agent can’t hide its traffic or switch the watching off: DNS lookups, host names from DNS, TLS and HTTP, bytes in and out, and what was blocked.

Build a policy

Record everything, block nothing. The default.

Block everything except the hosts you allow.

Allow everything except the hosts you block.

Cut the VM off at once. Only this Mac can still reach it.

kestrel — hangar traffic
$ hangar policy kestrel --mode monitor
$ hangar traffic kestrel --follow
02:39:42 allow tcp api.anthropic.com 160.79.104.10:443 ↑38 KB ↓12 KB
02:39:44 allow tcp github.com 140.82.121.3:443 ↑2 KB ↓570 KB
02:39:45 allow dns registry.npmjs.org A
02:39:47 allow tcp registry.npmjs.org 104.16.27.34:443 ↑1 KB ↓84 KB
02:39:48 allow tcp ads.example.com 203.0.113.7:443 ↑3 KB ↓12 KB
02:39:50 allow dns example.com A

Secrets

Tokens it can use. Never hold.

The value stays in your Mac’s Keychain. Inside the VM the variable holds a placeholder, and Hangar puts the real token in on its way to the hosts you allow, outside the guest.

How secrets work
Only these hosts are opened

HTTPS to a secret’s hosts goes through a proxy on your Mac, with a certificate authority of the VM’s own. Everything else passes as before.

The real server is checked first

Hangar checks the host’s certificate against your Mac’s trust before any request is sent. A host that doesn’t check out gets nothing.

A placeholder stays with its hosts

Sent to another of the secret’s opened hosts, it’s refused; anywhere else it stays a placeholder. The traffic log shows each secret put in, never the value.

~ — zsh
$ gh auth token | hangar secret set kestrel GITHUB_TOKEN --host api.github.com --value-stdin
$ hangar secret list kestrel
# in the VM, GITHUB_TOKEN holds a placeholder.
# api.github.com gets the real token, added outside the guest.

Inside the VM

Reach inside. No SSH.

hangar exec runs a command in a running VM through Hangar’s agent, and hangar cp copies files and folders in and out, like docker cp. Neither needs a password, a shared folder or the network, so both work in an isolated VM too.

Running commands
hangar exec

Output streams as it comes, and it exits with the command’s own exit code. -i sends your input, -t gives it a terminal.

hangar cp

What comes from the VM is checked before it’s written, and quarantined like a download, so macOS checks it before it first runs.

hangar logs

Read the log of a VM started in the background, or follow it as it’s written.

~ — zsh
$ hangar exec kestrel uname -a
$ hangar exec -it kestrel zsh
$ hangar cp report.pdf kestrel:/Users/admin/
$ hangar cp kestrel:/var/log/install.log .

Snapshots

Let it try. Roll it back.

Take a snapshot before the agent starts; when it’s done, stop the VM and restore it. Snapshots are copy-on-write copies of the disk, so they’re instant and only take space as the disk changes.

Snapshots and images
Snapshots

A snapshot keeps the disk, not the memory, so a restored VM starts up fresh. Taking one while the VM runs pauses it for a moment.

Clones

Start several agents from one clean snapshot. Each clone gets its own MAC address, IP address and machine identity, while the source keeps running.

~ — zsh
$ hangar snapshot take kestrel clean
$ hangar clone kestrel kestrel-2 --snapshot clean
$ hangar clone kestrel kestrel-3 --snapshot clean
$ hangar stop kestrel
$ hangar snapshot restore kestrel clean

Templates

A VM’s recipe. In one small file.

A .hangarvm file says how to make a VM: what it’s made from, its size and settings, its traffic rules, the secrets it expects and the commands that set it up. Keep one with a project; each VM made from it starts from a fresh image, not from a copy of yours.

How templates work
Nothing of your machine

No disk, MAC or IP address, passwords or secret values go in. Secrets are asked for when the VM is made.

Read before it runs

Before the VM is made, Hangar lists every shared folder, the traffic rules and every setup command. A folder shared read-write needs your say.

Setup commands

They run once, in order, once the VM has first started, with the VM’s secret variables. The first that fails stops the rest.

~ — zsh
$ hangar template save go go-dev.hangarvm
$ hangar create go2 --template go-dev.hangarvm
$ hangar create go3 --template go-dev.hangarvm --memory 16

Images and registries

Share CI environments with your team. Privately.

Push a macOS, Linux or Windows VM, or one of its snapshots, to the container registry you already use. Hangar’s images are OCI images, so GitHub, GitLab, Docker Hub, Harbor or Quay take them as they are.

Share a VM through a registry
Private

The image stays in your registry, behind your team’s sign-in. Hangar keeps the token in your Keychain.

Checked

Every part is checked against the image’s digest, and downloads carry on where they stopped.

No registry needed

Save a VM as a .tar file and pass that around instead.

~ — zsh
$ hangar login ghcr.io -u acme-ci
$ hangar export ci ghcr.io/acme/ci-linux:1.0 --snapshot clean
# on a teammate’s Mac, or a build server:
$ hangar create ci1 --os linux --image ghcr.io/acme/ci-linux:1.0

MCP server

Let your agent drive Hangar. With your checks.

hangar mcp is an MCP server: Claude Code or Codex, running on your Mac, can create VMs, run commands and copy files in them, take snapshots and set their traffic rules. Its tools run the same hangar commands you would, with the same checks.

Connect your agent
Some things stay with you

Secret values and passwords never pass through it, and it can’t delete VMs.

Commands with a limit

run_command runs through Hangar’s agent in the VM, and stops after 10 minutes unless the agent asks for longer.

Your rights, your approvals

It acts with your rights on this Mac: copy_files reads and writes your files, and traffic_policy can open a VM’s network. Keep your client’s tool approvals on for them if that matters to you.

~ — zsh
$ claude mcp add hangar -- hangar mcp
$ codex mcp add hangar -- hangar mcp
# then, in plain words:
# “a Debian VM with Go that reaches only github.com”

The license

Free for you. Fair for teams.

Hangar is free on any Mac used by one person. A company can also run it on shared machines and build servers with up to 100 CPU cores in total; more than that needs a separate license from Baseguard.