Repository navigation
Description
Context
After a successful password sign-in, onPasswordLogin (packages/ui-react/src/components/connectivity/login-screen.tsx:113-128) calls signedIn. signedIn (lines 41-69) verifies the account and then reloads the app, or restores a warm re-auth snapshot. Nothing suggests adding a passkey. The owner has to find Settings → Security → "Add a passkey" (packages/ui-react/src/components/settings/passkey-list.tsx:84-95). This source establishes the discovery path, not a measured adoption rate.
Guide security/passkey-conditional-create recommends registering a passkey silently right after a password sign-in. This project must not do that. The first passkey for an RP turns password login off (passwordLoginDisabled, packages/ui-server/src/middleware/passkeys.ts:289-295). A silently created passkey would therefore remove a sign-in method without the owner noticing. The offer has to be explicit.
Guide security/passkey-registration §6: "Promotion Flow: When proposing passkey creation right after standard password sign-ins …, set authenticatorAttachment: "platform"". Today register-options ignores its body and never sets an attachment (passkeys.ts:480-504). The capability check is getClientCapabilities().passkeyPlatformAuthenticator, falling back to isUserVerifyingPlatformAuthenticatorAvailable() (Chrome Android 70, Samsung Internet 10, Firefox Android 92). #2556 adds both.
Blocked by #2556
Interaction with #2560 (fresh verification for security changes): #2560 guards both registration endpoints with a five-minute freshness window per session principal, started by password login (its rulings 1 and 3). Immediate acceptance of this card is therefore fresh and never prompts. But the card stays until it is acted on or dismissed, so it can be accepted after the window has expired, and freshness can also expire between the two registration requests (registerPasskey, packages/ui-react/src/lib/passkeys.ts:51-58: options, then verify). #2560's S9 caller inventory lists this card's Add a passkey; its server freshness enforcement stays owned by #2560.
Recorded card design — 2026-10-22
The maintainer ruling replaces the proposed login interstitial with a dismissible Callout-based card in Chat after boot, above the composer and below the newest message. Sign-in reloads directly into the app; the card never steals focus. Secondary/ghost buttons preserve Send as the pane’s primary action; targets are at least 44px. Announce the card once politely. No offer on warm re-auth.
Scope
- Password login sets a one-shot passkey-offer-pending flag before reload. Boot reads and immediately clears it, then shows the card only if auth/methods reported no RP passkey, a platform authenticator is available, and this device has no unexpired dismissal. A second boot does not show it. Ignoring it until reload records no dismissal; the next password sign-in may offer again.
- Title: “Use your screen lock to sign in?” Body: “Your fingerprint, face or PIN will sign you in on this device.” Default consequence states that password sign-in stops for the host and that removing every passkey in Settings → Security restores it.
- Add passwordStaysOnWithPasskey: boolean to GET /auth/methods. On explicitly password-enabled hosts, the consequence is “Password sign-in keeps working too.” Document the additive field with the existing promotion request in docs/http-api.md in the same CONTRACT: commit.
- Add a passkey runs explicit platform registration with the optional promotion:true register-options body. No conditional creation.
- Not now, ✕ (accessible name “Dismiss passkey offer”) and Escape while focus is inside the card remove it and record a 90-day per-device dismissal under the root storage key. No warm re-auth interruption.
- OS cancellation leaves the card with “No passkey added.” and records no dismissal. Registration failure shows “Couldn't add the passkey. You're still signed in with your password.” with Try again / Not now; failure itself records no flag. Offline at the tap shows “You're offline. You can add a passkey later in Settings → Security.” with Not now only; entering offline state itself records no flag.
- Fresh verification (only if ui-server: passkey and principal management need a fresh passkey verification, not just a 30-day cookie #2560 has landed when this is implemented; otherwise ui-server: passkey and principal management need a fresh passkey verification, not just a 30-day cookie #2560 wires it): Add a passkey runs through ui-server: passkey and principal management need a fresh passkey verification, not just a 30-day cookie #2560's
freshActionaround both registration steps, asPasskeyTab.onAdddoes (packages/ui-react/src/components/settings/passkey-tab.tsx:78-94). Inside the window, no prompt. After expiry, ui-server: passkey and principal management need a fresh passkey verification, not just a 30-day cookie #2560's "Confirm it's you" prompt opens first, then the registration ceremony. Cancelling that prompt leaves the card exactly as it was, with no status line, no banner and no dismissal recorded, and returns focus to Add a passkey. Areauth_requiredonregister-verifyre-verifies and retries once with the same attestation; if the challenge expired, the card shows ui-server: passkey and principal management need a fresh passkey verification, not just a 30-day cookie #2560's S8 line “Registration timed out. Add the passkey again.” with Try again / Not now, recording no dismissal. - Success swaps the card to “Passkey added.” and the truthful password-policy consequence; ✕ closes it. The login brand baselines stay unchanged. Add Chat offer/success/failure baselines at 320px and 768px.
Out of scope
- Conditional create (
mediation: "conditional"oncreate). It is excluded for the reason above. - Promoting passkeys anywhere other than right after a password sign-in.
- Changing the password-disable policy.
Acceptance criteria
- The card placement, 90-day dismissal, warm re-auth exclusion and password-enabled contract/copy branch are ruled on this issue.
- The offer never appears when the RP already has a passkey, when no platform authenticator is available, after a passkey sign-in, or during the 90-day dismissal, or on warm re-auth. Unit-tested; expiry permits another offer.
- Real-Chrome runtime test (CDP virtual authenticator with
isUserVerifiedand a platform transport): the first boot after password sign-in shows the card in Chat and a second boot does not. Accepting registers a credential withauthenticatorAttachment: "platform"in the options, while the app remains signed in. Declining removes the card with no credential stored. Fails before the change. - With ui-server: passkey and principal management need a fresh passkey verification, not just a 30-day cookie #2560's guard present (real Chrome, CDP virtual authenticator), each case is proven: immediate acceptance after password sign-in registers with no prompt; acceptance after the freshness window expired prompts, verifies, then registers; cancelling the prompt stores no credential and leaves the card unchanged with no dismissal recorded; freshness expiring between
register-optionsandregister-verifyprompts and retries once with the same attestation, or shows the timed-out line when the challenge expired. If ui-server: passkey and principal management need a fresh passkey verification, not just a 30-day cookie #2560 has not landed, these cases move to ui-server: passkey and principal management need a fresh passkey verification, not just a 30-day cookie #2560's S9 criteria and the PR says so. - Android/Firefox support: with
getClientCapabilitiesdeleted, the fallback detection decides. WithPublicKeyCredentialabsent, no offer is shown. - The server test for
register-optionswith{ promotion: true }assertsauthenticatorSelection.authenticatorAttachment === "platform". Without the flag, the options are unchanged.
Verification
bun run test packages/ui-server/tests/passkeys.test.ts
bun run test packages/ui-react/tests/passkey-login-runtime.test.ts # BRAIN_REQUIRE_CHROME=1
bun run test:layout
bun run test
bun run typecheck
bun run lintContract impact
- This touches the integration contract, so it needs the
contractlabel, aCONTRACT:commit prefix, and the doc updated in the same commit. Additive: optional promotion body on register-options and passwordStaysOnWithPasskey boolean in auth/methods, documented in docs/http-api.md. - This changes a published package's behaviour, so it needs a changeset.
2026-10-24: specified the card's behaviour under #2560's fresh-verification guard (immediate acceptance, acceptance after expiry, cancelling the prompt, expiry between registration steps) and the ownership split with #2560; moved the stacked 2026-10-22 triage notes out (they are in the comments).
Activity
schlessera commentedon Oct 22, 2026
Design needed: what the owner sees between a successful password sign-in and the app.
These points are already decided: the offer is explicit (never silent conditional create), it uses a platform authenticator, and it only appears when the RP has no passkey. Still open: where the offer lives, what it says about password sign-in being turned off, and how "not now" behaves. The code cannot settle these. They are judgements about wording, placement and timing, and they decide whether the owner understands that accepting turns off password sign-in for this site.
schlessera commentedon Oct 22, 2026
Design brief: the passkey offer after a password sign-in
Recommendation: one interstitial step on the login surface.
signedInhas verified the account and beforereloadAfterSignIn.Calloutfor the consequence, and twoButtons.Answers
reauth): no offer. The owner is mid-task with a draft or recording locked behind the sign-in. Nothing may stand between them and that work. The next cold password sign-in can offer.Callout, so it cannot be skimmed past as body text.localStorageunder the root's storage key, holding the date of dismissal.CloseWatcheron this step) count as "Not now".NotAllowedError, the sameisUserCancelcheck as login): return to the offer unchanged. Show the status line "No passkey added.", focus goes back to Add a passkey, and no dismissal is recorded. A cancel is not a decision.Callout: "Couldn't add the passkey. You're still signed in with your password." The primary button becomes Continue, the secondary becomes Try again, and no flag is recorded.Callout: "You're offline. You can add a passkey later in Settings → Security." The primary button becomes Continue and no flag is recorded. The app then boots exactly as it would today.Success: a confirmation state with one button, Continue, focused. It confirms that password sign-in is now off, which is a change the owner must see once. Then
reloadAfterSignInruns as today.Final copy
{host}. To bring it back, remove every passkey in Settings → Security.{host}.Accessible names match the labels. The step is
role="group"labelled by the title and described by the body and the callout. Focus lands on Add a passkey.Mocks: 320 px
Mocks: 768 px (the same card, centred in the login surface's existing column)
Conditions (unchanged from the issue, plus one)
The offer shows only when all of these hold:
/auth/methodsreportedpasskey: falseVisual baseline
The existing
brand-login-*baselines do not change. This is a new state ofLoginForm, so it gets new baselines: offer, cancelled, failed, success, at 320 px and 768 px.Related
If #2560 lands, the password sign-in that leads to this step must count as fresh. Otherwise accepting would trigger a second prompt.
For the maintainer
BRAIN_UI_ALLOW_PASSWORD=1: the callout above would be false there. I suggest an additive/auth/methodsfield (for examplepasswordStaysOnWithPasskey: true). With it, the callout swaps to "Password sign-in keeps working too." This extends thecontractscope. Alternatively, hide the offer on such hosts.schlessera commentedon Oct 22, 2026
2026-10-22 triage at main
aa8c8966b59f031f054f4876dbca84048b40ae4f: linked the supplied proposal and exact outstanding choices into the brief, distinguished proposal from approval and noted the password-enabled copy branch. Removed the unsupported adoption-rate inference and refreshed server pointers. Preserve the concurrent needs: decision state, native #2554 parent, #2556 blocker and p3; no new offer policy or runtime result is selected.schlessera commentedon Oct 22, 2026
Maintainer ruling
BRAIN_UI_ALLOW_PASSWORD=1: add an additive/auth/methodsfield,passwordStaysOnWithPasskey: boolean. When it is true, the consequence line reads "Password sign-in keeps working too." This widens thecontractchange: document the field indocs/http-api.mdin the sameCONTRACT:commit.localStorageunder the root's storage key.Copy (other than the placement), cancel, failure, offline and success handling stand as in the brief, adapted to the card below.
Card spec (revised design for the ruled placement)
onPasswordLoginsets a one-shotpasskey-offer-pendingflag before the reload./auth/methodsreportedpasskey: false, a platform authenticator is available, there is no unexpired "Not now", and this is not a re-auth.Callout-based card pinned above the composer, below the newest message. It never covers the transcript. It shows only in Chat, the destination the app boots into.Copy (unchanged, plus the variant)
{host}. To bring it back, remove every passkey in Settings → Security.passwordStaysOnWithPasskey){host}. (or: …keeps working too.) The card closes after its ✕.Mocks: 320 px
Mocks: 768 px
States carried over from the brief, now inside the card
Baselines and acceptance-criteria impact
brand-login-*baselines are unchanged, because the login surface is untouched.#2556 still blocks this issue. All rulings are recorded, so
needs: decisionis removed.schlessera commentedon Oct 22, 2026
2026-10-22 readiness reconciliation: folded the maintainer ruling into the body, replacing the unresolved-choice specification and aligning scope/criteria with the accepted branch. The remaining work is explicitly scoped; add agent-ready with blocked retained for open #2556. Preserve priority, native parent, assignment and release attribution. This is issue preparation, not implementation, runtime proof or delivery.