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..
The picture
Section titled “The picture”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.
What approving commits to
Section titled “What approving commits to”- A new process,
wb-download. One run per download, started throughwb-launcherfrom two fixed entries:wb-download-restore(Apple’smesu.apple.comandupdates.cdn-apple.com) andwb-download-claude(downloads.claude.ai). Its profile is the network part of thewb-proxydprofile that X23-sandboxed-daemonsX23-sandboxed-daemons: Self-sandboxed Go daemons on macOSCan wb-netd, wb-proxyd and wb-hostd confine themselves at start with a sandbox profile, as S04-architecture says, while the Go runtime, inherited descriptors, and Keychain and Secure Enclave access in wb-proxyd keep w… measured for I61I61 (closed): X23-sandboxed-daemons: wb-proxyd profile with Keychain and Secure EnclaveSplit from #34 (X23-sandboxed-daemons) during triage on 2026-10-04., limited to port 443, so it can’t open files, reach the secret store or start programs. It writes only to fileswb-hostdopened, under a file size limitwb-launchersets. It doesn’t follow redirects or read a proxy setting, and has deadlines to connect, between bytes and per request. Each request and each refusal is an audit record that is never dropped. - The restore image is the newest in Apple’s catalog that isn’t newer than the host’s macOS, and not older than a compiled-in minimum (27.0.1) or than the last image a build sealed, unless the user passes
--allow-older-macos.wb-hostdchecks every fieldwb-downloadreports, resumes a partial download with an exactRangeandContent-Range, refuses one without room, checks size and SHA-1 from its own descriptor, and deletes the image once a build has sealed its image. - Claude Code comes from a path fixed per guest platform (
<version>/darwin-arm64/claude), sowb-downloadparses nothing, andwb-release-checknow also checks the manifest’sbinaryfield. - The build order of
mise run buildon macOS: version stamp, Go, Swift,xcodebuildof a committed app project (packages/wraithbox-swift/WraithBox.xcodeproj), the guest tools disk, assembly, signing from the inside out, checks. CI builds the ad-hoc bundle on every pull request. wb setupwrites~/Library/LaunchAgents/nl.wraithbox.hostd.plistand links~/.local/bin/wb, only for a bundle in~/Applicationsor/Applications. It leaves an unchanged agent running, and refuses to replace a changed one while a VM runs.wb setup --removedeletes both and keeps data and store items.- Upgrades replace the bundle by rename, never by copying over it. Then S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves.’s restart applies.
- Migrations run in
wb-hostdonly, forward only, after a backup that never overwrites an older one. A failed backup or migration, a newer database, or a refused configuration key putswb-hostdin a refusing mode. It doesn’t start a daemon or a VM, and launchd doesn’t restart it in a loop.
Options for trusting the restore image
Section titled “Options for trusting the restore image”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.
Other open points
Section titled “Other open points”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. |
Impact
Section titled “Impact”Evidence
Section titled “Evidence”- verified Apple’s catalog (
https://mesu.apple.com/assets/macos/com_apple_macOSIPSW/com_apple_macOSIPSW.xml, 99,450 bytes on 2026-10-15) is an XML property list. Each restore entry hasFirmwareURL,FirmwareSHA1,ProductVersionandBuildVersion, and no other hash. It lists one image, 27.0.1 (26A434), atupdates.cdn-apple.com. Probe:curlandplutil -convert json. - verified The download host answers with
Content-Length: 26637307067,Accept-Ranges: bytesand a206for a range request, so a download can resume. It also sendsx-amz-meta-digest-sha256. Probe:curl -Iandcurl -r 0-15. - verified Apple’s hosts served the catalog and the image without a redirect, and
downloads.claude.aiservedmanifest.json(1,897 bytes),manifest.json.sig(833 bytes) anddarwin-arm64/claude(249,556,880 bytes) for 2.1.300 without a redirect. The manifest’sbinaryfield isclaude. So “no redirects” and the size caps fit. Probe:curl -I. - verified A confined helper bundle completes TLS checks against the system roots with only
com.apple.trustd.agentand the metadata of its own bundle directory beyond the network rules. Source: X23-sandboxed-daemonsX23-sandboxed-daemons: Self-sandboxed Go daemons on macOSCan wb-netd, wb-proxyd and wb-hostd confine themselves at start with a sandbox profile, as S04-architecture says, while the Go runtime, inherited descriptors, and Keychain and Secure Enclave access in wb-proxyd keep w…, “wb-proxyd with the Keychain and the Secure Enclave (I61I61 (closed): X23-sandboxed-daemons: wb-proxyd profile with Keychain and Secure EnclaveSplit from #34 (X23-sandboxed-daemons) during triage on 2026-10-04.)”. - assumed The same rules work for
wb-download, a plain program inContents/MacOS, with the app bundle’s directory in place of a helper bundle’s. The self-check test of 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. checks a TLS fetch under the profile. - assumed The profile’s
sysctl-readrule fornet.routetableis the readgetifaddrsmakes to list the host’s interfaces, which the upstream address rule needs. X23-sandboxed-daemonsX23-sandboxed-daemons: Self-sandboxed Go daemons on macOSCan wb-netd, wb-proxyd and wb-hostd confine themselves at start with a sandbox profile, as S04-architecture says, while the Go runtime, inherited descriptors, and Keychain and Secure Enclave access in wb-proxyd keep w… didn’t measure it. The self-check test of 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. measures the exact name, as for the TLS rules above. - verified A team-signed helper must be its own bundle, and the build gets the profile from an Xcode project. Source: 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….
- verified X17-image-buildX17-image-build: Unattended image buildCan a macOS guest installed from an Apple restore image get past Setup Assistant, with wb-guestd running as a root LaunchDaemon, without SSH, scripted clicks, or MDM? installed macOS from a local restore image in 271.6 s, with no download in
wb-vmd. - inferred Seatbelt’s network rules can name a port but not a remote host, so the host allowlist is in
wb-download’s code. Source: the profiles of X23-sandboxed-daemonsX23-sandboxed-daemons: Self-sandboxed Go daemons on macOSCan wb-netd, wb-proxyd and wb-hostd confine themselves at start with a sandbox profile, as S04-architecture says, while the Go runtime, inherited descriptors, and Keychain and Secure Enclave access in wb-proxyd keep w…, which allow outbound TCP by port. - inferred macOS shows a notification under the bundle of the process that posts it, so the notification helper is the app’s main executable.
- assumed Virtualization’s installer refuses a restore image that Apple didn’t sign. Option A relies on it against a compromised
wb-download. 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 it, and needs a VM. - assumed A raw disk image with one APFS volume, made with
hdiutil, works as the guest tools disk. Virtualization attaches raw images, and the firstapp:bundlebuild checks the rest.
What this unblocks
Section titled “What this unblocks”- The build issues for
app:bundleandapp:install,wb setupand--remove,wb-downloadwith its fuzz target, and thestate.dbmigrations, filed once this merges. - The image build of 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…, which needs a restore image.
- Follow-ups: 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. (installer signature check), 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. (local restore image), 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. (purge).
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/LaunchAgentsthat 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.