Stacked on the gateway PR. An SSH client can say which AI agent is driving it and on which model, so workspace presence can show the lab mark, the model, and whose behalf it acts on.
How a client says it #
Through SSH env requests, which OpenSSH sends only when the client asks:
Host ssh.nibling.dev
SendEnv AI_AGENT NIB_AGENT*
Claude Code's shells already carry AI_AGENT=claude-code_2-1-280_agent, which parses to name claude-code and version 2.1.280, so with that config line it labels itself with no further marking. NIB_AGENT overrides the name, NIB_AGENT_MODEL names the model in OpenRouter's vendor/model[:variant] form (anthropic/claude-fable-5-1), and NIB_AGENT_TASK is a short status. One-off form: ssh -o "SetEnv=NIB_AGENT=claude-code NIB_AGENT_MODEL=anthropic/claude-fable-5-1" you@ssh.nibling.dev slug. OpenSSH keeps only the first SetEnv option, so everything goes in one.
What the gateway does #
Accepts those four keys and rejects every other env request. Sanitizes at the boundary: name and version [a-z0-9._-] up to 64, model also allowing / and : up to 96, task printable up to 140. Puts the result on peer.agent in the channel open message, and logs the name. Nothing is forwarded into the tab's process.
Verified #
58 tests pass. pnpm smoke with the real OpenSSH client delivers { name: "claude-code", version: "2.1.280", model: "anthropic/claude-fable-5-1" } to the tab, and a session without env has no agent key.
Next #
The tab side (an onChannel option on attachSsh, a name and vendor registry with lab marks, and the presence chip) lands on top of this from the presence branch. The nib CLI should take --agent name and --model vendor/model and set these itself.