Skip to content

S07 - Egress Gateway

Purpose: The only path from a guest to any network: a userspace network stack (wb-netd) and a policy-enforcing proxy (wb-proxyd) on the host.

Requirements: FR08-no-proxy-configFR08-no-proxy-config: No per-tool proxy settingsAllowlisted network destinations work for every tool without per-tool proxy configuration. to 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., SEC04-no-guest-secretsSEC04-no-guest-secrets: No secrets in the guestThis includes the model credential. to SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another., SEC10-auditSEC10-audit: AuditEvery egress decision, approval, and returned change is recorded on the host in a persisted log the guest cannot alter., SEC11-root-gains-nothingSEC11-root-gains-nothing: Guest root is not a privilegeFull control of the guest grants no control over enforcement, secrets, or policy., SEC13-bounded-resourcesSEC13-bounded-resources: Bounded resourcesCPU, memory and disk of each VM are capped., NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it.. Residual risk 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..

Tests: C01-network-and-dnsC01-network-and-dns: Network and DNSThe test cases for the guest's network path: the link endpoint, addressing, and the DNS gateway with its hold, quiet refusals, and negative answers., C02-streams-and-tlsC02-streams-and-tls: Streams, TLS, and the Inspection CAThe test cases for the streams wb-proxyd takes over: the hand-off from wb-netd, the first-byte and TLS checks, upstream addresses, the HTTP request form, and the inspection CA's leaves, rotation, and keys., C03-policy-and-approvalsC03-policy-and-approvals: Policy and ApprovalsThe test cases for network policy: loading it, combining the policies of the projects in one VM, modes per host, profile parts, learn mode, and the approval flow., C05-credentials-and-storeC05-credentials-and-store: Credentials and the Secret StoreThe test cases for the secret store and its callers, the signing setup that gives development builds their Keychain groups, and the credential checks wb-proxyd makes on guest requests and server responses., C06-model-apiC06-model-api: Model APIThe test cases for the model credential: its placeholder, the scan for the placeholder in whole requests, what is injected on the model API, the event log, and Claude Code end to end., C07-dependency-gateC07-dependency-gate: Dependency GateThe test cases for the dependency gate: registry paths, minimum age and known vulnerabilities, the Go checksum database clock, and Homebrew bottles from ghcr.io.

Briefs: B17-network-pathB17-network-path: Does a macOS guest work on our userspace network stack, reaching only the proxy, and how fast?Yes, with conditions., B32-dep-gate-registriesB32-dep-gate-registries: Can the dependency gate refuse young packages without breaking installs?Yes, with conditions., B33-no-guest-credentialsB33-no-guest-credentials: Can the proxy drop every credential the guest sends without breaking its tools?Yes, with conditions., B35-openshell-artifactsB35-openshell-artifacts: Do the OpenShell parts the specs reuse exist as assumed?Yes, with conditions., B36-flow-attributionB36-flow-attribution: Can projects sharing the work VM keep their network grants apart?Not as the specs are written., B40-learn-pass-modesB40-learn-pass-modes: May learn mode and pass mode open holes in default-deny egress?Learn mode should collect unknown names and refuse them, so SEC05-default-deny is unchanged., B47-non-http-streamsB47-non-http-streams: What does the gateway do with a connection that isn't TLS or HTTP?Reset it and audit the rule, unless policy names that host and port for raw TCP., B51-approval-flowB51-approval-flow: What happens between a blocked lookup and the user's answer?Hold the DNS answer for a few seconds while the notification is open, answer a refusal with a negative TTL of zero, and keep guest OS names out of notifications., B60-model-credentialB60-model-credential: Can Claude Code in the guest hold only a placeholder while the proxy adds the real subscription token?Yes, for a long-lived token from claude setup-token., B68-proxyd-stream-identityB68-proxyd-stream-identity: How does wb-proxyd know which VM and name a stream belongs to, when wb-netd may be compromised?From the per-VM socket the stream arrived on and from name reports it checked itself, so nothing wb-netd writes can widen what a stream reaches.

host: trusted guest: untrusted agent, tools virtual NIC wb-hostd approvals · policy changes, wb-proxyd first wb-netd link filter DHCP DNS: synthetic addresses unknown name: NXDOMAIN TCP to an allowed name and port only wb-proxyd re-checks the name protocol check inspect · pass · audit credential replacement HTTP policy dependency gate upstream allowed host frames hand-off per VM approval events policy raw IP, the LAN, IPv6, UDP other than DNS: dropped or reset
The egress gateway. Every frame from the guest's virtual NIC reaches wb-netd, which filters the link, serves DHCP and DNS with synthetic addresses, and accepts TCP only to an allowed name and port. wb-netd hands each stream to wb-proxyd over the VM's own hand-off socket. wb-proxyd re-checks the name, checks the protocol, and applies the host's mode, credential replacement, HTTP policy and the dependency gate before it connects upstream. An unknown name raises an approval event in wb-hostd, which sends policy changes to wb-proxyd first. Raw IP, the LAN, IPv6, and UDP other than DNS are dropped or reset.

Every packet a guest sends reaches wb-netd, the packet path. Every TCP stream to an allowed name goes on to wb-proxyd, the stream path.

