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).
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.
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).
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")..
Impact
Section titled “Impact”Evidence
Section titled “Evidence”- verified The toolchain user (uid 440, shell
/usr/bin/false, password*, outside the admin group) installed Homebrew 7.0.8 into the/opt/homebrewroot made for it, with Homebrew’s own installer and nosudo. 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)?, “Answer” part 1. - verified As a project user, every write to the prefix and
brew install,uninstall,linkandupdatefailed, andsuto the toolchain user failed. Only the toolchain user and its own group can write the prefix’s files, and none is set-user-ID. Source: “Answer” part 2,probe-shared.sh, andprobe-shared-2.shfor theCellarwrite andbrew install tree. - verified
sudo -n -u _wbtoolwas refused. That rules out a rule without a password only, and the 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… checksudo -l -Ucovers the rest. Source: “Answer” part 2. - verified A Brewfile with a
systemline, run bybrew bundleas the toolchain user, created a file in/opt/homebrew/bin. Source: “Answer” part 4. - verified Older versions of the same packages installed side by side and ran from their own folders.
mysqlwas refused whilemariadbwas installed.python3in the sharedbinwas 3.14 for a project that declared 3.13. Source: “Answer” part 5. - verified Times: 179 s for the test project in the shared prefix, 66 s for a second project after it, under a second when nothing is new, 230 s in a short per-project prefix, unfinished after 51 minutes in a home prefix. Source: “Measurements”.
- verified A symbolic link from a short path to the home doesn’t help: Homebrew followed it and started building from source. Source: “Answer” part 7.
- assumed That a reconcile never changes what another running session uses.
HOMEBREW_NO_INSTALL_UPGRADEcovers only the packages on the command line, so the control is the formula data pinned at image build. The spike didn’t try it (condition 4, 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.). - assumed That a session
PATHwith only the declared packages’ folders, and not the sharedbin, is enough for common tools, which the spike didn’t try (condition 5, 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.). - assumed That Homebrew keeps its temporary and cache files in the toolchain user’s mode-700 home when told to, and not in the shared
/private/tmp, which the spike didn’t try (condition 7, 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.).
What it unblocks
Section titled “What it unblocks”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.
- Prefix: the folder Homebrew installs into, with
bin,Cellar(one folder per package version) andopt(a stable link per package). - Bottle: a prebuilt Homebrew package.
- Keg-only: a package Homebrew installs but doesn’t link into the shared
bin, for example an older version. - Tap: a third-party collection of Homebrew package recipes.
- Toolchain user: the non-admin account of 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. that the prefix belongs to. The spike called it
_wbtool, and the name is still open.