Skip to content

fix(control): confirm it's you before connecting a Claude subscription - #326

Merged
kalaspuff merged 5 commits into
mainfrom
fctl/460-confirm-claude-connections
Oct 29, 2026
Merged

kalaspuff merged 5 commits into
mainfrom
fctl/460-confirm-claude-connections

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Connecting a Claude token or a full Claude login makes it the person's default at once, and a full login's Claude account sees the sessions that run on it (Remote Control). With a stolen browser session or CLI token, someone could connect their own Claude login to the victim's account, with nothing to confirm and nothing said to the person, and from then on watch and message every session the victim started, whose agents hold the sessions' GitHub tokens and the projects' secrets, long after the stolen token was revoked.

Connecting a Claude subscription is now a sensitive action (Sensitive::ConnectClaude), whether with a token, a sign-in through a host, or the token kept on one's runners. The web app and the CLI already confirm such actions with a passkey or a code where the instance asks for it. A new connection also emails the person when email is set up, saying what was connected, as a best effort that never fails the connection. Verified in cargo xtask dev: with confirmation on and an authenticator app, an unconfirmed access token gets verification_required for a token, a sign-in and a runners token, and connects once it confirmed with a code.

The privacy policy lists the new email in:

The other fixes from the same security pass:

Worth confirming

  • Decision: like every sensitive action, this asks only where the primary instance owner turned on confirming it's you, which is off by default; elsewhere the email is what tells the person.
  • Decision: choosing the default connection, or a workspace's, stays unconfirmed: it only chooses among connections the person already has.

fctl session

…cription

Connecting a Claude token or a full Claude login makes it the person's
default at once, and a full login's Claude account sees the sessions that
run on it (Remote Control). A stolen browser session or CLI token could
connect the thief's own Claude login, with nothing to confirm and nothing
said to the person: from then on every session they started showed up in
the thief's claude.ai, with the session's GitHub tokens and the project's
secrets in reach of its agent, long after the stolen token was revoked.

Connecting a Claude subscription, with a token or a sign-in through a
host, is now a sensitive action (Sensitive::ConnectClaude), which the
browser and the CLI confirm as they do the others where the instance asks
for it, and it emails the person when email is set up.

Verified in cargo xtask dev: with confirmation on and an authenticator
app, an unconfirmed access token gets verification_required for both,
and connects once it confirmed with a code.
@fctl-sh

fctl-sh Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Partly addressed as of ab5ef67. Later commits fixed 3 of the 5 issues this review found.


fctl reviewed a18bd23 and found 5 issues.

The gate and the notice are in the right places. Three things to fix: the notice's lookups can fail a connection that is already stored, start_login charges the rate limit before the confirmation check, and three lists of sensitive actions weren't updated. add_on_runners (it also sets the default credential) is left ungated; the PR doesn't say that's on purpose.

On lines the diff doesn't show:

  • Lists of sensitive actions don't mention connecting Claude · Low severity · crates/fctl-proto/src/api.rs line 1328: The verify_sensitive_actions doc comment (and its copy in web/src/gen/InstanceSettings.ts, from cargo xtask gen), the admin switch's text at web/src/routes/admin.tsx:1989, and docs/agents.md:143 still list the old set. Admins turning the setting on aren't told connecting a Claude subscription now asks too, and agents aren't told fctl claude connect can return verification_required. docs/llms.txt is the same.
  • No test for the new action's message · Low severity · crates/fctl-domain/src/verify.rs line 303: the_message_says_what_and_with_what checks the message for several actions, but nothing covers ConnectClaude, whose wording is new.

Reviewed by fctl · Review agent settings

Comment thread crates/fctl-control/src/do_fleet.rs Resolved
Comment thread crates/fctl-control/src/api/claude.rs Resolved
Comment thread crates/fctl-control/src/api/claude.rs Resolved
The email about a new Claude connection is looked up after the
connection is stored and made the default, and a failed lookup failed
the request, or marked a sign-in through a host failed, so that the
person tried again and connected it twice. It is now best effort, and
skipped where the instance sends no email. A Claude sign-in also asks to
confirm it's you before it counts against the sign-in rate limit.

