# Repository Briefing: stacklok/brood-box
> Source: https://repoforai.com/repo/stacklok/brood-box (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/stacklok/brood-box
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Go
- **License**: Apache-2.0
- **Engineering Health**: A (86/100 · Maintenance 35/35 · Adoption 14/25 · Releases 17/20 · License 20/20)
- **Latest Release**: v0.0.25 (2026-09-14) — https://github.com/stacklok/brood-box/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: CLI, Self-Hosted
- **Momentum**: 82 ★ total (+0 24h / +0 7d) · 15 forks
- **Topics**: `ai-agents`, `claude-code`, `codex`, `developer-tools`, `microvm`, `sandbox`, `security`
- **When to Use**: Best for: Developers and teams on KVM-capable Linux or Apple Silicon who want an interactive coding agent, a separate guest kernel, and an explicit checkpoint before edits reach the working tree. Skip if: Virtualization is unavailable, you require stable CLI and config contracts, or you need every external action to be approved or reversible rather than just workspace changes.

## Overview
```text
### Architecture & Core Mechanics
`bbox` is a Go CLI built with Cobra. For a normal snapshot session it pulls an OCI image, extracts the guest root filesystem, injects `bbox-init` and session SSH keys, then boots a libkrun microVM through `go-microvm`. The guest uses KVM on Linux or Hypervisor.framework on Apple Silicon. The workspace snapshot is mounted via virtio-fs. Inside the guest, `bbox-init` runs as PID 1, mounts filesystems, configures networking, and starts an embedded SSH server. The CLI attaches the terminal over a localhost-bound SSH forward.

The VM stops before the host computes a SHA-256-based change set. Interactive review presents unified per-file diffs, and accepted files are rehashed before writeback. The manifest includes `go-containerregistry` for OCI integration, `go-diff` for text diffs, and ToolHive and ToolHive Core for MCP integration. Extension points include configurable agent images and commands, one-shot `run-image` sessions, and host-discovered ToolHive MCP servers proxied into the guest.

### Key Capabilities & Differentiators
Built-in entrypoints cover Claude Code, Codex, OpenCode, Hermes, and Gemini CLI. Their GHCR images each default to 2 vCPUs and 4 GiB of guest RAM. CPU, memory, workspace path, and forwarded environment variables can be configured; Git token and SSH-agent forwarding are also available. Snapshot exclusions use gitignore-style patterns, but sensitive patterns such as `.env*`, `*.pem`, `.ssh/`, and `.aws/` cannot be negated.

Egress defaults to `permissive`; `standard` permits the model provider and common development services, while `locked` limits the base policy to the provider. `--allow-host` adds explicit DNS hostnames rather than IP addresses. Workspace config can tighten isolation but cannot enable direct mode, disable review, or broaden egress. Snapshot and interactive approval are distinct: snapshot is the default, but the usage descriptions are inconsistent about whether review is on by default. Pass `--review` explicitly when per-file approval is required.

### Trade-offs & Limitations
Compared with a native agent CLI or a conventional dev container, Brood Box adds a separate guest kernel and can stage edits for approval before they reach the real workspace. The costs are a virtualization prerequisite, guest boot and memory overhead, and an image and firmware lifecycle. The 2-vCPU/4-GiB defaults are allocations, not performance measurements. Direct mode keeps the VM boundary but mounts the real workspace read-write, applies changes immediately, and skips review and snapshot-mode Git credential sanitization.

The file review is not an authorization layer for network calls, Git operations, or MCP tools. Outbound access is permissive by default, and credentials or tools explicitly forwarded into the VM remain usable by the agent. For sensitive work, combine snapshot mode and explicit review with narrower egress and minimal forwarding. That can block dependency installation or internal services until the necessary hosts are allowed. The guest session is ephemeral, but that does not erase the host firmware cache or undo external effects.

### Hardware & Deployment Guide
Run the self-contained `bbox` release binary on Linux with accessible `/dev/kvm` or on Apple Silicon macOS with Hypervisor.framework. A system libkrun development package is not needed for the release build. Firmware is separate: `libkrunfw` is downloaded at runtime and cached under `~/.cache/broodbox/firmware/`, with a system fallback. `--no-firmware-download` selects system firmware only. Plan for registry access when pulling agent images and provider connectivity and credentials for API-backed agents.

For source builds, `task build` downloads and embeds the prebuilt `go-microvm` runtime into `bin/bbox`; guest image builds via `task image-all` require Docker or Podman. The prerequisite list says Go 1.26+, but `go.mod` declares Go 1.27.0, so plan source builds against the module declaration. The supplied release history shows ToolHive Core updates in v0.0.24 and a Hermes agent update plus an SSH-agent-forwarding lint fix in v0.0.25. Treat upgrades as compatibility changes: the project is experimental and does not promise stable flags or config.
```

## Key Capabilities
```text
- Guest runtime: libkrun uses KVM or Hypervisor.framework, with Go-based `bbox-init` as PID 1 and an embedded SSH server.
- Workspace staging: Linux FICLONE and macOS `clonefile(2)` provide copy-on-write snapshots; the VM stops before SHA-256 diffing.
- Writeback checks: Accepted files are rehashed, symlinks are checked for in-bounds targets, and setuid, setgid, and sticky bits are stripped.
- Policy precedence: CLI flags override workspace and global settings, but workspace config cannot disable review, enable direct mode, or widen egress.
- Network and tools: DNS-aware egress offers `permissive`, `standard`, and `locked` profiles, alongside a configurable ToolHive MCP proxy.
- Agent packaging: Five bundled OCI-based agents default to 2 vCPUs and 4 GiB each; `run-image` supports one-off guest images.
```

## Quick Start / Clone
```bash
bbox claude-code
```
