How should guest dev servers and clipboard text cross to the host?
Decided 2026-10-04: D. Neither in V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there.. The decision and its reasons are in the I38I38 (closed): S06-vm-lifecycle: design port forwarding and clipboard (FR11-port-forward, FR12-clipboard) and their threatsFR11-port-forward (dev servers on host loopback) and FR12-clipboard (clipboard) cross the VM boundary, but no spec designs them and S03-requirements's threat model does not list them. comment that starts Decision (2026-10-04):. Source: I38I38 (closed): S06-vm-lifecycle: design port forwarding and clipboard (FR11-port-forward, FR12-clipboard) and their threatsFR11-port-forward (dev servers on host loopback) and FR12-clipboard (clipboard) cross the VM boundary, but no spec designs them and S03-requirements's threat model does not list them.. Affects T00-indexT00-indexboundary 6 is the host terminal stream., 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. and 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..
The problem
Section titled “The problem”Figure 1. Forwarding a guest port to the same port on host localhost, as 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. implies. Cookies don’t separate ports, and the browser sends cookies set by other local services to the guest’s server. A page from the guest runs in the host browser and can send requests to any service on host loopback. The guest also chooses which ports appear.
Options for forwarding
Section titled “Options for forwarding”The issue lists 1 to 3 as options. A is its recommendation with one change to the names, explained below. D, defer both, is this brief’s.
The clipboard
Section titled “The clipboard”| Sub-decision | Recommendation |
|---|---|
| Guest to host | Only through wb (a guest command that asks wb-guestd), each copy approved through a notification, never in the terminal (SEC14-no-fake-approvalsSEC14-no-fake-approvals: Approvals cannot be spoofed by the guestApproval prompts are never rendered in the agent's terminal stream.). The approval shows the text with newlines and control characters made visible. |
| OSC 52 | Never. The terminal filter of B37-terminal-boundaryB37-terminal-boundary: Should the host terminal be a trust boundary with its own filter?Yes, decided. drops it, so it can’t bypass the approval. |
| Host to guest | Off by default, opt-in per project, with an approval per paste. The approval warns that the text goes into the guest, where SEC04-no-guest-secretsSEC04-no-guest-secrets: No secrets in the guestThis includes the model credential. says no secret belongs. |
| Kinds | Plain text only, capped in size. No files, images, or rich text. |
Impact
Section titled “Impact”Evidence
Section titled “Evidence”- verified 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. says only that
wb-guestdreports listening TCP ports for forwarding to host loopback and “optionally” bridges text clipboard (“wb-guestd”). 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. lists clipboard and port-forwarding switches in the project settings (“Settings contents”). - verified “Cookies do not provide isolation by port” (RFC 6265, section 8.5).
- verified The Public Suffix List has no
localhostentry, and when no rule matches, the prevailing rule is*(list, format). - inferred So
<port>.<project>.localhostnames share one site per project, and<port>-<project>.localhostnames don’t. - verified macOS resolves
3000.proj.localhostto127.0.0.1and::1(dscacheutilandgetaddrinfoon macOS 27). - inferred The proxy in A routes by the
Hostheader of the browser’s request, which comes from the host, and passes the guest’s response bytes through. It doesn’t need to parse guest HTTP, though its framing of the stream over the host-guest socket still gets a fuzz target (S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq…). - assumed That Safari, Chrome and Firefox all keep cookies for
3000-myrepo.localhostapart fromlocalhost, and refuseDomain=localhost. A browser check of under an hour answers it, with no VM needed. - assumed That browsers let a page on one loopback name send requests to another loopback port (the loopback-calls row). Browser rules for private network access change often.
What this unblocks
Section titled “What this unblocks”- The spec pull request, with a forwarding and clipboard section in 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.,
wb forwardand the clipboard command in S05-cliS05-cli: Command Line InterfaceSpecify wb, the single user-facing command., the switches in 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., and both crossings in T00-indexT00-indexboundary 6 is the host terminal stream.. - A milestone for FR11-port-forwardFR11-port-forward: Port forwardingDev servers listening in the guest are reachable on host loopback. and FR12-clipboardFR12-clipboard: Opt-in clipboardText clipboard sharing is opt-in, per direction, with approval., which have none today.
- Relies on I37I37 (closed): S03-requirements, S05-cli: treat the host terminal stream as a boundarywb claude relays the guest's PTY output in raw mode to the user's terminal emulator (S05-cli). (B37-terminal-boundaryB37-terminal-boundary: Should the host terminal be a trust boundary with its own filter?Yes, decided.) for dropping OSC 52. Without that filter, the clipboard approval can be bypassed.
Details and glossary
Why plain TCP stays opt-in. Databases and language servers in the guest don’t speak HTTP, so the proxy can’t route them by name. Forwarding them to the same port on 127.0.0.1 keeps the issues of B, but only for a port the user named, and wb status lists it.
Port conflicts. The proxy uses one loopback port for every HTTP forward, so a guest port never collides with a host service. Plain TCP forwards fail with an explanation when the host port is taken (NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it.).
Paste-jacking. Text that looks like one command but holds a newline and a second command runs both when pasted into a shell. Showing newlines and control characters in the approval makes that visible. Many shells also turn on bracketed paste, which stops the newline from running the command.
Glossary
- Loopback,
localhost: the host’s own network address (127.0.0.1). Only programs on the host can reach it. - Site: what browsers use to keep cookies and storage apart: the part of a name one owner can register, such as
example.com. - Public Suffix List: the list browsers use to find that part (
co.ukis a suffix, soexample.co.ukis a site). - Cookie: data a browser stores per site and sends back with each request, often a login.
- OSC 52: the escape sequence that lets a program write the terminal’s clipboard (B37-terminal-boundaryB37-terminal-boundary: Should the host terminal be a trust boundary with its own filter?Yes, decided.).