The other lists of sensitive actions, in the instance setting's
documentation, the admin page's switch, docs/agents.md and llms.txt, now
name connecting a Claude subscription too, and a test covers its
message.
@fctl-sh

fctl-sh Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

The two findings in the review's summary are fixed in ab5ef67:

  1. The verify_sensitive_actions documentation (and web/src/gen from cargo xtask gen), the admin page's switch, docs/agents.md and docs/llms.txt now name connecting a Claude subscription.
  2. the_message_says_what_and_with_what now covers ConnectClaude's message.

@fctl-sh

fctl-sh Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

fctl reviewed ab5ef67 and found 1 issue. The new commits fixed 3 issues an earlier review found.

The three earlier findings are fixed in ab5ef67. One leftover: the CLI help for the setting still lists the old actions.

On lines the diff doesn't show:

  • CLI help for the setting omits connecting a Claude subscription · Low severity · crates/fctl/src/cmd/admin.rs lines 208–210: The PR adds "connecting a Claude subscription" to this list in InstanceSettings, the generated web types, the admin page and the docs, but not to the --verify-sensitive-actions help. fctl admin set --help still lists the old actions.

Reviewed by fctl · Review agent settings

fctl admin set --help lists the sensitive actions that
--verify-sensitive-actions asks people to confirm; it now names
connecting a Claude subscription too, as the other lists do.
@fctl-sh

fctl-sh Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

The leftover from the review of ab5ef67 is fixed in c55d1c8: fctl admin set --help names connecting a Claude subscription among the actions --verify-sensitive-actions asks people to confirm.

@fctl-sh

fctl-sh Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Partly addressed as of f6f0673. Later commits fixed 2 of the 3 issues this review found.


fctl reviewed c55d1c8 and found 3 issues.

Only a help string changed since the last review (crates/fctl/src/cmd/admin.rs); it matches the other lists. All three earlier findings stay fixed.

Reviewed by fctl · Review agent settings

