Skip to content

Can projects in one guest share Homebrew without being able to change each other's tools?

Answered 2026-10-07: yes, with conditions. Decided 2026-10-08: no per-project prefix in v1 (A), and bottles only (A). The decision is in the I31I31 (closed): X20-shared-homebrew: Homebrew with more than one project userX20-shared-homebrew (added to S11-verification-and-spikes in #14) comment that starts Decision (2026-10-08):. Source: X20-shared-homebrewX20-shared-homebrew: Homebrew with more than one project userCan each project user in one guest get its declared Brewfile without a Homebrew prefix that another project user can write to (SEC08-proj-isolation)? (I31I31 (closed): X20-shared-homebrew: Homebrew with more than one project userX20-shared-homebrew (added to S11-verification-and-spikes in #14)). Changes S06-01-image-layersS06-01-image-layers: Image Layers and the Toolchain PrefixThe layers of a guest image, and the toolchain prefix that project layers install into., S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq… and T00-indexT00-indexboundary 6 is the host terminal stream. (T15-shared-toolchainT15-shared-toolchain: Projects in one guest share the toolchain prefixEvery project user runs tools from the one prefix that the toolchain user owns (S06-01-image-layers, "Toolchain prefix").). Confirms I144I144 (closed): S06-vm-lifecycle: which user installs the base layer before sealingFrom the security review of PR #141 (X17-image-build, #28), finding 3. for how projects add packages, and builds on I150I150 (closed): S06-vm-lifecycle: minimal base image and named derived images built from recipesS06-vm-lifecycle "Images" puts Homebrew, the Xcode command line tools and wb-guestd in the base image.. Follow-up: I180I180 (open): X20-shared-homebrew: verify the untested toolchain prefix conditions in a guestX20-shared-homebrew (#31, PR #178) answered "yes, with conditions" for one Homebrew prefix owned by the toolchain user. (the untested conditions, in a guest).

wb-hostdreads the manifestguestwb-guestd, rootsudo -u toolchain user/opt/homebrewowned by toolchain userproject user Aand the agentproject user Bruns git, node, pythonnames onlybrew installread, runwrite, brew installa Brewfile run as code

Figure 1. Only wb-guestd, as the toolchain user, writes the shared prefix, and only from a list of package names. Project users read and run it. The red flows are what the spike showed would let project A change project B’s tools, and what the conditions stop (S06-01-image-layersS06-01-image-layers: Image Layers and the Toolchain PrefixThe layers of a guest image, and the toolchain prefix that project layers install into., “Toolchain prefix”).

Decision 1: may a project have a prefix of its own? Decided 2026-10-08: A

Section titled “Decision 1: may a project have a prefix of its own? Decided 2026-10-08: A”

The shared prefix covers what projects declare. A prefix per project would let the agent run brew install itself, and would keep one project’s versions out of another’s way.

Every project’s declared packages go into /opt/homebrew through wb-guestd. Projects with conflicting packages use --isolated.

Root makes /opt/<id>, at most 13 characters long, for the project and gives it to the project user. The agent can then install into it. All 59 packages of the test project poured in 230 s.

~/homebrew, owned by the project user, with no help from root.

Decision 2: refuse packages without a bottle? Decided 2026-10-08: A

Section titled “Decision 2: refuse packages without a bottle? Decided 2026-10-08: A”

A bottle is a prebuilt package. When a declared package has none for the guest, Homebrew builds it from source as the toolchain user, which runs more of the package’s code and can take hours (LLVM above).

wb-guestd checks that every package the names need has a bottle for the guest, names them all on the command line with --force-bottle, because Homebrew doesn’t apply it to dependencies, and otherwise refuses the session with the package’s name before anything is installed. The spec says this now.

Homebrew builds what has no bottle, within the session start deadline, after which wb-guestd kills the build.

Not adopted: HOMEBREW_VERIFY_ATTESTATIONS, which has Homebrew check GitHub’s build attestation of each bottle. It would bind bottles to Homebrew’s own build workflow, and needs the gh command and more allowed hosts. The spike didn’t try it, and it stays an option for later hardening of T15-shared-toolchainT15-shared-toolchain: Projects in one guest share the toolchain prefixEvery project user runs tools from the one prefix that the toolchain user owns (S06-01-image-layers, "Toolchain prefix")..

RequirementA. Shared onlyB. Short per-projectC. In each home
SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another. a project can’t touch another’s fileswith the manifest read as namesown prefix onlyown prefix only
FR07-toolchain-manifestFR07-toolchain-manifest: Declared toolchainA project's toolchain is declared host-side (on macOS guests, a Brewfile) and reconciled automatically before a session starts. declared packages installed before the session3 min first time, under a second after4 min first time per projecthours
FR06-native-toolsFR06-native-tools: Native guest toolsAgent tool calls run tools native to the guest operating system (on macOS guests: Homebrew packages, Xcode command line tools, optionally full Xcode). native guest toolsconflicting packages need the isolated VMper projectafter the source builds
NFR01-startupNFR01-startup: StartupGoals: a warm VM reaches the Claude prompt in about 4 s and a suspended VM in about 7 s, and no start takes more than 10 s (p95), excluding first-time project setup and the first boot after a host restart. quick session startnothing to install after the first, again after a new system disksame, and nothing from the imageno

I144I144 (closed): S06-vm-lifecycle: which user installs the base layer before sealingFrom the security review of PR #141 (X17-image-build, #28), finding 3. and I150I150 (closed): S06-vm-lifecycle: minimal base image and named derived images built from recipesS06-vm-lifecycle "Images" puts Homebrew, the Xcode command line tools and wb-guestd in the base image. can write the toolchain user and the derived images into S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does. with the shared prefix confirmed. The wb-guestd user and package work of the walking skeleton (V1-M2-walking-skeletonV1-M2-walking-skeleton: Walking skeletonwb-vmd boots a fixture VM bundle in its confined process, wb-guestd answers over vsock, a data disk made on the host holds the homes, and wb shell opens a PTY as a project user, with its output through the terminal fi…) can build on S06-01-image-layersS06-01-image-layers: Image Layers and the Toolchain PrefixThe layers of a guest image, and the toolchain prefix that project layers install into., “Toolchain prefix”.

Details and glossary

Why a shared prefix is a risk at all. Every project runs tools like git from the prefix. If project A could replace /opt/homebrew/bin/git, project B would run A’s program the next time it commits, with B’s files and B’s network grants. That is persistence from one project into another without root, which SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another. forbids.

Why the Brewfile matters. A Brewfile looks like a list, but Homebrew evaluates it as Ruby. Run as the user the prefix belongs to, any line can write anywhere in the prefix. Reading it on the host as brew "<name>" lines only keeps the common Brewfile working and drops the rest. Third-party taps are refused for the same reason: their package recipes are Ruby too.

Why a home prefix builds from source. Homebrew’s prebuilt packages (bottles) are built for /opt/homebrew. Homebrew 7 can move most of them, but some have the path compiled in, and it can only rewrite that path into one of at most 13 characters, the length of /opt/homebrew. /Users/wbp-b/homebrew is 21. Those packages, Python, Node.js, OpenSSL, git and PostgreSQL among them, are then compiled, and Node.js needs Rust, which needs LLVM.