S04-01 - Design Principles
Purpose: The design decisions that every host and guest process follows.
Design
Section titled “Design”- One CLI, dispatcher style.
wbis the entry point for every command. Agent commands (wb claude …) pass every following argument to the agent untouched. The agent’s own flags and subcommands then never collide with Wraith Box’s (S05-cliS05-cli: Command Line InterfaceSpecify wb, the single user-facing command.). - Cross-platform core, native edges. These are Go, and the same on
every host OS: session management, policy, approvals, audit, the git
gateway, the network stack, the proxy, the guest agent, and the CLI.
Only the pieces that must call a platform API with no good Go binding
are native:
wb-vmdon macOS (Virtualization framework) and the user-interface helpers. Each is a separate process behind a gRPC contract, with no policy decisions of its own (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., NFR07-maintainabilityNFR07-maintainability: MaintainabilityMost code is cross-platform Go.). - Everything in the guest is untrusted, including
wb-guestd. The host validates every message from the guest as adversarial input. The guest agent is a convenience for the host, not a security component. - Guest confinement narrows, never widens. Controls inside the
guest can only deny what the host would allow. They are Seatbelt
profiles and a Network Extension that labels flows with the program
that opened them. Every
SEC*control holds without them (S13-guest-confinementS13-guest-confinement: Guest ConfinementControls inside the guest that narrow what a project user's processes can do, and tell the host which program opened each connection., T06-forged-labelsT06-forged-labels: Forged program labels after guest rootAfter a guest root escalation, forged program identities in the guest confinement layer (S13-guest-confinement).). - Policy is evaluated on the host, twice.
wb-netddecides which names resolve and which connections are accepted.wb-proxydre-checks the hostname against its own copy of the name mapping and the VM’s effective policy, then the SNI and the HTTP request. A bug in one layer does not open egress on its own. - One work VM per guest OS, many projects; an isolated VM for the
rest. The work VM hosts every project placed there for its guest
OS, new projects included, separated by guest user accounts. An
isolated VM takes projects placed there and
--isolatedsessions (S06-04-vms-and-placementS06-04-vms-and-placement: VMs and PlacementThe work VM and the isolated VM, Xcode in them, and which VM a project's sessions run in.). For macOS guests this fits Apple’s two-VM limit (SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another., NFR05-two-macos-vmsNFR05-two-macos-vms: Platform limitmacOS permits at most two concurrently running macOS guests per host.).- The accounts keep the projects’ files apart.
- The host can’t tell their connections apart. So it enforces the policy and the credential bindings of a VM’s projects for the whole VM (S07-01-per-vm-policyS07-01-per-vm-policy: Enforced per VMWhy the VM is the unit the gateway enforces, how the policies of its projects combine, and what happens when they conflict or change., T11-shared-vm-grantsT11-shared-vm-grants: Projects in one VM share network grantsThe host sees one guest address per VM, and can't tell which project user, session or program opened a connection.).
- No root or administrator rights at run time. The packet transport and the userspace stack replace host networking features that would need them (SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts., NFR04-host-platformsNFR04-host-platforms: Host platformsFirst target: Apple Silicon, macOS 27 or later, because wb image build needs the guest provisioning options that are new in macOS 27 (X17-image-build).).
What stays of the secrets rule
Section titled “What stays of the secrets rule”The early rule on secrets is replaced (see “Decisions”). These parts of it still hold:
wb-netdparses raw guest packets, the largest attack surface. It holds no secrets and opens no outbound connections.wb-proxydsees only TCP byte streams thatwb-netdalready reassembled and validated against the DNS mapping.wb-hostdhas no store access. It may pass on a descriptor with a secret in it without reading it (SEC04-no-guest-secretsSEC04-no-guest-secrets: No secrets in the guestThis includes the model credential., SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts.).
Decisions
Section titled “Decisions”Secrets live in one process, and not the most exposed one (replaced)
Section titled “Secrets live in one process, and not the most exposed one (replaced)”This was a terse early decision. 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. replaced it on 2026-10-07.
- Why replaced: the detailed design showed that it gives one
guest-exposed process,
wb-proxyd, every secret. - Now: the configured secret store holds the credentials. Each
process fetches or uses only its declared items, just in time.
wb-proxydgets only what proxying needs (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.).
Status: Draft