Skip to content

S05-03 - Management Commands

Purpose: The commands of wb other than the agent commands.

Command Purpose
wb status VMs, sessions, approvals and host processes (“wb status”)
wb sessions [--project P] List sessions and their returned work
wb diff <session> Review returned work, with flagged paths highlighted
wb land <session> [--branch NAME] Fetch returned work into the host repo as a branch. It never checks out or merges
wb discard <session> Drop returned work, and the session’s guest worktree with its history link. A lost session ends with no recovery push (S06-11-reconnect-and-recoveryS06-11-reconnect-and-recovery: Reconnect, Loss and RecoveryWhat happens when the host-guest link drops, when a session is lost, and how a lost session's work is recovered or discarded., “Discarding a lost session”)
wb approve <id> / wb deny <id> Answer a pending approval request (“wb approve and wb deny”)
wb allow <host> [--project P] Add an allowlist entry (SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable.)
wb policy show/explain/edit [--project P] The effective policy, and why a request was allowed or refused (NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it.)
wb learn report [--project P] The suggested allowlist from a learn-mode session (FR10-learn-modeFR10-learn-mode: Learn modeA learn mode, available only to projects whose placement is work (S05-cli), records the destinations a project needs and proposes an allowlist.)
wb trust [<repo>] [--project P] / wb untrust [<repo>] [--project P] Set or clear the project’s config_trust (“wb trust and wb untrust”)
wb project show [--project P] The project’s id, name, location, recorded identity (remote URLs, root commits), placement and config_trust
wb project move <dir> [--project P] Point the project at the repository in <dir>. It keeps its id, state, approvals and policy (S05-04-namingS05-04-naming: NamingHow wb identifies a project, a session and its branch, and how projects are registered, checked, moved and removed.)
wb project rename <name> [--project P] Change the project’s name. The id stays
wb project place work|isolated [--project P] Set the project’s placement (“wb project place”)
wb project confirm Accept the current remote URLs and root commits of the repository in the directory as the project’s, and clear config_trust (S05-04-namingS05-04-naming: NamingHow wb identifies a project, a session and its branch, and how projects are registered, checked, moved and removed.). It takes no --project, because it reads the identity from a repository and --project names none
wb project rm [--project P] Remove a project and everything Wraith Box holds for it (S05-04-namingS05-04-naming: NamingHow wb identifies a project, a session and its branch, and how projects are registered, checked, moved and removed.)
wb cred set/rm <binding>, wb cred list Manage the binding credentials in the secret store (“wb cred”)
wb audit tail/search Read the audit log (SEC10-auditSEC10-audit: AuditEvery egress decision, approval, and returned change is recorded on the host in a persisted log the guest cannot alter.)
wb gate reset go-clock Reset the Go clock after a go-sumdb-inconsistent finding (S07-14-go-lookupsS07-14-go-lookups: Go LookupsHow the dependency gate looks up a Go version's record number in the checksum database, verifies it, caches it, and bounds the work., “Recovery”)
wb vm reset-ca <vm> Replace a VM’s CAs after a ca-key-restore refusal (“wb vm reset-ca”)
wb vm reset-data <vm> Give a stopped VM a new, empty data disk after a data disk refusal (“wb vm reset-data”)
wb vm start/stop/suspend/status Explicit VM control (“wb vm”)
wb vm admin <vm> A root shell in a running VM for the person at the terminal, which marks the VM’s system disk for replacement (S15-05-admin-pathS15-05-admin-path: The Admin PathHow the person at the host's terminal gets a root shell in their own guest, on a path that no agent, session, or guest process can start or reach.)
wb image build/list/use/shell Image management (“wb image”)
wb shell [--project P] A debug shell as the project user, labeled as a debug shell (“wb shell”)
wb setup Check the host, and install and start the per-user services (“wb setup”)
wb help, wb version Help and version

Each command has its own flags, after the command name. The names of commands are reserved: a new agent command may not reuse one.

wb trust, wb untrust and each wb project command that changes a project write a Device Config State Change (5019) event. Those wb project commands are move, rename, place, confirm and rm. The event holds the project, and the values before and after (SEC10-auditSEC10-audit: AuditEvery egress decision, approval, and returned change is recorded on the host in a persisted log the guest cannot alter., S09-11-auditS09-11-audit: AuditWhat the audit log records, the budgets that bound it, and what happens when the log can't be written.).

wb status shows:

On macOS it also shows the expiry date of the signing profile in the helper bundles, and the fix. It does that when the date is 30 days away or less, or after it (S12-03-host-prerequisitesS12-03-host-prerequisites: Host PrerequisitesWhat wb setup checks on each host, and how a development build on macOS gets signed., “Development builds on macOS”).

wb approve <id> and wb deny <id> answer the pending approval request with that id. They are the alternative to the notification.

Both print what is being approved. That text includes guest-influenced values, such as hostnames and paths. wb strips control and escape sequences from every such value before printing it. So the guest can’t rewrite the approval screen (SEC14-no-fake-approvalsSEC14-no-fake-approvals: Approvals cannot be spoofed by the guestApproval prompts are never rendered in the agent's terminal stream.).

They set or clear the project’s config_trust, which allows repository-supplied configuration (SEC09-host-policySEC09-host-policy: Policy is held on the hostThe guest cannot read or change policy.). They don’t change the VM.

<repo> defaults to the current directory. It resolves to its project by the rules of S05-04-namingS05-04-naming: NamingHow wb identifies a project, a session and its branch, and how projects are registered, checked, moved and removed..

wb project place sets the project’s placement (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.).

In a repository that isn’t a project yet, it first registers one, by the rules of S05-04-namingS05-04-naming: NamingHow wb identifies a project, a session and its branch, and how projects are registered, checked, moved and removed.. Those include the moved-project refusal and the second-clone placement. So a new clone can start isolated.

wb cred set <binding>, wb cred list and wb cred rm <binding> manage the binding credentials in the secret store. wb-proxyd fetches them when proxying needs them (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.).

This command follows a ca-key-restore refusal.

  1. It prints the VM’s CAs and their fingerprints, and asks for confirmation.
  2. Then wb-hostd, sent the fingerprints the person saw:
    • refuses with vm-running, vm-resetting or ca-record-changed;
    • drops the CAs from its record, in one transaction with the next two;
    • writes a 5019 event with the command and their fingerprints;
    • puts their keys on the removal list;
    • deletes the VM’s saved state.

The next start then cold boots with a new CA (S09-06-ca-keysS09-06-ca-keys: CA KeysHow the key of each TLS inspection certificate authority is made, stored and restored, and when a CA is valid., “Valid CA”).

The command is refused without a terminal, because a person has to confirm. It asks in its own terminal, never in a session’s stream (SEC14-no-fake-approvalsSEC14-no-fake-approvals: Approvals cannot be spoofed by the guestApproval prompts are never rendered in the agent's terminal stream.). It is never part of a guest RPC.

This command follows a data disk refusal: data-disk-missing, data-disk-unrecorded, or a data volume wb-guestd can’t mount (S06-13-data-disk-formatS06-13-data-disk-format: Data Disk FormatHow the host formats a VM's new data disk, the one exception SEC15-no-guest-disk-mount makes, and the checks before a VM starts with its disk.). <vm> is work or isolated.

  1. It prints the VM, its data disk and the space the disk takes on the host, from the file’s st_blocks. It says that every project’s home on that disk is lost: its Claude Code state, and commits not yet pushed. It asks for confirmation.
  2. Then wb-hostd, asked over local IPC:

The project users’ host records stay, because their IDs are never reused (S06-03-image-updatesS06-03-image-updates: Image UpdatesHow a VM gets a new image's system disk while its data disk and project users stay, and the guest admin password of each VM.). A new, empty home is made on the new volume.

The command is refused without a terminal, because a person has to confirm. It asks in its own terminal, never in a session’s stream, and no flag skips the question (SEC14-no-fake-approvalsSEC14-no-fake-approvals: Approvals cannot be spoofed by the guestApproval prompts are never rendered in the agent's terminal stream.). It is never part of a guest RPC.

wb vm start/stop/suspend/status controls a VM explicitly. Each takes the VM as its argument, work or isolated, and status without one shows both. wb names the VM to wb-hostd as a value of the contract’s VM enum, never as a path. A command without a VM, with another name, or with an extra argument is a usage error (exit 2). wb asks wb-hostd over local IPC. Any refusal or failure ends with one wraith box: <message> (<rule>) line and exit 255 (S05-02-exit-status-and-signalsS05-02-exit-status-and-signals: Exit Status and SignalsWhat wb claude exits with, and what it does with each signal.).

start returns after the VM runs and wb-hostd accepted or refused the hello of its wb-guestd, or after a deadline. The deadline is in code, above the cold boot of X18-vsock-handoffX18-vsock-handoff: Host-guest socket and descriptor hand-offCan wb-guestd, written in Go, open AFVSOCK sockets in a macOS guest? with a margin. A refused hello and a link that isn’t up by the deadline both exit 255, and leave the VM running for stop. A start or a stop that wb-hostd began runs to its end when wb goes away, as from Ctrl-C. When its answer doesn’t arrive, wb says the VM may still be starting or stopping, and names wb vm status.

status shows, for each VM, its state, its generation, the guest link with wb-guestd’s version or the refusal with both versions, and the last error of the Virtualization framework. The guest’s version is guest input, so wb removes control and escape characters from it and cuts it to 64 bytes (“wb approve and wb deny”).

suspend saves the VM’s state for a warm start (S06-06-devices-and-warm-startS06-06-devices-and-warm-start: Devices, Warm Start and TimeA VM's devices and resources, saving and restoring its state, and how the guest clock follows the host.). Until warm start is built, wb refuses it with vm-suspend-needs-warm-start without asking wb-hostd.

stop and suspend are refused while the VM has a session that is starting, running, paused or ending (vm-live-sessions). The refusal names each such session, the process ID of its wb, and how it ends: close its terminal, or wait for its deadline. wb sessions lists them (S06-09-session-lifecycleS06-09-session-lifecycle: Session LifecycleA session's states from wb claude to its summary, how it starts and ends, its deadlines, and when its VM may be saved., “Idle suspend”). With a wb vm admin shell open, both are refused with vm-admin-open (S15-05-admin-pathS15-05-admin-path: The Admin PathHow the person at the host's terminal gets a root shell in their own guest, on a path that no agent, session, or guest process can start or reach.).

stop asks the guest to shut down, and stops the VM at once when the guest hasn’t stopped by a deadline. A stop of a stopped VM is refused with vm-not-running, and a start of a VM that isn’t stopped with vm-running. A start whose wb-vmd doesn’t open or answer within a deadline is refused with vm-start-timeout, and that wb-vmd is closed.

suspend is also refused while a kill of a project user is pending, or after a leftover-process result (S06-10-leftover-processesS06-10-leftover-processes: Leftover ProcessesThe results of the kill of a project user, how wb-hostd accepts them, and what it does when processes are left.). That refusal says to wait up to 7 minutes for the cleanup result, or to stop and start the VM.

start of the isolated VM is refused while wb image build has borrowed its slot. The refusal names the build (S06-07-slot-admissionS06-07-slot-admission: Slot AdmissionHow wb-hostd admits every macOS VM it starts against the limit of two, and lends the isolated VM's slot to a maintenance VM.).

wb image build/list/use/shell manages the base and the named images (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., S06-17-named-imagesS06-17-named-images: Named Images and RecipesThe build of a named image from a recipe on a clone of the sealed base.).

wb shell [--project P] runs /bin/zsh -l as the project user, in that user’s home, in the project’s VM. It takes no command to run. It resolves the project from the directory unless --project is given (S05-04-namingS05-04-naming: NamingHow wb identifies a project, a session and its branch, and how projects are registered, checked, moved and removed., “Which commands”). It refuses a directory that isn’t a registered project, and names wb claude and wb project place as the ways to register one. It refuses a host terminal whose charset isn’t UTF-8, as wb claude does (S05-01-agent-commandsS05-01-agent-commands: Agent CommandsHow wb claude passes its arguments to Claude Code, how it runs interactive and non-interactive sessions, and what a session does., “A terminal that isn’t UTF-8”).

wb labels it as a debug shell:

The shell’s output reaches the terminal through the filter, and wb writes the title, the reset and the drain around it, as for an agent session (S16-terminal-streamS16-terminal-stream: Terminal StreamHow wb guards boundary 6 of T00-index, the guest output that wb writes to the user's terminal.). Its exit status and signals are those of S05-02-exit-status-and-signalsS05-02-exit-status-and-signals: Exit Status and SignalsWhat wb claude exits with, and what it does with each signal., with the shell in place of claude.

wb setup:

  1. checks the host prerequisites (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.), and the minimum git version (S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem.). A refused git, or a config.toml it can’t read, refuses wb setup before it creates or installs anything (S08-08-host-gitS08-08-host-git: Host GitWhich git binary runs on the host, the oldest version Wraith Box accepts, and where that is checked., “Where it is checked”);
  2. creates the projects root <data>/projects, and its probe directory. wb-hostd can’t write them (S04-03-self-sandboxingS04-03-self-sandboxing: Self-SandboxingHow each host daemon confines itself at startup, and the wb-launcher that starts confined programs on macOS., “Each host daemon is self-sandboxed”);
  3. installs and starts the per-user services. On macOS those are the wb-hostd LaunchAgent and the ~/.local/bin/wb link (S17-02-setupS17-02-setup: InstallHow wb setup installs Wraith Box from its bundle without administrator rights, and how wb setup --remove takes it out.).

Per platform:

wb setup --remove refuses while a VM runs. Otherwise it unloads the services and deletes those files. It keeps the user’s data and store items.

Status: Draft