Repository navigation
feat: keep Claude tokens on your own runners instead of in fctl - #244
Merged
kalaspuff merged 8 commits intoOct 23, 2026
Merged
Conversation
…plane, host) A Claude connection can now keep its token on its owner's runners instead of in the control plane. The control plane stores no secret for it, sends its sessions only to those of the owner's runners whose host says it keeps a token (hello and heartbeats carry when it was saved, never the token), and the host fills its own token into the spec and into fresh credentials. Hosts redact Claude tokens from what agents send to the control plane.
fctl host claude set-token keeps a token from claude setup-token on the runner (asked for with the input hidden, or read from stdin), status says whether it keeps one and whether fctl knows, and remove-token removes it. fctl claude connect --on-runners connects it, and fctl claude status and fctl workspaces claude say which runners keep it.
Settings → Claude gains a guided setup for keeping the token on your runners: claude setup-token, fctl host claude set-token, your runners as they report whether they keep it, then connecting it. The connection shows which runners keep the token. The note under the task box, the workspace's Runners tab and its Only on my runners setting take it into account. fake-claude gains printenv, to see the host redact the token.
… them ADR 0049, the architecture, security, getting started, CLI and development docs describe Claude tokens kept on runners. fctl host status and doctor say whether the host keeps one, and doctor flags a token file others can read; fctl host install points at fctl host claude set-token. /auth/me marks the connection sessions run on when none is chosen: the newest working one, as the control plane picks it.
…s whole When your sessions in a workspace run on the Claude token you keep on your runners, its Runners tab adds a step to adding a runner: keeping the token on it. Commands and paths in the setup's sentences stay on one line, and the setup says the runner keeps the token out of what sessions send.
This comment has been minimized.
This comment has been minimized.
Claude streams what it writes in deltas that split text anywhere, so a token an agent repeated came in pieces that each passed the host's check and reached viewers live. The host now holds back, for each content block, the end of the streamed text that could start a token: a token that comes whole is redacted, and text that turns out to be something else goes out at once, or before the block ends. fake-claude's printenv says the token back in five-character pieces, so cargo xtask dev shows it. The docs, the app and the CLI say only what holds: you never give the token to fctl, hosts never send it, and they take it out of what sessions send wherever it appears whole. An agent made to pass it on in another form still can.
main took ADR 0049 (#243), so this branch's ADR is 0050 now.
kalaspuff
approved these changes
Oct 23, 2026
kalaspuff
deleted the
fctl/206-for-security-minded-people-that-wants-to
branch
October 23, 2026 22:20
kalaspuff
pushed a commit
to hyperstructure/fctl-site
that referenced
this pull request
Oct 23, 2026
hyperstructure/fctl#244 lets people keep their Claude token on their own runners instead of connecting it to app.fctl.sh: `claude setup-token`, then `fctl host claude set-token` on each runner, then **Keep the token on your runners** in Settings → Claude. That changes what app.fctl.sh stores, so the privacy policy says so: - **Your Claude connection**: for a connection kept on your hosts, you don't give app.fctl.sh the token. It keeps only that the connection is kept that way, and the plan usage that sessions report. - **Hosts**: app.fctl.sh also keeps whether a host keeps your Claude token and since when, never the token. - **Security**: your hosts never send app.fctl.sh a Claude token you keep on them, only whether they keep one. They also remove Claude tokens from what your sessions send wherever a token appears as it is. An agent can still be made to pass one on in another form, as it can anything it reads, and the policy says so rather than promising more. `updated` in the front matter is already today's date. Merge it together with hyperstructure/fctl#244, or right after that deploys. Session: https://app.fctl.sh/s/ses_01M5N9BPAN1C2920A8R2PMC9GW --------- 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.
People who want their Claude token to stay out of other people's hands could already keep their sessions on their own runners (Only on my runners, #199), but the token itself still had to be handed to the control plane, which kept it encrypted in D1: a breach of D1 and the master key, or an operator of the instance, had every token, and a token from
claude setup-tokenlasts a year. Now a token can stay on the runners its owner operates. It is never given to fctl, and sessions on it run only on those of the owner's runners that keep it (ADR 0050).How it works
claude setup-tokenmakes a token, and the newfctl host claude set-tokenkeeps it in~/.config/fctl/claude-token(mode 0600, orclaude_token_fileinhost.toml). It asks for the token with the input hidden, or reads it from stdin.fctl host claude statusshows whether the runner keeps one and whether the control plane knows.fctl host claude remove-tokenremoves it.fctl host statusandfctl host doctorreport it too, and doctor flags a token file that others can read.HostHelloandHostHeartbeatcarryclaude_token: { saved_at }, never the token. FleetDO keeps it in the runner's hello, so a token saved or removed while the host runs shows up within one heartbeat (15 s). The runner's owner sees it (Runner.claude_token); nobody else does.fctl claude connect --on-runnersorPOST /api/v1/me/claude/on-runners: aclaude_credentialsrow withon_runnersset and an emptysecret_enc(migration 0029, one per person). Its kind issetup_token, so older clients show it as a long-lived token.fctl workspaces claude on-runners -w acmechooses it for a workspace.runs_forit counts as Only on my runners, in every workspace (fctl_domain::schedule::only_theirs), sospec::runner_serves(credentials, uplinks, files, screenshots) applies it too. FleetDO then starts such a session only on a runner whose host keeps a token. A queued session says why it waits (TokenWait): none of the person's runners is in the workspace, none of them is online, or the ones online keep none or run an fctl too old to keep one.on_runners: trueand an emptyaccess_token. The host puts its own token in before the agent sees either. When it keeps none, it refuses the session and says what to run (dev-host keeps no Claude token: run fctl host claude set-token on it). Agents need no change.claude_token::StreamRedactor). An agent that runsprintenv, or repeats the token in its reply, leaves[Claude token, redacted by fctl]in the transcript and in what viewers see live.In the app
Settings → Claude has a third way to connect, Keep the token on your runners, with a guided setup. It walks through
claude setup-tokenandfctl host claude set-tokenwith copy buttons, then lists your runners live as they report whether they keep the token. The steps tick off once one does, and Use the token on my runners connects it. Under the connection, each of your runners says whether it keeps the token. While none does, the steps show there. Elsewhere:Screenshots
At e49af51, in
cargo xtask dev(dev data only). Settings → Claude, 1440 px wide, light. Before: two ways to connect. After: a third, collapsed until Set up.The setup, dark: the dev host keeps a token already, so the steps on the runner are ticked off. Then light, before any runner keeps one, and dark at 390 px.
Once connected: each of your runners and whether it keeps the token. Light and dark, then light while none keeps it, where the steps show under the connection.
The Agent Floor while no runner keeps the token, then a workspace's Runners tab and its Settings → You while sessions there run on it:
On the runner
A session that waits says, for example:
Waiting for one of Dev Owner's runners that keeps their Claude token: the ones online keep none. fctl host claude set-token on one of them keeps it there.What it protects, and what not
The token is safe at rest and from other people's machines. It is never given to fctl, so D1 holds no secret for these connections. Hosts tell the control plane only whether they keep one, and take it out of what sessions send wherever it appears whole, also when it is streamed in pieces. The agent still has it in its environment, as with any connection. So whoever may direct the agent (the person, people they share the session with to message, the project's editors, text in a repository) can still have it sent elsewhere, or written in a form the redaction doesn't know. Hosts also trust the control plane to send them only their owner's sessions on such a connection, so a control plane that someone has taken over could start a session there to the same end. The security page and the ADR say so. Removing the token from a runner applies to the runs that start after; sessions running there keep it until they stop. A token from
claude setup-tokencan't use Remote Control, as before.Compatibility
All wire changes are additive and optional:
HostHello.claude_token,HostHeartbeat.claude_token,ClaudeCredential.on_runners,ClaudeCredentialInfo.on_runners,Runner.claude_tokenandAddClaudeOnRunnersRequest. Hosts too old to keep a token send nothing and never get these sessions. Older agents get the token like any other. Older clients show the connection as a long-lived token. One small fix along the way: without a chosen default,/auth/menow marks the newest working connection as used for new sessions, which is the onecredential_foractually runs them on (it marked the oldest).Verification
fctl_domain::claude), the scheduling rule and waiting reasons (schedule), wire compatibility (fctl-proto), keeping, filling and redacting tokens, also streamed in pieces of 1 to 40 characters, and the daemon's refusals and fresh credentials (fctl-host), the CLI's helpers, and in the web app the helpers, the setup and details, the note under the task box, the Runners tab and the locked switch.cargo xtask checkpasses: 691 Rust tests, 693 web tests, Clippy native and wasm, generated types and the production build.cargo xtask dev --smokepasses, againstwrangler devand againstcargo xtask serve(all 32 migrations applied on workerd).cargo xtask dev, and again againstcargo xtask serve:fctl host claude set-tokenon the dev host, the control plane learning it within a heartbeat, thenfctl claude connect --on-runners. A session with fake-claude's newprintenvran on the dev host, and/proc/<pid>/environof fake-claude showed the runner's token. The stored events showed[Claude token, redacted by fctl]and no token, and no file in the control plane's local state (.wrangler/,.fctl-serve/) or in the logs held it. Afterremove-token, a new session waited with the reason above while the running one kept going. Afterset-tokenwith a new token, the waiting session started within 15 s with the new token, while the earlier one kept the old one. Withprintenvalso saying the token back in five-character pieces, a viewer (fctl attach) sawClaude Code got the token [Claude token, redacted by fctl].live.The privacy policy says what app.fctl.sh stores, so it needs to change with this: hyperstructure/fctl-site#50.
Session: https://app.fctl.sh/s/ses_01M5N9BPAN1C2920A8R2PMC9GW