Repository navigation
fix(control): answer workspace invitations the same for every address - #193
Merged
Merged
Conversation
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.
kalaspuff
approved these changes
Oct 22, 2026
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 |
|---|---|
| 
| 
|
The workspace's Settings → You, light, with the new switch off:
| Before | After |
|---|---|
| 
| 
|
The switch on, dark:

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

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

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

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

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

## 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
emailedis left out).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.
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 --quickpasses.Session: https://app.fctl.sh/s/ses_01M5GDXHNVFDS8T3PFQEAR42Q5