Skip to content

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..

guest, untrusteddev serverlistens on port 3000wb-guestdreports ports, clipboardhost: trustedwb-hostd127.0.0.1:3000browsercookies for localhostother loopback serviceadmin UI on localhost:8080host cookies to the guestguest page calls it

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.

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.

wb-hostd serves each forwarded HTTP port at <port>-<project>.localhost on one loopback port, routed by the browser’s Host header. Plain TCP forwarding happens only for a port the user names (wb forward, or a project setting).

Forward only ports the user names, each to the same port on 127.0.0.1.

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.
RequirementA. Named proxyB. Named portsC. Every portD. Neither
SEC04-no-guest-secretsSEC04-no-guest-secrets: No secrets in the guestThis includes the model credential. no secrets in the guestown cookie jarlocalhost cookieslocalhost cookieskept
SEC03-no-host-execSEC03-no-host-exec: No host code execution via returned workNothing the agent produces executes on the host without an explicit user action; returned changes to files the host may later execute are flagged. nothing runs on the host without the userloopback callsloopback callsguest picks portskept
SEC14-no-fake-approvalsSEC14-no-fake-approvals: Approvals cannot be spoofed by the guestApproval prompts are never rendered in the agent's terminal stream. approvals never in the agent’s terminalnotificationas in Aas in Ano approvals
FR11-port-forwardFR11-port-forward: Port forwardingDev servers listening in the guest are reachable on host loopback. guest dev servers on host loopbackby nameper portautomaticnot in V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there.
FR12-clipboardFR12-clipboard: Opt-in clipboardText clipboard sharing is opt-in, per direction, with approval. opt-in, per direction, with approvalkeptas in Aas in Anot in V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there.
Spec workT00-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., 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.sameT00-indexT00-indexboundary 6 is the host terminal stream., 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.V1-initialV1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there.
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.uk is a suffix, so example.co.uk is 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.).