Skip to content

fix(control): answer workspace invitations the same for every address - #193

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/121-invitations-reveal-nothing
Oct 22, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/121-invitations-reveal-nothing

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Inviting an address to a workspace told whether it can sign in to the instance: a workspace admin got an error for an address the instance doesn't admit, and an invitation otherwise. Anyone on the instance can create a workspace and so learn who uses it, which early access, sign-up and password resets are built not to reveal. Refusing "another address of a member" said too that the address belongs to a member's account.

Now a workspace's admins get an invitation for any address, with the same answer whatever the address is:

  • The invitation is emailed after the answer, so that how long the answer takes says nothing, and only when the address can sign in and isn't a member's, so that the instance emails nobody it doesn't admit. The answer doesn't say whether it was emailed (emailed is left out).
  • An address the instance doesn't admit yet keeps its invitation, unemailed, until an instance admin invites it; it then joins with the account it makes, as invitations of addresses without accounts did.
  • Only the address a member joined as, which admins see in the list, is refused as a member's. Another address of a member gets an invitation that its member never sees, being in already.
  • Instance admins, who see who can sign in anyway, are still told, and offered to invite the address to the instance too (now also with fctl admin invite <email> -w <workspace> in the message).

The form's hint now says that people join once the instance lets the address in, and the CLI says the same after fctl workspaces invite. docs/architecture.md and docs/security.md describe it.

Screenshots

At f7467a9: a workspace admin who isn't an instance admin invites an address the instance doesn't admit, 1280 px wide. Before, the banner says the address can't sign in; after, the invitation waits in the list like any other.

Before After
Before, light: a banner says newcomer@nowhere.test can't sign in to this instance yet After, light: newcomer@nowhere.test is invited, waiting in the list
Before, dark After, dark

Verified

In cargo xtask dev, as a workspace admin who isn't an instance admin: inviting an address that can't sign in, one the allowlist admits without an account, and one with an account answered 201 with the same body (apart from ids and times); the address a member joined as answered 409. The account saw its invitation on its home page, and the address that couldn't sign in joined the workspace once an instance admin invited it to the instance and it signed up. As the instance owner, inviting an address that can't sign in still showed the banner with "Invite them to the instance and Development". cargo xtask check --quick passes.

Session: https://app.fctl.sh/s/ses_01M5GDXHNVFDS8T3PFQEAR42Q5

Inviting an address to a workspace said whether it could sign in to the
instance (an error, or an invitation), and refusing another address of a
member said that address was theirs, so anyone could create a workspace
and test who uses the instance. A workspace's admins now get an invitation
for any address; it is emailed, after the answer, only when the address
can sign in and isn't a member's, and the answer doesn't say whether it
was. One the instance doesn't admit yet waits until an instance admin
invites it, as invitations of addresses without accounts did. Instance
admins, who see who can sign in anyway, are still told, and offered to
invite the address to the instance too.
@fctl-sh
fctl-sh Bot requested a review from kalaspuff as a code owner October 22, 2026 01:33
@kalaspuff
kalaspuff merged commit b8c4169 into main Oct 22, 2026
9 checks passed
@kalaspuff
kalaspuff deleted the fctl/121-invitations-reveal-nothing branch October 22, 2026 01:38
kalaspuff pushed a commit that referenced this pull request Oct 22, 2026
A session's sandbox holds the Claude token of the person it runs as: an
access token that lasts hours, or a `claude setup-token` token that
lasts a year. Every runner of a workspace ran everyone's sessions there,
so each member's token reached every machine the workspace's admins
added. A full Claude sign-in, which passes a long-lived refresh token
through a host, could run on any of those runners too. Members had no
way out: only admins add runners.

Now each member can keep their sessions on machines they control, per
workspace ([ADR
0036](docs/adr/0036-members-run-their-sessions-on-their-own-runners.md)):