Page What it covers
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. The VM as the unit of policy: the union of its projects, conflicts, changes while sessions run, and session end
S07-02-packet-pathS07-02-packet-path: Packet PathHow wb-netd carries the guest's frames: the packet transport, the stack, the link filter, its caps, addressing, the MTU and connections. wb-netd: the packet transport, the link filter, caps, DHCP, the MTU, connections, and performance
S07-03-dnsS07-03-dns: DNSHow wb-netd answers the guest's DNS queries: synthetic addresses, the name form, negative answers and the wildcard budget. The DNS server of wb-netd: synthetic addresses, the name form, negative answers and the wildcard budget
S07-04-dns-refusalsS07-04-dns-refusals: DNS RefusalsHow wb-netd refuses a name: approval events, the hold before each refusal, quiet refusals, and the answer that is the same for every reason. How wb-netd refuses a name: approval events, the hold, quiet refusals, and the same answer for every reason
S07-05-stream-hand-offS07-05-stream-hand-off: Stream Hand-offHow wb-netd hands each stream to wb-proxyd, and the checks that keep a compromised wb-netd from widening what a stream may reach. How a stream passes from wb-netd to wb-proxyd, and why wb-netd can only narrow
S07-20-handoff-socketsS07-20-handoff-sockets: Hand-off SocketsThe life of one VM's hand-off socket: its identity, the acknowledgments of both ends, how it closes, who a failure is charged to, what each restart does to it, and which of its decisions reach the audit log. The life of a VM’s hand-off socket: its number, both acknowledgments, closing, charges, restarts and audit
S07-21-vm-endS07-21-vm-end: A VM's End in wb-proxydHow wb-hostd ends a VM's hand-off sockets in the one wb-proxyd, and how the VM's last event records reach its stop record without one VM's stop or backlog taking the other VM's network down. How a VM’s sockets end in wb-proxyd, and how its last event records reach the stop record
S07-06-name-mappingS07-06-name-mapping: Name MappingHow wb-proxyd keeps its own checked copy of the names wb-netd gave synthetic addresses: name reports, releases, replay, lifetime, the second count of the wildcard budget, and the copy wb-hostd keeps. wb-proxyd’s checked copy of the name mapping: reports, releases, replay and the second wildcard count
S07-07-hosts-and-modesS07-07-hosts-and-modes: Hosts and ModesHow wb-proxyd binds a stream to its name, which upstream addresses it refuses, and the inspect, pass and audit modes. Name binding, the upstream address rule, the inspect, pass and audit modes, and guarded hosts
S07-08-requests-and-credentialsS07-08-requests-and-credentials: Requests and CredentialsThe form of each request wb-proxyd sends upstream, and how it removes the guest's credentials and injects bound ones. The request form, and credential replacement
S07-09-placeholder-bindingS07-09-placeholder-binding: Placeholder BindingWhere a credential placeholder may go in a request, how wb-proxyd scans for it, and what it refuses. Where a placeholder may go, and the scan that enforces it
S07-10-anonymous-credentialsS07-10-anonymous-credentials: Anonymous CredentialsHow wb-proxyd answers hosts that want a token even for public reads, without forwarding the guest's token. Fixed public tokens for anonymous reads, and the ghcr.io token fallback
S07-11-http-policyS07-11-http-policy: HTTP PolicyThe HTTP rules of inspected hosts, the built-in profiles, and the parts a user can turn off. HTTP rules, the built-in profiles, and profile parts
S07-12-dependency-gateS07-12-dependency-gate: Dependency GateHow wb-proxyd keeps young and vulnerable package versions from the guest on the gated registries. The dependency gate on package registries
S07-13-publish-timeS07-13-publish-time: Publish TimeWhere the dependency gate gets each version's publish time, and how it builds a clock for Go modules from the checksum database. Publish times, and the Go module clock from the checksum database
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. Verified lookups in the checksum database, their caches and limits
S07-15-non-http-streamsS07-15-non-http-streams: Non-HTTP StreamsHow wb-proxyd checks the protocol of each stream, and what it does with SSH, other protocols and raw TCP. The protocol check on each stream, SSH, and raw TCP entries
S07-16-tls-and-tunnelsS07-16-tls-and-tunnels: TLS and TunnelsWhat wb-proxyd does with client certificates, encrypted ClientHello and tunnels, and which refusals no mode or approval relaxes. Client certificates, encrypted ClientHello, tunnels, and refusals audit mode doesn’t relax
S07-17-approvals-and-learningS07-17-approvals-and-learning: Approvals and LearningHow an unknown destination reaches the user as an approval request, what an approval grants, and how learn mode collects names. Approvals of unknown destinations, and learn mode
S07-18-build-networkS07-18-build-network: Build NetworkThe build VM's network: what its wb-netd serves, the one connection to the guest's port 22, and its refusal for session VMs. The build VM’s wb-netd: DHCP, ARP and one connection to the guest’s port 22, with no egress, refused for session VMs
S07-19-request-decisionsS07-19-request-decisions: Request DecisionsHow wb-proxyd decides a request on an inspected host: the order of the steps, their rule names, what a git hosting write is, and what audit relaxes. The order in which wb-proxyd decides a request, its rule names, git hosting writes, and what audit relaxes

The table is in reading order. Page 20 and pages 12 to 17 continue the page above them.

Status: Draft