Skip to content

How is Wraith Box built, installed and upgraded, and how does an image build get its downloads?

Decided 2026-10-15: approved, with A for trusting the restore image and the other choices as written. The maintainer merged PR266PR266 (merged): docs(spec): S17-install-and-upgrade, with wb-download for image builds- Approving commits to: S17-install-and-upgrade, a new spec for how the macOS bundle is built, installed, upgraded and migrated, and for wb-download, the program that fetches what an image build needs. with the recommendations of this brief, and the I49I49 (closed): S10-tech-stack: installation, restore image download, upgrades and migrationsS10-tech-stack "Packaging and signing" gives the shape of the macOS app bundle. comment that starts Decision (2026-10-15): records it. Source: I49I49 (closed): S10-tech-stack: installation, restore image download, upgrades and migrationsS10-tech-stack "Packaging and signing" gives the shape of the macOS app bundle., S17-install-and-upgradeS17-install-and-upgrade: Install, Downloads and UpgradesBuild, install, upgrade and remove a Wraith Box bundle, move its stored data to a new version, and download what an image build needs from the internet.. Follows the I49I49 (closed): S10-tech-stack: installation, restore image download, upgrades and migrationsS10-tech-stack "Packaging and signing" gives the shape of the macOS app bundle. decision of 2026-10-04 (a dedicated download program that wb-hostd invokes), the 2026-10-12 comment (it also fetches Claude Code) and the triage of 2026-10-15 (signing as in X29-dev-signingX29-dev-signing: Keychain access group for development buildsCan a developer's free personal team, an Apple ID signed in to Xcode without a paid membership, sign the helpers in Wraith Box.app (wb-proxyd, wb-hostd, wb-vmd) with a keychain-access-groups entitlement and a provisio…, B248-dev-signingB248-dev-signing: Can development builds signed by the developer's own team share Keychain items across an update?Yes, with conditions.). Touches S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves., S05-cliS05-cli: Command Line InterfaceSpecify wb, the single user-facing command., 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., S09-policy-credentials-auditS09-policy-credentials-audit: Policy, Credentials, Certificates and AuditWhere policy comes from, how secrets are held, how TLS inspection is trusted, and what is recorded., S10-tech-stackS10-tech-stack: Technology ChoicesFix languages, libraries, packaging, and repository layout, with the reason for each choice., S12-platformsS12-platforms: PlatformsWhich host and guest operating systems Wraith Box targets, how platform-specific code is isolated, what each platform uses, and how wb works inside WSL., S14-claude-in-guestS14-claude-in-guest: Claude Code in the GuestHow Claude Code gets into the guest image, which of the user's Claude Code configuration goes with it, how it starts, and the agent interface that keeps Claude Code's specifics in one place (V1-02-claude-only)., S15-least-privilegeS15-least-privilege: Least Privilege on the HostThe security design for SEC12-least-privilege: which rights Wraith Box takes on the host, where credentials are held, and how each host process gets only the credentials it needs, for only as long as it needs them. and T00-indexT00-indexboundary 6 is the host terminal stream., and adds the test cases C12-install-and-downloadsC12-install-and-downloads: Install and DownloadsThe test cases for installing and upgrading Wraith Box: wb-download, wb-release-check, the checks wb-hostd makes on what it fetches, wb setup, and the migrations of state.db and configuration..

host: runs as the user, no rootinternet, HTTPS onlyApplemesu.apple.comupdates.cdn-apple.comAnthropicdownloads.claude.aiwb-hostdno networkopens the fileschecks size and SHA-1wb-launcherfixed entrieswb-downloadone run, confinedhosts compiled instartsfiles in <data>images/macos-restore.ipsw(.partial)downloads/: a Claude Code releasewrites to inherited descriptorsopen, check, renamewb-release-checksignature, version, SHA-256wb-vmd-installreads the restore imagebuild guest: untrustedwb-guestdinstalls the checked binarythe checked bytes, over the host-guest socket

Figure 1. The downloads of an image build. Only wb-download connects to the internet, and only to the hosts compiled into its entry. wb-hostd has no network, opens every file itself, and checks what arrives before anything uses it.

Apple’s catalog lists only a SHA-1 per image, and isn’t signed. The hash check catches a damaged or swapped file. A compromised wb-download that reports its own URL and hash gets past it.

