Tailscale: how it works
Tailscale is a mesh VPN whose Funnel feature publishes one port of a device in your tailnet to the whole internet. Taji uses it for Remote Control: your phone opens https://taji.<tailnet>.ts.net, the request crosses Tailscale's Funnel relays still encrypted, and TLS ends on your computer, inside Taji. The plugin has two halves. taji-tailscale the crate (plugins/tailscale/src/lib.rs) implements taji_plugin::remote::Remote. taji-tailscale the binary is a Go program (plugins/tailscale/sidecar/main.go) that embeds Tailscale through tsnet and is the only process the internet talks to. It serves no market data, places no orders and feeds no hub product. What a paired phone may do once it is in, pairing, passkeys and device tokens, is the kernel's own (engine/crates/taji/src/wire/remote.rs), and this page covers it because the plugin is that code's only door.
The vendor
The facts below come from Tailscale's docs, Tailscale's Go package docs and Cloudflare's docs, all fetched 2026-12-02.
Tailnets and machines. A tailnet is one account's private network. Each device in it is a machine with a name, a WireGuard node key and, once HTTPS is on, a public DNS name <machine>.<tailnet>.ts.net. A personal tailnet is free: the Personal plan is "$0", "Free forever", "Up to 6 users" and "Unlimited user devices" (Pricing). The pricing page's comparison table ticks Funnel for every plan, Personal included.
tsnet. "tsnet is a library that lets you embed Tailscale inside a Go program", on "a userspace TCP/IP networking stack" (tsnet). A tsnet.Server joins the tailnet as its own machine, with no Tailscale app installed. The fields and methods Taji uses, per the package docs (pkg.go.dev tsnet):
Dir: "the name of the directory to use for state", which holds the node key;Hostname: "the hostname to present to the control server";AuthKey: an auth key that "will be preferred over the TS_AUTHKEY environment variable". Taji sets neither, so tsnet produces "a Tailscale authentication URL" (tsnet);ListenFunnel: "announces on the public internet using Tailscale Funnel", and "by default listens on your local tailnet" too;LocalClient: the LocalAPI client for this node;- log upload: tsnet's logs "will automatically be uploaded to log.tailscale.com" unless the program disables it.
Taji pins tailscale.com v1.104.7 with Go 1.27.4 (plugins/tailscale/sidecar/go.mod): the newest release Tailscale's changelog and stable packages publish (2026-12-02). v1.106.3 is tagged but not yet published.
LocalAPI calls (pkg.go.dev client/local):
| Call | What Tailscale says it does | What Taji reads from it |
|---|---|---|
StatusWithoutPeers | "returns the Tailscale daemon's status, without the peer info" | BackendState, AuthURL, Self.Expired, CertDomains, Self.KeyExpiry, the owner's LoginName |
QueryFeature("funnel") | "a request for instructions on how to enable a feature, such as Funnel", including "a control server URL the user can visit to enable the feature" | URL (a page with one press), else Text (why you cannot) |
Logout | "logs out the current node" | nothing; it runs at unlink |
Funnel (Funnel):
- It routes "traffic from the broader internet to a local service running on a device in your Tailscale network".
- "Funnel relay servers do not decrypt the traffic between public devices and your device". The node "terminates the TLS connection".
- "Funnel can only listen on ports
443,8443, and10000", over TLS alone. - It needs MagicDNS, HTTPS certificates and "a funnel node attribute in your tailnet policy file". A new tailnet has neither HTTPS nor the attribute; one
QueryFeaturepage turns both on. - "Tailscale Funnel is currently in beta", and its traffic "is subject to non-configurable bandwidth limits".
- "Public DNS records can take up to 10 minutes to show up for your tailnet domain."
HTTPS certificates (HTTPS) come from Let's Encrypt, "have a 90 day expiry", and are issued under the tailnet's name. Every certificate is recorded in the public Certificate Transparency log, which "includes the fully qualified domain name of your devices". Requesting certificates too often can exceed Let's Encrypt's rate limits. The sidecar requests no certificate itself: tsnet's Funnel listener obtains it, and retries a first ACME order that comes back invalid (main.go's header).
Key expiry (Key expiry): "By default, new domains are set with an expiry period of 180 days". An expired key means "connections to/from the given endpoint will stop working". You turn expiry off per machine from the admin console's Machines page, "Disable Key Expiry".
Device approval. If the tailnet has device approval on, "a tailnet admin must approve the device before it joins" (tsnet). tsnet reports this as the NeedsMachineAuth backend state.
Cloudflare DNS over HTTPS. The sidecar checks that the public name answers through Cloudflare's JSON API: a GET with accept: application/dns-json and name and type parameters, answering Status and Answer[] of {type, data} (DNS over HTTPS JSON). Cloudflare documents the hosts cloudflare-dns.com and one.one.one.one (Make API requests), and its JSON examples call https://cloudflare-dns.com/dns-query, the URL the sidecar calls.
What Taji does not use:
- Tailscale Serve. Serve reaches the tailnet alone and adds identity headers such as
Tailscale-User-Login. "Funnel traffic, which is publicly available, does not include identity headers" (Serve). Serve would need Tailscale installed on the phone, which the user ruled out on 2026-11-21. With Funnel, the phone's identity is its passkey. - The Tailscale app or CLI on your computer (
tailscale serve,tailscale funnel). Taji embeds its own node, so nothing needs installing. - Auth keys and
TS_AUTHKEY. You sign in by browser. The sidecar's environment is stripped of everyTS_*andTAILSCALE_*variable, so a key in your shell never signstajiinto a tailnet you did not choose. - Ports 8443 and 10000. Only 443 is served: a host typed with no scheme reaches
https:on 443. FunnelOnly. The listener also answers your tailnet, and the kernel records which way each request came (x-taji-via).- Ephemeral nodes. Not yet built. A passkey is bound to the machine's name, so the node has to keep it.
- Tailscale's log upload. The sidecar calls
logtail.Disable(); the log stays on disk. - The
TextthatQueryFeaturereturns when you are not the tailnet's admin. The manifest's own sentence says to ask your admin, and a tailnet you join as a member is not the one Remote Control serves; the user ruled it out on 2026-11-23.
Code map
plugins/tailscale/taji-plugin.toml: the plugin's identity, its one[[link]]formtailscale(stepsaccount,public,address;pairs = true), the refusal sentences and the docsources.plugins/tailscale/src/lib.rs: the arm. Readimpl Remote for Tailscalefirst.Tailscale::default: finds the sidecar (TAJI_TAILSCALE_SIDECAR, elsetaji-tailscalebeside the kernel) and its state dir,<state dir>/tailscale/.spawn_in: writesoffline.html, rotatessidecar.logtosidecar.log.1, opens the new log owner-only (0600), strips the environment, and spawns the sidecar with--dir,--toand--offline,kill_on_drop.close: ends the sidecar inlive: drops its stdin, whose EOF runsts.Close(), waits up toGRACE(10 s) for it to exit, then kills it.spawncloses the last sidecar before it spawns the next, underlive's lock, so two never share the state dir.link: spawns a sidecar and turns its events intoReportcalls untilupor a failure; onupit keeps the events inheldforrun, on a failure it closes the sidecar.run: serves until the sidecar signs out or a refusal ends it, then closes it; on any other exit it closes the sidecar and respawns, the wait doubling from 1 s toRESPAWN_CAP(60 s), reset once a sidecar has livedRESPAWN_RESET(600 s).stop:close, whichControl::haltawaits.unlink: writeslogoutto the sidecar's stdin, waits for it to exit 0, and deletes the state dir.next,hear,Event: the JSON-line protocol.
plugins/tailscale/sidecar/main.go: the sidecar. Its header comment is the protocol and the served-path list; read it first.main,commands: start tsnet, poll once a second, read stdin.arm.step,signIn,consent,up,arm.bound: status to event.reach,resolveDoH,arm.watch,arm.due: the public-name probe.handler,server,peer,key,limiter,gauge,deadlines: the internet-facing HTTP server and reverse proxy.
plugins/tailscale/sidecar/main_test.go: the sidecar's tests, over a stand-in kernel.plugins/tailscale/ui/mark.svg: the mark.
Kernel code this plugin depends on:
engine/crates/taji-plugin/src/remote.rs: theRemotetrait andReached.engine/crates/taji-plugin/src/report.rs:Report,SaidandFailed, shared with channels.engine/crates/taji/src/wire/remote.rs:Control(the link, the row, the respawned door),Remote(WebAuthn, codes, device tokens, sessions) androute(the door's tokenless posts).engine/crates/taji/src/wire/mod.rs:Wire::start_remote,Door,read_requestandtokenless, the second listener.
How it plugs into Taji
The trait. Tailscale implements Plugin and registers itself with Build::remote (plugins/tailscale/src/lib.rs). engine/crates/taji-open/src/lib.rs adds it to the open build, and Registry::remote hands it to the wire, which wraps it in a Control (engine/crates/taji/src/wire/mod.rs). A build seats at most one remote arm. The Remote trait has four async calls; link and run are given to, the kernel's second loopback listener:
| Call | Contract (engine/crates/taji-plugin/src/remote.rs) | What Tailscale's arm does |
|---|---|---|
link(to, report) | join the network, serve to, return Reached {host, owner, expires_utc} once host answers from the internet | spawn the sidecar; auth reports step account and its URL, consent reports step public and its URL, resolving reports step address, and up returns |
run(to, report) | keep serving until it breaks; return why | keep link's sidecar, or spawn one at a relaunch; respawn on exit; report.reconnecting and report.serving around a respawn |
stop() | end what link or run left running, returning once it has; the kernel calls it once their futures are dropped | close the sidecar: stdin's EOF, up to 10 s, then a kill |
unlink() | sign the machine out and delete its state | logout, then remove <state dir>/tailscale/ |
No FACTS, VenueFacts or OFFER statics exist: the arm is neither a source nor a venue.
The link form. The manifest has one [[link]], form = "tailscale", kind = "start". Its steps, refusal sentences and the after-link "Turn off key expiry" page are the manifest's, taji-plugin.toml. The kernel adds the last step, pair, because pairs = true. You start it from Connections, taji-link remote, or an agent's ui_open (README).
Surfaces and the calls behind them. Each route's full contract is its row in the //! header of engine/crates/taji/src/wire/mod.rs.
| Taji surface | Vendor call behind it | Made in |
|---|---|---|
POST /verb/remote/link, step account | tsnet.Server.Start, then StatusWithoutPeers: NeedsLogin with an AuthURL | Control::link; Tailscale::link; arm.step, signIn |
step public | CertDomains empty or ipn.NodeCanFunnel failing, then QueryFeature("funnel") | arm.step, consent |
step address | ListenFunnel("tcp", ":443"), then a DoH lookup and an HTTPS GET of the host | arm.step, reach |
GET /read/remote host, owner, expires_utc | CertDomains[0], User[Self.UserID].LoginName, Self.KeyExpiry | up; Control::node |
GET /read/remote state: reconnecting | a probe missing 3 times a minute apart, or the sidecar exiting | arm.watch; Tailscale::run; Control::report |
refusals signed_out, unapproved, not_allowed, unanswered, stopped | NeedsLogin after running or Self.Expired; NeedsMachineAuth; QueryFeature's Text; no answer in 10 minutes; the sidecar exiting during a link | signIn, consent, arm.bound; hear, ended |
POST /verb/remote/unlink | Logout | commands; Tailscale::unlink; Control::unlink |
POST /verb/remote/stop | tsnet.Server.Close, run on the sidecar's stdin EOF | Control::halt; Tailscale::stop; commands |
| every phone request | Funnel, then TLS ended in tsnet | handler; Wire::start_remote |
POST /verb/remote/{forget,sign_out}, remote/pair/options, remote/pair, remote/challenge and POST /app/token call nothing of Tailscale's. They are the kernel's pairing and token routes, reachable from the phone only through this plugin.
The trust boundaries. The list of how the door holds is Behaviour and limits. What this plugin is responsible for:
- TLS ends in the sidecar. Funnel's relays carry ciphertext. Go's
net/httpis the parser the internet meets; the kernel hears only what the sidecar forwards, on a loopback port. - A second listener, not a header. The kernel binds a fresh
127.0.0.1:0port for each link (loopbackinengine/crates/taji/src/wire/remote.rs) and opens the phone's door on it. That door hears only the device tokens it minted. It refuseslocal,agent,pageandsheettokens 401token, and the loopback wire refuses device tokens (no_local_agent_or_sheet_token_is_heard_remotelyinengine/crates/taji/src/wire/tests.rs). - The Host must be the arm's host. Any other
Host, or none, is 421host(a_remote_request_carries_the_arms_host_alone). - Who the caller is. The sidecar deletes any
x-taji-sourceandx-taji-viathe client sent, then sets them from the connection: a Funnel connection's original address (ipn.FunnelConn.Src) andinternet, or the tailnet peer andtailnet(peerinmain.go). The kernel keeps them on the session for the phone list (Caller::heard). - What crosses without a token. The sidecar and the kernel each hold the same list, so neither alone decides:
GET /(a 302 to/app/, answered by the sidecar), the page's files,/app/frame/kit.css, a symbol's logo, a keyed plugin frame, a websocket upgrade on/ws/*(whose first message must carry a token within 5 s), andPOSTtoremote/challenge,remote/pair/options,remote/pairand/app/token. Anything else is an empty 404 (tokenlessinengine/crates/taji/src/wire/mod.rs;handlerinmain.go). A path that the kernel's router could read differently (..,//, an escaped/) is never tokenless. - A token is judged on the head. A request carrying
x-taji-tokenpasses the sidecar on any path, and the kernel refuses a wrong one 401 before reading its body. Two tokens are 400 at both ends, because Go reads the first and the kernel the last. - What a token is worth. A passkey assertion buys a device token that acts as the by-hand window for 300 s, then answers 401
passkeyto a by-hand act until Face ID again, and lapses after a day (BY_HAND_SECS,TOKEN_SECS). Minting a pairing code is by hand at the computer; the phone's door refusesremote/link403hand. - What the sidecar never gets. It holds no wire token, sees no vault and reads no key; its environment has every
TAJI_*,TS_*andTAILSCALE_*variable stripped (the_sidecars_env_holds_nothing_of_tajis_or_tailscales). - What stays on disk. The node key is in
<state dir>/tailscale/, outside the vault, because Remote Control resumes at a relaunch before you unlock.sidecar.logis0600because it holds the sign-in URL, which signstajiinto whoever opens it first. Passkeys are in<state dir>/remote.json(0600).
The trace: a phone's first request. You switched Remote Control on, the link reached up, and you scan the QR, which opens https://taji.<tailnet>.ts.net/app/#pair=<code>. The fragment never leaves the phone.
- The phone resolves the name in public DNS and connects to Tailscale's Funnel relay on 443. The relay forwards the TCP stream, still encrypted, to the node
taji, and the TLS handshake completes there (Funnel). - Inside the sidecar, tsnet's
ListenFunnellistener hands Go'shttp.Servera TLS connection wrapping anipn.FunnelConn.ConnContextrecords the source as the original client address, keyed by IPv4 address or IPv6 /48 for the caps, andviaasinternet. handlerreads the head, with at most 16 KiB of headers and 10 s to read them.GET /app/has no token and is on the tokenless list, soforwardchecks the 16-per-source and 256-in-all tokenless gauge, then hands it tohttputil.ReverseProxy. The proxy keeps the originalHost, setsx-taji-sourceandx-taji-via, and sends it tohttp://127.0.0.1:<port>, the kernel's second listener.- The kernel's
acceptloop forDoor::Remotereads the request with a 30 s read timeout.read_requestrejects aHostthat is not the arm's host (421), a proxy request (405) or a second token (400), records the caller, and finds/app/ontokenless. The kernel serves the page. - The page knows from
#pair=<code>to pair. It postsremote/pair/options {code, name}, which the sidecar counts against 30 tokenless POSTs a minute per source. The kernel'srouteanswers the WebAuthn creation options. The phone's authenticator makes a passkey behind Face ID, and the page postsremote/pair {code, id, credential}.Remote::pairchecks it withwebauthn-rs, saves the device toremote.json, and answers{token, rp_id, user_id, accepted, frames}. The kernel frameschanged remote, so the window's sheet tickspair. - Every request from then on carries
x-taji-token. The sidecar forwards it under the separate tokened gauge with a 1 MiB body cap. The kernel'sDoor::device_scopemaps it to the by-handpagescope, and the request runs as the window's would. - A reply goes back the same way. The sidecar allows 120 s to write it, counted from the start of the kernel's answer. If the kernel does not answer at all, the phone gets
offline.html, 503,no-store.
A later open, with no token in memory, is step 5's sign-in instead: POST /verb/remote/challenge {} answers discoverable request options with allowCredentials empty, so no credential id or count leaks, and POST /app/token {id, credential, app} returns the device token.
Why it is built this way
- Funnel, not ngrok or Cloudflare Tunnel. Those vendors end TLS and can read the traffic. Funnel's relays do not decrypt it, so nobody but you reads your positions or your vendors' data. Cloudflare's Quick Tunnel was also rejected because its name changes at each launch, and a passkey is bound to one name.
- Embedded tsnet, nothing on the phone. The user ruled on 2026-11-21 that the phone runs a browser alone and that the Mac needs no Tailscale app. tsnet is a Go library, hence a Go sidecar beside a Rust kernel, built by
make sidecarand staged beside the kernel byengine/crates/taji/scripts/stage.sh. - Go's
net/httpfaces the internet. A mature parser with header, body and time caps stands between the public address and the kernel, whose wire parser was written for loopback (main.go's header). - A second listener, not a header. "Remote" is which socket a request arrived on, so a forged header cannot make a local request remote or the reverse. A new port per link lets a stop close every old connection (user, 2026-11-23).
- The passkey is the device. WebAuthn through
webauthn-rs0.6.2 with user verification (engine/crates/taji/Cargo.toml). The relying-party id is the arm's host, so the phone holds no cookie or token at rest. The cost: renaming the machine or the tailnet orphans every passkey (README). - One consent page.
QueryFeature("funnel")'s URL turns on HTTPS and thefunnelattribute with one press, which keeps the guided flow at two steps you act on. - The public check. The sidecar resolves the name over Cloudflare's DoH, not the system resolver, whose MagicDNS would answer with the tailnet address and prove nothing about the internet (
answersinmain.go). A resolver that does not answer counts as no miss, so a network that blocks Cloudflare's DoH does not end a working door. - Ten minutes for the address. Tailscale states DNS can take up to 10 minutes, and the address step took from 6 s to over five minutes when measured on 2026-11-22 (README). Past that, something blocks it (
resolveFor). - Respawn on
lost. A node could lose its Funnel registration while its status stayed green, and only a restart brought it back (Tailscale issue 21114): after a brief control reconnect, "cleanup from the old connection was removing the node's Funnel registration that the new connection had just made". Tailscale fixed it on its coordination servers ("The fix is server-side, so there is nothing to install") and closed the issue on 2026-11-02. No client release carries the fix and a node still cannot see its own registration, so the probe and the respawn stay for a recurrence. After three misses a minute apart,runcloses the sidecar and starts another (lostAfter). - A clean close. Every sidecar ends by
tsnet.Server.Close("Close stops the server", packagetsnet), which shuts down the local backend and with it the control connection; its log flush and LocalAPI shutdown are bounded at 5 s (tsnet/tsnet.go:665at v1.104.7). Issue 21114 began with a control connection that ended uncleanly, there from a network blip: "the old connection can't be closed cleanly, the new one comes up immediately". Soremote/stopand the respawn close the sidecar through its stdin and wait for it to exit, killing it only after 10 s, and the kernel opens nothing new until then (user, 2026-12-02). A kernel that dies closes the pipe, and the sidecar closes the same way. - The backoff. The respawn wait doubles from 1 s to a minute and resets after ten minutes served, following Kubernetes' CrashLoopBackOff reset (
RESPAWN_RESET). - The environment strip follows Open Terminal's tunnel (
open_terminal/tunnel.py:191, cited inlib.rs). - The caps. Tokenless POSTs are capped per source with no total, because twenty sources could fill a total and lock your phones out. In-flight forwards are capped per source and in all, with tokened requests counted apart, so a tokenless flood cannot take an unlocked phone's acts. An IPv6 source is its /48, because a free tunnel broker hands one user a whole /48 (
limiter,gaugeandkeyinmain.go). - Awake while serving. A sleeping Mac's sidecar sleeps too, so the kernel runs
/usr/bin/caffeinate -s -w <pid>while serving (Control::open).
Constraints and limits
- Funnel's own. Beta, bandwidth limits that Tailscale does not publish, ports 443, 8443 and 10000 alone, and the public name in the Certificate Transparency log (Funnel, HTTPS). Anyone reading that log knows the address; scanners asked for
/.envand/.git/HEADwithin a second of it appearing, which is why every unlisted path is an empty 404. - Key expiry. The node signs out after 180 days unless you disable key expiry for
taji. The sidecar reportsSelf.KeyExpiryasexpires_utc, and the row warns from 14 days ahead (README). On expiry,runendssigned_outand you link again, keeping the phones on the same host. - Admin-controlled tailnets. Device approval gives
unapproved, and a policy that withholds Funnel givesnot_allowed. - The sidecar's caps (
main.go): headers 16 KiB plus Go's 4 KiB slack; tokenless body 64 KiB and tokened 1 MiB, else 413; 30 tokenless POSTs a minute per source, else 429; 16 forwards in flight per source and 256 in all, per pool, else 429; a body read within 30 s and an answer written within 120 s; no bound on waiting for the kernel, sincePOST /verb/channels/linkwaits for a scan. - The kernel's limits (
engine/crates/taji/src/wire/remote.rs): a pairing code lives 600 s; a ceremony 300 s and single use; at most 10,000 sign-in ceremonies outstanding, the oldest evicted, while the pairing and each device's step-up sit apart so a flood cannot evict them; device tokens are by hand for 300 s and live a day; the door sweeps revoked sockets each second. - The probe. Each second until the name first answers or
unansweredfires, then once a minute.unansweredcomes 10 minutes after the firstresolving, andlostafter 3 misses in a row. - No identity from Tailscale. Funnel carries none, so the kernel never trusts a Tailscale header; the passkey is the only identity.
- Availability under flood. 16 sources each holding 16 slow tokenless forwards fill the tokenless pool, refusing sign-ins and page loads. Only an edge could absorb that; a taji.is relay arm, a second provider of the
Remoteinterface, is the answer on record and is not yet built.
Examples
No capture yet: no test talks to Tailscale, and remote_walk.py <port> link against a live address would make one. The examples are test bodies at each side of the sidecar, their values made up, with each login masked as p1.
The sidecar's event lines, from TestEventLines in plugins/tailscale/sidecar/main_test.go. Each line is what one status poll emits, sent once per change:
{"auth":"https://login.tailscale.com/a/x"}
{"failed":{"word":"signed_out","say":"logged out"}}
{"failed":{"word":"signed_out","say":"the machine's key expired"}}
{"consent":"https://login.tailscale.com/f/funnel?node=x"}
{"failed":{"word":"not_allowed","say":"Ask your admin."}}
{"resolving":""}
{"resolving":"taji.example.ts.net"}
{"up":{"host":"taji.example.ts.net","login":"p1","expires_utc":1795000000}}
What the kernel's arm makes of them. In link_reports_each_step_and_url_then_reaches_and_keeps_serving (plugins/tailscale/src/lib.rs), a fake sidecar prints an auth, a non-event line, a consent, a resolving and an up. The arm spawns it with these arguments:
--dir <state dir>/tailscale --to 127.0.0.1:4321 --offline <state dir>/tailscale/offline.html
It reports At("account"), At("account"), Open(<auth url>), At("public"), Open(<consent url>) and At("address"), ignoring the non-event line, and returns Reached { host: "taji.tail-test.ts.net", owner: "p1", expires_utc: Some(1800000000) }.
The phone's first request at the sidecar. In TestTheRootRedirectsToUnlock (main_test.go), GET / is answered by the sidecar itself, and nothing reaches the kernel:
GET / HTTP/1.1
→ 302 Found
Location: /app/
In TestTheKernelHearsTheConnectionNotTheClientsHeaders, a client sends GET /app/pair with x-taji-source: 203.0.113.7, a second x-taji-source: 203.0.113.8 and X-Taji-Via: tailnet over a Funnel connection from [2001:db8:1:2::9]:5000. The kernel hears exactly one of each:
x-taji-source: 2001:db8:1:2::9
x-taji-via: internet
The phone's door at the kernel, from only_a_passkey_buys_a_token_remotely in engine/crates/taji/src/wire/tests.rs. Requests arrive as the sidecar forwards them, with Host: taji.tail-test.ts.net. The test's app answers every admitted request with its scope:
GET /read/desks (no token)
→ 404, empty body
POST /verb/remote/challenge {}
→ 200 {"id": "…", "publicKey": {…, "allowCredentials": [], …}}
POST /app/token {"id": "…", "credential": <assertion with a forged signature>}
→ 401 {"error": "passkey", "reason": "…"}
POST /app/token {"id": "…", "credential": <assertion>}
→ 200 {"token": "…", "rp_id": "taji.tail-test.ts.net", "user_id": "…", "accepted": […], "frames": "…"}
GET /read/desks x-taji-token: <that token>
→ 200 {"scope": "page", "hand": true}
From a_remote_request_carries_the_arms_host_alone, the same token with Host: localhost:
→ 421 {"error": "host", "reason": "the Host is not taji.tail-test.ts.net"}
Testing
Nothing here needs a key, and no default test reaches Tailscale.
cargo test -p taji-tailscale: the arm against a fake sidecar, ashscript that prints events and logs its arguments, environment and stdin (Unix only). It covers the link's steps and refusals, the environment strip, the log's0600mode and rotation, unlink'slogout, respawn and its backoff on paused time,reconnectingandserving,stopclosing the sidecar and killing one that outlives the grace, and a lost sidecar closing before the next spawns.(cd plugins/tailscale/sidecar && go test ./...): the sidecar's event lines, the ten-minute bound, the probe over a fake DoH resolver and HTTPS host, and the HTTP server over a stand-in kernel: every cap, deadline, path rule, header rewrite, websocket and the offline page. The Go toolchain is the onego.modnames.cargo test -p taji --lib -- remote: the kernel's door and pairing, withwebauthn-authenticator-rs'sSoftPasskeyas the phone.SoftPasskeysets neither backup flag, so a synced passkey's path is unmeasured until a real phone pairs.make test: the phone page's tests underui/src/remote/.engine/crates/taji/scripts/remote_walk.py <port> outside|link|pair|forget: the walk against a live address. It needs your Tailscale sign-in, Remote Control switched on in a fresh kernel (FRESH=1 make dev, withTAJI_STATE_DIRnaming its state dir) and, forpairandforget, a phone.outsidechecks what a stranger gets from the public address: no token, an empty 404; a junk token, 401; two tokens, 400. Its header lists every check. It has not yet run against a live address.- To run the kernel against a sidecar you built elsewhere, set
TAJI_TAILSCALE_SIDECAR(configuration).
References
All fetched 2026-12-02.