Hangar bot
Mac app and command line that runs AI coding agents inside macOS, Linux or Windows virtual machines with network allow lists and snapshots.
At a Glance
About Hangar bot
Hangar is a free, open-source Mac app and command line from Baseguard Inc. that runs AI coding agents such as Claude Code and Codex inside a virtual machine on Apple silicon Macs. The VM can be macOS, Linux or Windows 11. The latest release listed on GitHub is v1.1.0, published 2026-11-19.
What It Is
Hangar addresses the problem that coding agents work fastest with approvals turned off, but then they can act freely on the host computer. Instead of running the agent on your Mac, Hangar runs it in its own VM. The agent sees only a folder you share, can reach only the websites you allow, and any damage can be undone by restoring a snapshot. The Mac app shows each VM's screen, CPU, memory, disk use and connections, and the hangar command line works on the same VMs.
How the Containment Works
- Traffic log: Hangar records every site the VM looks up and connects to, the data sent each way, and what was blocked. It records from the Mac, outside the VM.
- Allow list: The VM can reach only the sites you list. Changes apply immediately, and
--isolate oncuts off the internet at once. - Secrets: API keys stay in the Mac Keychain. The VM's environment variable holds a fake value that Hangar swaps for the real key on requests to sites you chose.
- Snapshots and clones: A snapshot saves the VM disk, and restoring discards later changes. Copies can be cloned from a snapshot, each with its own network address, to run several agents at once.
Agent Control and Guest Systems
hangar mcp is an MCP server that can be added to Claude Code or Codex. The agent can create and start VMs, run commands, copy files, take snapshots and change which sites a VM can reach. According to the project, it cannot delete VMs and never sees keys or passwords. Guests include ready-made macOS images (plain, Homebrew or Xcode), Debian and Ubuntu images or any installer ISO, and Windows 11 for Arm from Microsoft's ISO, installed without manual setup clicks.
Limits and Setup
Hangar requires macOS 27 or later on Apple silicon. Install it by downloading the app or with Homebrew, then enable the command line in Settings. The README notes that a new VM blocks nothing until an allow list is turned on. For HTTPS it sees the site name rather than the full URL, and keys are only added to request headers. A shared folder the VM can write to can affect the Mac, so read-only sharing is recommended.
Community Discussions
Be the first to start a conversation about Hangar bot
Share your experience with Hangar bot, ask questions, or help others learn from your insights.
Pricing
Open Source
Hangar is free and open source under the Apache 2.0 license; requires macOS 27 or later on Apple silicon.
- Free and open source (Apache 2.0)
- Mac app and hangar command line
- macOS, Linux and Windows 11 VMs
- Website allow list and traffic monitoring
- Secrets kept in Mac Keychain
Capabilities
Key Features
- Run macOS, Linux and Windows 11 VMs on a Mac
- Per-VM website allow list with immediate changes
- Log of every connection recorded outside the VM
- API key injection without keys inside the VM
- Instant snapshots and restore
- Clone VMs from snapshots to run multiple agents
- Built-in MCP server (hangar mcp)
- Run commands and copy files without SSH
- Share a single folder, optionally read-only
- Browse VM files and connect USB devices
- Private network with an address per VM
- Export VMs to a container registry and save templates