The choice also decides how I263I263 (open): S17-install-and-upgrade: build an image from a local restore image fileS17-install-and-upgrade (#49) gets the macOS restore image only from Apple's catalog, through wb-download., a restore image from a local file, could be checked. Under A, an offline host has no catalog to check a local file against, so I263I263 (open): S17-install-and-upgrade: build an image from a local restore image fileS17-install-and-upgrade (#49) gets the macOS restore image only from Apple's catalog, through wb-download. would need the user to supply the hash or to trust the file. Under B, the pinned SHA-256 checks a local file offline as well as a downloaded one.

A. Catalog SHA-1, plus Apple’s check at install

Section titled “A. Catalog SHA-1, plus Apple’s check at install”

wb-hostd checks the file against the catalog’s SHA-1. Against a compromised downloader, the design relies on Virtualization’s installer refusing an image Apple didn’t sign, which I262I262 (closed): X30-installer-trust: Installer refusal of a changed restore imageS17-install-and-upgrade (#49) checks a downloaded macOS restore image against the SHA-1 that Apple's catalog (mesu.apple.com) lists, the only hash it lists. measures. If I262I262 (closed): X30-installer-trust: Installer refusal of a changed restore imageS17-install-and-upgrade (#49) checks a downloaded macOS restore image against the SHA-1 that Apple's catalog (mesu.apple.com) lists, the only hash it lists. finds that the installer accepts a changed image, A no longer holds, and B is the fallback: the catalog only says where to fetch, and wb-hostd accepts only a restore image whose SHA-256 is compiled into the release.

B. Hashes pinned in each Wraith Box release

Section titled “B. Hashes pinned in each Wraith Box release”

Each release compiles in the SHA-256 of the restore images it accepts, and refuses any other.

The download host sends x-amz-meta-digest-sha256 with the file. wb-download would report it, and wb-hostd would check it too.

Each has a recommendation, which the spec states. Approving the spec accepts them.

Point Recommended, in the spec Alternative
The restore image after a build Deleted once the build seals its image, freeing about 27 GB. A failed build keeps it for the retry. Kept for the next build, which then skips the download.
A restore image from a local file Out of scope for V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there. (I263I263 (open): S17-install-and-upgrade: build an image from a local restore image fileS17-install-and-upgrade (#49) gets the macOS restore image only from Apple's catalog, through wb-download.). wb image build --restore-image <file> for offline and managed hosts.
Uninstall wb setup --remove keeps data and store items, and prints where they are (I264I264 (open): S17-install-and-upgrade: wb setup --remove --purgewb setup --remove (S17-install-and-upgrade, #49) unloads the LaunchAgent and deletes the plist and the wb link, and keeps <config, <data, <logs and the secret store items. for --purge). A --purge that deletes them through their owners.
Where wb is linked ~/.local/bin/wb, with the PATH line printed. wb setup leaves shell files alone. /usr/local/bin, which needs administrator rights on many Macs.
The LaunchAgent A plist wb setup writes and loads with launchctl. SMAppService, which needs a Swift or Objective-C call and an approval in System Settings.
The app’s main executable The notification helper. A stub, until the helper exists.
The ad-hoc bundle identifier nl.wraithbox.dev.adhoc, or WB_BUNDLE_ID. none proposed
A failed migration wb-hostd keeps running and refuses everything but wb status. Exit, which launchd restarts in a loop.
The rollback floor A compiled-in minimum of 27.0.1, and no image older than the last sealed one without --allow-older-macos. No floor: the catalog decides.
Where the bundle may be installed ~/Applications or /Applications, else wb setup refuses. Anywhere, with a warning.
The restore image’s file size limit 40 GiB, and the free-space check asks for that limit, less the partial file, plus the audit floor, because the host knows it before the run. The image is 26.6 GB today. Check against the size wb-download reports, which a compromised one could understate.
wb setup while VMs run Refused when the agent would change, so no session is stopped by surprise. An unchanged agent is left running. Stop the VMs and reload.
Download deadlines 30 s to connect, 60 s without a byte, 2 minutes for small files, 30 minutes for Claude Code, 12 hours for the restore image. Other values. They aren’t measured, only sized to the 27 GB image on a slow line.
RequirementA. catalog SHA-1B. pinnedC. plus header
SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts. each process gets only what it needswb-hostd no networkwb-hostd no networkwb-hostd no network
SEC10-auditSEC10-audit: AuditEvery egress decision, approval, and returned change is recorded on the host in a persisted log the guest cannot alter. egress decisions recordeda record per requesta record per requesta record per request
SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another. projects can’t reach each otherif I262I262 (closed): X30-installer-trust: Installer refusal of a changed restore imageS17-install-and-upgrade (#49) checks a downloaded macOS restore image against the SHA-1 that Apple's catalog (mesu.apple.com) lists, the only hash it lists. holdspinned imageif I262I262 (closed): X30-installer-trust: Installer refusal of a changed restore imageS17-install-and-upgrade (#49) checks a downloaded macOS restore image against the SHA-1 that Apple's catalog (mesu.apple.com) lists, the only hash it lists. holds
NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it. refusals name the rulenamed rulesnamed rulesnamed rules
New macOS releasesthe same dayafter a Wraith Box releasethe same day
Details and glossary

Why a program of its own. The 2026-10-04 decision on I49I49 (closed): S10-tech-stack: installation, restore image download, upgrades and migrationsS10-tech-stack "Packaging and signing" gives the shape of the macOS app bundle. chose a dedicated program over wb-proxyd (this brief’s earlier recommendation) and wb-hostd (the issue’s proposal). wb-hostd faces the guest, so it stays off the network. wb-proxyd faces the guest’s traffic and holds credentials, so it doesn’t take on more. wb-download holds no credential, doesn’t face a guest, and runs only during an image build.

Why wb-hostd opens the files. wb-download’s profile denies every file path, so it can only write where wb-hostd pointed it. It can’t touch an image, a VM bundle or a credential.

Why a refusing mode. launchd restarts wb-hostd whenever it exits (S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves.). A wb-hostd that exited on a database it can’t read would start again at once, forever. Staying up lets wb status say why.

Glossary

  • Restore image: Apple’s macOS installer file (.ipsw, about 27 GB) that Virtualization installs into a new VM.
  • Catalog: Apple’s list of current restore images, with each one’s address and SHA-1.
  • LaunchAgent: a file in ~/Library/LaunchAgents that tells macOS to run a program for one user and restart it when it exits.
  • Ad-hoc signing: signing without a developer identity (codesign -s -). Such a build has no Keychain backend.
  • Migration: a step that changes the layout of stored data from one version to the next.
  • SHA-1: an older hash. Anyone can now make two files with the same SHA-1, but no known attack makes a file that matches an existing file’s SHA-1.