- **Only on my runners.** A member's setting in each workspace
(`workspace_members.own_runners`): in the workspace's **Settings →
You**, `fctl workspaces own-runners on|off -w acme`, `PATCH
/api/v1/workspaces/{id}/membership` with `own_runners`. While it's on,
their sessions there run only on runners they registered. Turning it on
stops their sessions running on others' runners, and they resume on
theirs.
- **Members add runners for their own sessions.** A runner added to a
workspace runs everyone's sessions there, or only its owner's
(`runner_workspaces.personal`). Members can now register a machine for a
workspace (`fctl host install --workspace acme`, or the Runners tab), or
add one of theirs. Such a runner runs only their own sessions, which
show the machine nothing they can't already read in the session. Runners
for everyone's sessions still take an admin, and admins can choose
`--personal` too. Adding a runner again changes whose sessions it runs.
Demoting an admin now turns their runners into ones for their own
sessions; before, it took them out of the workspace.
- **One rule.** A session runs as the owner of its Claude connection.
`fctl_domain::schedule::runs_for` decides whether a runner runs a
session (unit tests). FleetDO's scheduling, `spec::runner_serves`
(credentials, uplinks, files, screenshots) and Claude sign-ins all use
it, so a runner that stops running a session gets nothing more for it.
- **Claude sign-ins** run on one of the person's own runners when one is
online. Otherwise they run on a runner that runs their sessions; with
the setting on everywhere, only on their own.
- **Waiting says why.** A queued session that no runner takes says whose
runner it waits for: "Waiting for one of Grace Hopper's runners: their
sessions in this workspace run only on their own, and none of those is
online". It also says when the only runners online run only their
owners' sessions. The note under the task box counts only the runners
that run your sessions.
- **Wire changes are additive.** `Workspace.own_runners`,
`Runner.personal` (the workspaces where it runs only its owner's
sessions), `UpdateMembershipRequest.own_runners`,
`CreateRunnerRequest.personal`, and a new optional body for `PUT
/workspaces/{id}/runners/{runner}` (`AddRunnerRequest`). Hosts and
agents don't change. An older CLI that registers or adds a member's
runner gets one for their own sessions.
- **Migration 0023** adds the two columns. It is numbered after #195's
0022, and the ADR after #194's 0035.

It also corrects copy that said sessions on a runner taken out of a
workspace carry on: they stop and resume elsewhere, and have done so
since #171. The architecture, security, CLI and getting-started docs
describe all of this.

## Screenshots

At 3765a8b, in `cargo xtask dev` as Grace Hopper, a member of the
Development workspace. Dev Owner's `dev-host` runs everyone's sessions;
Grace's `grace-mini` and Ken Thompson's `ken-box` run only their own.
1280 px wide unless noted.

The workspace's Runners tab, light. Before: members could only ask an
admin. After: they register a machine for their own sessions, and the
list marks the runners that run only their owner's sessions.

