exoDocs
Decisions (ADRs)

Decisions and roadmap

ADR 0031: Exo Imprint email + password for builders (staging only)

  • Status: proposed. Built on request ("we need an email password thing for Exo now", Samir via the Foundation project, 2026-11-13). Three choices below need Samir's confirmation before production (see "Open for Samir").
  • Date: 2026-11-13
  • Decided by: Samir (owner), pending the open items
  • Number: 0031. Staging tops out at 0027; open drafts hold 0028 (#367), 0029 (#398) and 0030 (#399).
  • Builds on: ADR 0004 (Exo ID is the identity provider), ADR 0009 (device flow and personal keys), ADR 0012 (Convex Auth everywhere, no Clerk), ADR 0016 (approved stack), ADR 0025 and its amendments (the Imprint card; "no email codes" in the embed)

Context

A builder with no Google account and no phone (the first is Foundation's dev@foundation.financial) can't create an Exo account today: Exo Imprint offers Google, GitHub and phone, plus email codes for one staging property. Builders need an account to run exo login, connect an agent over MCP, and file work through intake.

Decision

  1. Method. Exo Imprint gains email + password, on staging only. /id/authorize shows Continue with email under Google, GitHub and phone; method=email opens it directly and mode=sign-up opens its create form. /id/device, /id/keys and the connect screen offer it too (the shared ExoIdSignIn chooser). Exo's own pages: /id/sign-up, /id/sign-in, /id/email/verify, /id/email/reset. Production refuses every request (emailPasswordAvailable, keyed off the staging Convex deployment) and shows no button.
  2. Accounts. Keyed by the lowercased address under a new email-password provider, separate from Google, GitHub, phone and email-code accounts (no automatic merge, as for phone). A new account is a plain builder: no role, passwordOnly: true, which keeps it out of platform roles (requireRole, grantPlatformAdmin, setRole, the MCP admin check) until a second factor exists. Unlike the code-only accounts it may hold agent credentials (Exo Keys, exo login, MCP), because the address is verified and the password is the builder's own.
  3. Email ownership by link, not code. Sign-up emails a single-use, 30-minute link (/id/email/verify#token=…; the token rides in the fragment, which never reaches a server or a Referer). Only SHA-256 of the token is stored. The account doesn't exist until the link is opened and the password chosen with it is entered again, so a link someone else triggered (with their password) can't make an account the owner then uses. Five wrong passwords destroy a link. Mail goes through Exo's Bird email adapter like every other Exo email, sender signin@updates.interspace.ventures, transactional, no open or click tracking.
  4. Passwords. Hashed and checked by the Convex Auth password component Exo already mounts (@convex-dev/auth providers/password: argon2id in WASM, a per-key throttle), keyed by an opaque passwordKey; Exo's tables hold no hash. Rules: 12–100 characters, no surrounding spaces, not on the component's bundled common-password list, and not in Have I Been Pwned's breach corpus (k-anonymity range API: only the first five hex characters of the SHA-1 leave Exo; fails open if HIBP is down; EXO_PASSWORD_BREACH_CHECK=off disables it). All checks run server-side, in the Convex HTTP action.
  5. Reset. A single-use, 30-minute link (/id/email/reset#token=…) to an existing account only. A new password gets a fresh passwordKey; the old hash is overwritten with random bytes, the lockout and per-address throttle are cleared, and every Exo ID refresh-token family of the user (connected apps, exo login) is revoked.
  6. Abuse controls. Every request comes through /exo-id/v1/password/* (also /exo-key), whose HTTP action knows the client IP; the mutations are internal. Limits: per IP for sign-in and for link checks, the shared per-IP email-send limit, per address (sign-in 5 then 10/hour; emails 1 per 30 s and 5/hour; Gmail spellings share one budget), and a global email bucket. Progressive lockout per address after five failures (1, 2, 4 … minutes, capped at an hour), keyed by a hash of the address whether or not an account exists. Generic answers: sign-up and reset requests answer the same either way (an existing owner gets a "you already have an account" notice instead of a link), and sign-in answers invalid_credentials for an unknown address, a wrong password and an unverified sign-up alike, spending a decoy argon2id hash on an unknown address so timing matches. Token and ticket hashes are compared in constant time.
  7. Sessions. A correct password (or an opened link) yields a single-use, two-minute ticket; auth:signInWithEmailPassword redeems it for the Convex Auth session, the same shape as phone sign-in. From there the device flow, Exo Keys and MCP work unchanged (tests in tests/int/imprint-email-password.int.spec.ts).
  8. Passkeys: hook only. After sign-up the flow calls offerPasskeyAfterSignUp (src/components/ExoIdEmailPassword/passkey.ts), which does nothing yet. The follow-up mounts @convex-dev/auth's passkey component (built on the OSS @simplewebauthn libraries, already in the lockfile), sets the relying-party id and links a passkey to an existing Exo user. That is its own Convex component deployment, so it ships separately.

Libraries

Password hashing, the common-password list and the per-key throttle come from @convex-dev/auth's password component (already mounted). Rate limits use @convex-dev/rate-limiter. Hand-rolled: the link and ticket tables, the lockout counter and the HIBP range call (a single GET; no maintained library fits Convex's runtime better than fetch). Rejected: scrypt in a Node action (works, but a second hashing path next to the component's argon2id); setupUsernamePassword as is (usernames, no email verification or reset); a hosted auth vendor (forbidden by ADR 0012 and 0016).

Open for Samir

  1. Link, not code. You said "no email codes" for the Imprint embed (ADR 0025 amendment 2), so verification is a link. Confirm, or say if you'd rather have codes here.
  2. HIBP. The breach check calls api.pwnedpasswords.com (Cloudflare-fronted, run by Troy Hunt) with a 5-character hash prefix and nothing else. It is a third party under the untrusted-third-party rule. Keep it, turn it off (EXO_PASSWORD_BREACH_CHECK=off), or replace it with a bundled breach list (tens of MB).
  3. Passkeys. Approve the follow-up above.
  4. Production. Email + password stays on staging until you say otherwise.

Consequences

  • One more sign-in method to keep consistent with the others; its copy never says whether an account exists.
  • Accounts are per provider, so a builder who later signs in with Google at the same address gets a second Exo user until account linking exists (the same gap phone has). operators.setRole and grantPlatformAdmin look users up by email with .unique(), which already fails when two providers share an address; password accounts can't hold a role anyway.
  • Pending sign-ups that are never confirmed leave an argon2id hash under a random key in the password component (the component has no delete); a sweep can overwrite them later.

Source: docs/adr/0031-imprint-email-password.md

On this page