Comment thread crates/fctl-control/src/api/claude.rs Resolved
/// their account, with a token or a sign-in: the sessions they start run
/// on it from now on, and its Claude account sees them, so one they didn't
/// connect is someone else watching their sessions.
pub fn connected_notice(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Privacy policy in fctl-site doesn't list the new email

Medium severity. connected_notice adds an email app.fctl.sh didn't send before. legal/privacy.md in hyperstructure/fctl-site lists the emails it sends (two-factor, passkey, password changes, and so on) and calls Resend's mail 'notices about how you sign in'; neither covers a Claude connection. AGENTS.md asks for a matching change there when what is sent changes, and the pull request doesn't mention one.

Found by fctl review in c55d1c8.

@fctl-sh fctl-sh Bot Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it lists them. The privacy policy's list of notices now names the Claude connection email, and the Google codes one from #327, in hyperstructure/fctl-site#87, to merge together with these.

Comment thread crates/fctl-control/src/api/claude.rs Resolved
…nners

Connecting the token kept on one's runners makes it the default as a
token or a sign-in does, but took no confirming it's you and sent no
email. It now takes both, and the email says what was connected: a
token, which runs sessions on its subscription; a full login, whose
Claude account sees them in Claude's apps; or the token on their
runners.
@fctl-sh

This comment has been minimized.

Comment thread docs/architecture.md Resolved
kalaspuff pushed a commit to hyperstructure/fctl-site that referenced this pull request Oct 29, 2026
…es (#87)

## Summary

app.fctl.sh will email people when a Claude subscription is connected to
their account, and when their Google sign-ins stop asking for a code.
Both come from fixes in fctl's security pass. The privacy policy's list
of the notices app.fctl.sh sends now names both, and its date moves to
today. Merge it together with the two fctl pull requests that add those
emails, which reach app.fctl.sh with the next release:

- hyperstructure/fctl#326
- hyperstructure/fctl#327

[fctl session](https://app.fctl.sh/s/ses_01M62HVCXZDZV6GJJP8DDQGDFF)

Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
kalaspuff pushed a commit that referenced this pull request Oct 29, 2026
…#329)

## Summary

Hosts trust the control plane with what runs in sandboxes, but not with
the machine around them, as their update checks already show. A few
names it sends still reached the host's paths unchecked:

- Sandbox names came from the session's id, and a Claude sign-in's from
its job's, as the control plane sent them. The process driver keeps each
sandbox in a directory of that name and removes it afterwards, so an id
with slashes and dots named any directory on the machine. Names now keep
only letters, digits and dashes; real ids name the same sandboxes as
before.
- A project's Dockerfile and build directory, and the path of its dev
container configuration, which the paths that configuration names are
relative to, went to the build as they came: the control plane checks
them, but the host didn't, so a directory like `../..` would have built
from the host's own files, and a configuration path with `..` parts
named another repository's file in GitHub's API. The host now checks
every one of them as a path in the repository before anything reads it.

The standalone control plane also makes its state directory, which holds
D1 and every Durable Object's SQLite files, readable by its own user
alone, and says in its log when it can't, for a directory another user
owns. Verified with new unit tests for both names and build paths, the
host's tests and the standalone server's tests.

The other fixes from the same security pass:

- #325
- #326
- #327
- #328

[fctl session](https://app.fctl.sh/s/ses_01M62HVCXZDZV6GJJP8DDQGDFF)

---------

Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
kalaspuff pushed a commit that referenced this pull request Oct 29, 2026
…328)

## Summary

The Linear integration showed and let through more than people and
agents should reach:

- The workspace's Linear tab and a project's Tickets tab listed every
project that takes a Linear workspace's tickets, with its name and
address, to members who can't see those projects. They now list the ones
the person sees, within an access token's places.
- Any member could list a connected Linear workspace's teams, workflows
and open projects, at a cost of thousands of points against an API that
every fctl workspace connected to it shares. Now only the workspace's
admins and its projects' maintainers, who choose teams, can; the web app
asks only for them.
- A Linear team kept while the tracker was GitHub's, and never checked,
was taken unchecked when only the tracker turned to Linear
(`fctl_domain::tickets::linear_changed`).
- A ticket call that failed gave its place within its limit back, though
it had asked Linear or GitHub all the same, so a sandbox could loop
failing writes without end and use up a shared Linear API. Failed writes
now count against a limit of their own, 60 an hour, which every write
needs room in, and a call names at most 20 labels, since GitHub takes
each label removed in a request of its own.
- A comment's `reply_to` went to Linear unchecked; it now has to be one
of the ticket's own comments. A delivery for a Linear agent session also
moves on only a thread of its own Linear workspace.

Verified in `cargo xtask dev` with its Linear stand-in: a member without
a role in a project doesn't see it in the lists, and only admins and
maintainers list teams; turning only the tracker to Linear checks the
team; the 61st failing update in an hour is refused while reads go on; a
reply under another comment and a 25-label update are refused; and a
viewer's Tickets tab shows the saved team, and names the states as what
they are, without asking for the teams. New tests cover the tracker
check, the label limit and what a viewer sees. With `main` merged in,
the checks and limits hold for projects of several Linear teams (#331),
whose Tickets tab already lists the teams only for those who choose
them; the domain, CLI and web tests pass on the merge.

The other fixes from the same security pass:

- #325
- #326
- #327
- #329

## Worth confirming

- **Decision:** members who neither administer the workspace nor
maintain one of its projects can no longer list a connected Linear
workspace's teams; they see their projects' saved teams instead.
- **Decision:** a session's agent writes nothing more to its tracker
after 60 writes that failed in an hour, and a call names at most 20
labels.

[fctl session](https://app.fctl.sh/s/ses_01M62HVCXZDZV6GJJP8DDQGDFF)

---------

Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
@kalaspuff
kalaspuff merged commit a3e3408 into main Oct 29, 2026
10 checks passed
@kalaspuff
kalaspuff deleted the fctl/460-confirm-claude-connections branch October 29, 2026 16:41
kalaspuff pushed a commit that referenced this pull request Oct 29, 2026
…in (#325)

## Summary

A workspace admin could invite another address they hold, as an admin or
a member, and keep that invitation for its 30 days. Once the other
admins removed or demoted them, or their account was disabled, accepting
it, or signing up with that address, brought them back into the
workspace, or back as an admin: removing someone deleted only the
invitations addressed to them, and joining gave the invitation's role
whoever had sent it.

An invitation now counts only while whoever sent it is still an active
admin of the workspace (`workspaces::INVITER_STILL_ADMIN`). Joining
checks it, the lists invitees and admins see and the public invitation
preview leave the others out, and removing or demoting an admin deletes
the invitations they sent. The same check covers invitations sent before
this change. Verified in `cargo xtask dev` with three accounts: an
admin's invitation to another account stops working once they are
removed, demoted or disabled, and a current admin's invitation still
joins.

The other fixes from the same security pass:

- #326
- #327
- #328
- #329

## Worth confirming

- **Decision:** a demoted admin's member invitations go too, not only
their admin ones, since only admins invite; the remaining admins can
send them again.

[fctl session](https://app.fctl.sh/s/ses_01M62HVCXZDZV6GJJP8DDQGDFF)

Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
kalaspuff pushed a commit that referenced this pull request Oct 29, 2026
…ds (#327)

## Summary

A few ways in outlived what should have ended them, or got past a second
factor:

- An address's allowlist entry kept the admin role after its account
disconnected the address, while demoting or deleting the account only
touched the addresses it still had. An admin could disconnect the
address they were invited with and, once demoted or deleted, sign up
with it again through Google, which needs no invitation, as an admin.
Disconnecting an address now turns its admin entry into a member's.
- Signing up with an admin's invitation gave the admin role even when
the allowlist now admitted the address only as a member. The role is now
the lower of the two, and an admin's invitation makes an earlier
invitation's member entry for its address an admin's, which revoking it
takes back. An admin invitation's entry also used to stay an admin's
after the invitation ran out unused, so a Google sign-up still made an
admin; the hourly job now makes it a member's.
- A password reset link kept working for its hour after the address it
went to left the account. Disconnecting an address now uses up the
account's waiting links.
- A CLI sign-in the person had approved, but that no CLI had picked up
yet, still signed a CLI in after a password change or reset revoked
their tokens. Revoking someone's tokens now refuses those codes too.
- Outside a fresh sign-in, adding a passkey took the password, even on
an account with an authenticator app, and setting up a first app took
the password on an account whose passkeys are its second factor: a
stolen session with the password, as malware that steals browsers'
cookies and saved passwords has together, could add a way in past the
second factor. Both now take what a sign-in with the password takes: the
app's code where there is an app, a fresh sign-in where passkeys are the
second factor, and the setup form says so when it asks for that sign-in.
- Turning off your own "ask for a code on Google sign-in" took a session
alone. It is now the same sensitive action as the instance's setting,
and emails the person.
- A setup that lost a concurrent race no longer leaves an admin's
allowlist entry for its address.

Verified in `cargo xtask dev`: disconnecting an address with an admin
entry leaves a member's entry and uses up a reset link; an approved
device code polls as denied after a password change; an admin invitation
signs up an admin, and one whose address is now allowed as a member
signs up a member; an account with an authenticator app is asked for a
code, not its password, to add a passkey; and an unconfirmed token can't
turn off Google codes where confirming is on. Unit tests cover setting
up a first app.

The privacy policy lists the new Google codes email in:

- hyperstructure/fctl-site#87

The other fixes from the same security pass:

- #325
- #326
- #328
- #329

## Worth confirming

- **Decision:** disconnecting an address makes its admin entry a
member's rather than deleting it, so the address can still sign up as a
member, as demoting an admin already leaves it.
- **Decision:** disconnecting an address uses up all the account's
waiting reset links, since fctl doesn't record which address each one
went to.
- **Decision:** inviting an address as an admin while an entry an admin
added by hand allows it as a member is refused until that entry is
removed, rather than changing the hand-made entry.
- **Decision:** an admin's invitation that runs out unused leaves its
address allowed as a member, not an admin: whoever signs up with Google
afterwards is a member until promoted.
- **Decision:** adding a passkey on an account with an authenticator app
takes a code from the app instead of the password, outside a fresh
sign-in.

[fctl session](https://app.fctl.sh/s/ses_01M62HVCXZDZV6GJJP8DDQGDFF)

---------

Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
kalaspuff pushed a commit that referenced this pull request Oct 30, 2026
## Summary

What a linked Linear account delegates to fctl, or mentions fctl in,
starts sessions as its fctl person, on their Claude subscription, and
its replies reach their sessions' agents. With a stolen browser session
or token, someone could link their own Linear account to the victim's
fctl account, with nothing to confirm and nothing said to the person,
and go on starting the victim's sessions from Linear, reading what they
do there, long after the stolen token was revoked or the password
changed.

Linking a Linear account is now a sensitive action
(`Sensitive::LinkLinear`), as connecting a Claude subscription became in
#326: where the primary instance owner turned on confirming it's you, it
takes a passkey or a code. The app's "Link your Linear account" buttons
(Settings and a project's Tickets tab) confirm before they go on to
Linear; a link opened elsewhere (Linear's own button in an agent
session, `fctl account linear connect`) goes back to Settings with
"Linking a Linear account takes confirming it's you", where linking
again confirms first. A new link also emails the person when email is
set up, naming the Linear account and saying what it does.

Verified in `cargo xtask dev`: with confirming turned on and an
authenticator app on the account, an unconfirmed session's `GET
/api/v1/linear/link` goes back to `/settings?linear=confirm#linear`, and
after `POST /api/v1/auth/verify` it goes on to Linear's sign-in. The web
tests for the Tickets tab and the outcomes pass, and `cargo xtask check
--quick` passes. The email needs an instance with email, which the dev
stack isn't.

The privacy policy lists the new email since:

- hyperstructure/fctl-site#97

## Worth confirming

- **Decision:** like every sensitive action, this asks only where
confirming it's you is turned on, which is off by default; elsewhere the
email is what tells the person.
- **Decision:** a link from Linear's own button that needs confirming
lands on Settings rather than taking up the agent session that asked for
it; after linking from Settings, fctl still takes up the delegations
that waited for that Linear account.

## Stacked pull requests

The fixes before this one in this security pass are on main; the next
ones build on this one:

- #358
- #359
- #360

[fctl session](https://app.fctl.sh/s/ses_01M677K9YMM5WPZBTAR2KKXMSZ)

<!-- FCTL_REVIEW_SUMMARY -->
---

> [!NOTE]
> **Medium risk.** It adds a confirm-it's-you check to linking a Linear
account, which changes an authentication-adjacent flow for everyone who
links one; a mistake could block linking or let a stolen session link an
account.
>
> **What it does.** Linking a Linear account lets Linear delegations
start sessions as the person, so `GET /api/v1/linear/link` now requires
the same sensitive-action confirmation as connecting a Claude
subscription, where the instance asks for it. The web app confirms
before sending people there, and Linear's own button is redirected back
to Settings to confirm. A notice email is also sent when an account is
linked.
>
> **New outcome and email.** Linking now has a `confirm` outcome shown
in Settings and sends a best-effort email to the person;
docs/security.md and docs/architecture.md are updated.
>
> <sub>[fctl
review](https://app.fctl.sh/s/ses_01M67D37HF57SP912A3YYJK0WN)'s first
look at
[`393e78c`](393e78c)
· 10 files, +173 −11 · [Review agent
settings](https://app.fctl.sh/p/fctl?tab=reviews)</sub>

<!-- /FCTL_REVIEW_SUMMARY -->

---------

Co-authored-by: fctl-sh[bot] <343971779+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