Repository navigation
fix(control): let only a workspace's admins create its projects - #194
Merged
Merged
Conversation
Any member of a workspace could create a project in it, become its owner, point it at any repository the workspace's GitHub connections cover and start sessions that write there, whatever the base role and their project roles opened to them. Creating a project now takes being an admin of the workspace (fctl_domain::workspace::check_create_project, ADR 0035); a new project without a workspace named goes into the only one the caller administers. The app offers New project only where the person is an admin, and tells a member to ask one. Projects that exist keep their owners.
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.
Any member of a workspace could create a project in it and become its owner. A project uses the repositories of the workspace's GitHub accounts that its owners choose, and its sessions get tokens that write to them, so a member whose base role and project roles opened one project, or none, could reach every repository the workspace's connections cover. Creating a project now takes being one of the workspace's admins (ADR 0035).
POST /api/v1/projectsrefuses members (fctl_domain::workspace::check_create_project, with unit tests): "Only the workspace's admins create its projects. Ask one of them to create it and add you to it." Without a workspace named, a new project goes into the only one the caller administers; a member of workspaces they don't administer is told to ask an admin or create a workspace of their own.GET /api/v1/github/repos, which uses the same lookup, still answers every member.Projects that exist keep their owners. Choosing a project's repositories stays with its maintainers and owners, within the workspace's connections, as admins or the project's owners give those roles; the ADR says so, since a
maintainerbase role lets every member point their projects anywhere the connections cover.Screenshots
At 9a60638, as a member (not an admin) of the dev workspace, light theme, 1280 px wide; admins see what they saw before.
The new project page for a member in the dark theme:
Verified
In
cargo xtask dev: a member creating a project in the workspace got 403 with the messages above, with and without the workspace named, and the workspace's primary admin created one. The screenshots show the app as that member.cargo test -p fctl-domain, the web app's tests (a new one forcreatesProjects) andcargo xtask check --quickpass.Session: https://app.fctl.sh/s/ses_01M5GDXHNVFDS8T3PFQEAR42Q5