cmux-cloud-start-core: Release login copy after a one-time consent, behind a remote switch, owner machines only (step A)

Merged
TE
2d ago
+231-8

Step A (Rust only) of shipping the Mac-to-machine Claude login copy in Release. Leo (2026-11-02), approving it on three conditions:

  1. "Consent first. It's on only after a clear one-time prompt: 'use my Claude login on my own Cloud machines'."
  2. "Your token only: your own token, to your own machine. Never stored by us, never on team machines, never shared."
  3. "A remote off switch, so if Anthropic objects we turn it off for everyone within minutes and fall back to the one-click sign-in."

Stacked on #32869 (its Choice, Step::Refuse and Reason::InstallChosen); the diff shrinks to this PR's two commits once #32869 lands. #33006 (Release never copies) is already in base; this keeps DEV and NIGHTLY exactly as #33006 left them and adds the Release path beside it.

What

cmux-cloud-start-core::harness_login (op cloud_harness_login, two new optional inputs, so today's app is unchanged):

  • remoteSwitch: the API Worker's switch (GET /v1/cloud/harness-login-copy, cmux-platform). A Release build (dogfood: false) passes a login only while it is true; absent, unread or stale is off. Off gives skip (remote-switch-off), and the machine's chat offers the one-click "Sign in to Claude" (acpmux agent_login). cmux.cloud.passHarnessLogin = NO still turns it off. New release_passes_harness_login(setting, remote_switch).
  • consent: the person's answer to the one-time prompt, kept on the Mac. Never asked gives the new step ask-consent (reason consent-first), and only where a copy would actually happen (signed in, the platform says the caller owns the machine, an owner guest, no working login there). Yes installs with no second prompt (install-chosen, or install-cached). No gives skip (consent-declined). A headless run refuses instead of waiting on a prompt nobody sees. Neither --login pass nor a kept choice stands in for the consent.
  • Release copies only to an owner guest. The creator's team guest (DEV and NIGHTLY, Leo 2026-11-01) is guest-not-owner / skippedTeamMachine in Release.
  • The record line adds , release consent yes|no|-, switch yes|no|- on Release starts.

The Swift side (the prompt, the Settings toggle, the switch read, the FFI re-pin) follows in step B once app-ffi-release publishes this commit.

Test

Fleet (cmux-ci test, Linux): cargo fmt --check -p cmux-cloud-start-core, cargo test -p cmux-cloud-start-core (43 passed), cargo test --manifest-path crates/cmux-layout-reducer-ffi/Cargo.toml --test cloud_harness_login (13 passed), cargo clippy -p cmux-cloud-start-core --all-targets -D warnings. New: release_copies_only_with_the_switch_on_and_the_persons_consent, release_never_copies_to_a_team_or_shared_machine, the_release_record_says_consent_and_switch, FFI a_release_start_reads_the_switch_and_the_consent.

Agent session: agent session

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Step A (Rust only) of shipping the Mac-to-machine Claude login copy in Release. A Release build now copies a login only when the person consented once, the remote switch is on, and the machine is the caller's own; without consent or with the switch off it falls back to the one-click sign-in and the machine stays as it is. The switch and setting hold a pre-resolved Release request too (one sent without a dogfood field). The login is never stored on cmux servers: the old platform-side harness login sync is removed and its state file is dropped at start. DEV and NIGHTLY behave exactly as before.

  • New ask rules decide who may answer a Cloud start ask: only the person (a CLI request with no agent session) may answer Start unless the person delegated it; a headless run refuses instead of waiting on a prompt nobody sees.
  • The record line adds , release consent yes|no|-, switch yes|no|- on Release starts.