| Before | After |
|---|---|
| ![Before: the Runners tab for a member, who can only ask an
admin](https://app.fctl.sh/api/v1/published/nrH29cRZ90kfwMT4BGvdeWsXytJaq5SUfbGDWkGzx97/own-before-runners.png)
| ![After: the Runners tab for a member, with a form to register a
machine for their sessions and marked personal
runners](https://app.fctl.sh/api/v1/published/g3cAk9b6qnpEg3YUWCE2yzhLLf0q4kMx24f3bdsZZJ4/own-after-runners.png)
|

The workspace's Settings → You, light, with the new switch off:

| Before | After |
|---|---|
| ![Before: Settings → You without the
switch](https://app.fctl.sh/api/v1/published/7N5S847hyFaD0TKEVEXvBck3MYXgHhJ9AUNxZx5cPzb/own-before-settings.png)
| ![After: Settings → You with the Only on my runners
switch](https://app.fctl.sh/api/v1/published/M2owdgz5HujRWHiiLicwIrrT2wMbW2rmttX6kpO7I49/own-after-settings.png)
|

The switch on, dark:

![After: the Only on my runners switch on, dark
theme](https://app.fctl.sh/api/v1/published/B3A8gLroNMwuPrjyvVKh5F4IbecoAf13e847C6vueTi/own-after-settings-on-dark.png)

With it on and `grace-mini` offline, a new session waits for one of
Grace's runners, though `dev-host` is online:

![After: a queued session waiting for one of Grace Hopper's
runners](https://app.fctl.sh/api/v1/published/AHFay0dCwWsLwrsTgSzKZJs96NMsatLZSk52A5DntHu/own-after-waiting.png)

The note under the home page's task box says the same before she starts
one:

![After: the note under the task box says none of her runners is
online](https://app.fctl.sh/api/v1/published/SFJwaMtizj7TSfylEPrPefuV5JdrJB8bjz80VlZZXMO/own-after-home-note.png)

The Runners tab as the primary admin, who sees whose each runner is and
can take any out:

![After: the Runners tab as an
admin](https://app.fctl.sh/api/v1/published/wv7tw8Ztu7Skf3QfAfRSh1n7inAdKq3J6EVVh0LPn7o/own-after-runners-admin.png)

The Runners tab at 390 px, dark, where the marks wrap whole:

![After: the Runners tab at phone width,
dark](https://app.fctl.sh/api/v1/published/G4PAZ6XSXEjre1lqoDblO8LPQTfyOBk4Kyim6rcGf0h/own-after-runners-390-dark.png)

The app's Settings → Workspaces says which workspaces keep your sessions
on your runners:

![After: Settings → Workspaces marks the
workspace](https://app.fctl.sh/api/v1/published/45nZBxSnnxrejGbNexMQV6ATS5Ce0P8FbqlHjU0aAEz/own-after-app-settings.png)

## Verified

In `cargo xtask dev`, with a second host running as Grace's
`grace-mini`, and Ken as another member:

- **Grace's personal runner took nobody else's sessions.** Ken's
sessions all went to `dev-host` while `grace-mini` sat idle. With
`dev-host` full, his next one waited instead of using hers.
- **Turning the setting on and off.** With it off, Grace's sessions ran
on either runner. Turning it on stopped her session on `dev-host`, and a
message resumed it on `grace-mini`. With `grace-mini` offline, a new
session waited with the reason above; turning the setting off started it
on `dev-host`.
- **Ken's waiting reasons.** With `dev-host` disabled, his session said
the runners online run only their owners' sessions. With `dev-host` out
of the workspace, it said the workspace's runners run only their
owners'. Adding `dev-host` back started it.
- **Demotion.** Grace, made an admin, shared `grace-mini`, and a Ken
session ran there. Demoting her made it hers alone, stopped his session,
and a message resumed it on `dev-host`.
- **Claude sign-ins.** Grace's ran on `grace-mini` though `dev-host` was
online; Ken's on `dev-host`. With Ken's setting on and no runner of his,
his sign-in is refused (503).
- **API rules.** A member registering or adding a runner for everyone's
sessions gets 403, and an admin adding a member's runner gets 403.
Without a body, `PUT …/runners/{runner}` adds a member's runner for
their own sessions.
- **CLI.** `fctl workspaces own-runners`, `add-runner --personal` (and
again without it), `runners`, `show`, and `fctl host install
--workspace` as a member ("Registered runner ken-box … for your sessions
in Development").

`cargo test -p fctl-domain` (new tests for `runs_for`,
`check_add_runner` and the waiting reasons), the web app's tests
(`runnersOf`, the note, the Runners tab), `cargo xtask check` and a
session through `cargo xtask serve` (`cargo xtask dev --smoke --server
http://localhost:8787`) pass.

One of four pull requests on the issues the security review (#189) left
open, with #193, #194 and #195.

Session: https://app.fctl.sh/s/ses_01M5GDXHNVFDS8T3PFQEAR42Q5

---------

Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant