Skip to content

Linked computers: one click links two of your computers through a third - #4011

Merged
backnotprop merged 6 commits into
mainfrom
feat/link-computers-through-a-third
Nov 25, 2026
Merged

backnotprop merged 6 commits into
mainfrom
feat/link-computers-through-a-third

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

What a person sees

Studio is linked to Laptop and to Mini; Laptop and Mini are not linked to each other (made-up names).

  • Settings → Machines on Studio has one quiet row, "Laptop and Mini", "Linked here, not to each other", with Link.
  • Settings → Machines on Laptop has "Mini · through Studio", "Linked to Studio, not to this computer", with Link (and Mini shows "Laptop · through Studio").
  • One click on either Link: the row says "Linking…", then goes. Laptop and Mini now hold an ordinary direct link, both ways; each shows the other as a normal linked row. No dialog, no confirmation, no step on the other computers.
  • If a computer the link needs is away: "Waiting for Mini: this links when Mini is back." It links when Mini is back (Laptop's own click waits in its outbox while Studio is away).
  • A refusal: "Not linked: ", and Link is offered again. An older Plannotator on one of them: no row (and "Update Plannotator on Mini to link it this way." if a click reaches it).
  • After linking, Laptop can tag Mini's agents from the @ list, as with any link.

How it works

Mark link-through. A list read by a linked computer carries link_through (the computers it is linked to, and links it is brokering); its stream sends event: links when that changes. On the click, Studio asks Mini for a link code for Laptop (POST link-through-offer: a secret only, alive two minutes by Mini's clock, bound on Mini's door to Laptop and to Studio), and hands it to Laptop (POST link-through-introduce), which runs the same link as a pasted code: it redeems the code at Mini's door, checks Mini's health answers with Mini's id, and links back with a code of its own. A click on Laptop is POST link-through-ask to Studio, held in Laptop's outbox while Studio is away. No new cryptography: the tokens are minted by Laptop's and Mini's doors for each other, exactly as in a link by hand.

The trust chain

  1. A click in a window: the window route takes only this page's own request (isWindowRequest); an agent's bare call, the CLI or another site is refused.
  2. Each step is a door route only a linked computer's token reaches (a phone gets the unknown route); who sent it is the link its token belongs to, never a body field.
  3. Each step is refused without that computer's window mark (X-Plannotator-Window, believed from a machine's token only); the broker sends it only for a job a click made.
  4. An introduction is taken once per broker (kept in memory, a bounded number per broker). No clocks are compared: its freshness is the code's two minutes on Mini's clock.
  5. Mini makes a code, and Laptop takes one, only for a computer the broker's own list names as linked; never one already linked, itself, or the broker.
  6. Laptop takes only a code whose id is the named computer's, and the ordinary link checks the computer answering at that address has that id.
  7. The device Mini's door makes from that code is provisional: it reaches only health, link-back and unlink (else 403 introduction_pending); only a link-back from the computer it was made for completes it (else 403 introduction_mismatch, device revoked), whatever came before; it is revoked unless its link is saved within two minutes, at a restart, and when Studio is unlinked from Mini (Studio's unused codes there close too).
  8. Addresses are the tailnet's only (*.ts.net over https; loopback only in a test sandbox). An address or way back from the broker is taken only in a test sandbox.

The code lives in Studio's memory for one request; nothing of it is written on Studio, and the tokens never pass through it.

What is not covered

  • Not defended, as for every window-marked write today: a local program on Studio that imitates its window (or reads Studio's tokens) can link two of Studio's own links to each other.
  • Open: the identity the ordinary link checks is the id the answering computer's health gives; a link stores no key that binds it to the computer the broker linked to.
  • Only one hop: a computer reached through two links in a row is not offered.
  • The @ list still does not say why another computer's agents are missing before the link is made.

Tests

Unit: packages/server/inbox-link-through.test.ts (detection; both online from either side; one away then back; broker away for an ask; older computer; refusal then Link again; refused from a non-linked sender, without the mark, for a computer the broker does not list; a replay; clocks that disagree; the introductions seen bounded and never written; no address from the broker outside a test sandbox; a refused ask on its row; no code on the broker's disk), packages/server/inbox-link-through-pass.test.ts (the real door and coordinator: the provisional device's routes and settling, its binding after a failed link-back and after newer offers, its time, a restart, the broker unlinked; a refused ask in the window's frame), inbox-door-version.test.ts, inbox-peer-link.test.ts. DOM: packages/inbox/linkThroughRows.test.tsx. E2E (CI only): tests/e2e/inbox-link-through.spec.ts, three compiled Inboxes; proof screenshots under .local/proof/link-through/.

A computer linked to two others that are not linked to each other offers to
link them (Settings -> Machines: "Laptop and Mini"), and each of the two offers
the computer it reaches through it ("Mini · through Studio"). One click and the
broker asks one for an ordinary link code and hands it to the other, which runs
the ordinary link with it: the two hold a direct link exactly as a link by hand
makes it. The code lives in the broker's memory for one request; the tokens never
pass through it.

Mark link-through: a list read by a linked computer names its links
(link_through) and its stream says when they move (event: links). Three door
routes only a linked computer's token reaches (link-through-ask, -offer,
-introduce), each refused without the window's mark, an introduction taken once
and only while fresh, a code made and taken only for a computer the broker lists,
and completed only by the computer it was made for. An away computer's link waits
and completes when it is back.
@backnotprop backnotprop added the ci:e2e Run the full browser suite (Inbox window e2e) on this PR label Nov 24, 2026
- An introduction's link code is a secret only (no six digits), lives two
  minutes by its maker's clock, and is bound on the door's own offer record
  to the computer it is for and the computer that introduced it.
- The device such a code makes is provisional: it reaches only health,
  link-back and unlink; only a link-back from the computer it was made for
  completes it, however many link-backs failed before or newer offers came;
  it is revoked unless its link is saved within two minutes, at a restart,
  and when the introducing computer is unlinked (its unused codes close too).
- An address or a way back from the broker is taken only inside a test
  sandbox, as loopback is; the broker sends none outside one.
- An introduction is taken once per broker without comparing clocks, so two
  computers whose clocks disagree still link; the introductions seen are kept
  in memory, a bounded number per broker, and never written to disk.
- When the broker refuses an ask, the asking computer's row says
  "Not linked: <its words>" and offers Link again.
- Introductions' link codes get their own list on the door, at most two
  open per computer introducing them, so they never take the slots of the
  person's own link codes or an ordinary link's way back.
- An ordinary link never saves a link without the device its way back
  made: it tells the other machine to unlink and fails instead.
- An ask the outbox gave up on, or whose link went, says so on its row
  with the outbox's own words, like a refused one.
- Linking through an introduction checks, with this computer's own
  Tailscale status, that the other computer is a node owned by the same
  user; when the status cannot be read nothing is refused. Links made by
  hand are not checked. Skipped in the test sandbox.
Its link-back answered 201 without redeeming the way back it was handed,
so the link had no device and is now refused (404 machine_not_linked).
It now pairs at the Inbox's door first, as every Inbox's link-back does,
and the test checks the saved link carries that device.

A new unit test: an ordinary link is saved with its device whatever
Tailscale says of the other computer, or when it cannot be read.
…hrough-a-third

# Conflicts:
#	apps/mobile/contract/parity/ledger.json
#	docs/agent-guides/inbox-machines.md
#	packages/core/inbox-types.ts
#	packages/server/inbox-peer-link.ts
#	packages/server/inbox.ts
@backnotprop
backnotprop marked this pull request as ready for review November 25, 2026 03:11
@backnotprop
backnotprop merged commit 5f5feb1 into main Nov 25, 2026
95 of 97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:e2e Run the full browser suite (Inbox window e2e) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant