Skip to content

id: design: pseudo-login identities & scoped do-as delegation (variant d) (from #5684) #5889

Closed

Description

@dezren39

Summary

Follow-on design ticket from #5684 — its decomposition sketch names this as a separate design, and the parent's acceptance requires these tickets to be filed and linked. Filed in the 2026-11-04 gap pass (WS-F) so the design work exists and can be prioritised on its own merits; implementation timing is a separate decision, possibly months out.

What this design must settle

Ownership forms, challenge signing, scope/expiry/revocation, and raw-view provenance for do-as delegation.

Context from the parent

The parent design — Drew-ruled keen and simplicity-first — fixes the key-custody variants, security-code recovery, and pseudo-login delegation for ID identity. The parent issue carries the surrounding decisions this ticket must not re-decide; where this ticket's answer would change a parent decision, record that explicitly rather than silently forking it.

Decision record expected

Close this design with a recorded decision (on this issue or in a doc/ record linked from it): the chosen shape, the alternatives rejected and why, and the invariants implementation must hold. If the design splits further, file the splits and link them here rather than growing this issue.

Relations

Parent: #5684. Programme: epic #2056. Filed by WS-F (2026-11-04 ID design gap & expansion pass).

Activity

  1. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  3. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 5, 2026
  4. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    work/assignedQueue worker lifecycle state
    and removed on Nov 5, 2026
  5. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor

    🤖 Agent note · handed off / parked

  6. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: handed off

  7. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 5, 2026
  8. 52 remaining items

  9. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: done

    • Agent: repo queue worker (repo-worker-code), OpenChamber scheduled lane 262eb403-3347-4a7c-ba6b-e7bc263ca853
    • Session / ID: ses_e5e44f84947ffev8UZ6glQ3CL1; triage task 12375
    • Verdict: id: design: pseudo-login identities & scoped do-as delegation (variant d) (from #5684) #5889 is real and current; the missing unified pseudo-login/do-as contract and raw-view provenance are recorded in the triage note above.
    • Queue: triage task 12375 completed; canonical remaining-design follow-up task 13644 is queued under repo-health:v1:fix:developing-today/code:issue:5889.
    • Issue state: remains OPEN. Labels now reflect the queued follow-up: task/small-fix, queue/queued, status/needs-triage.
    • Bookkeeping: sandbox backlog and sweep.log intentionally deferred to fleet reconciliation for this OpenChamber scheduled lane.
  10. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    🤖 Agent note · picked up

  11. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    🤖 Agent note · decision record posted (task 13644, lane code-o, direct)

    Decision record — pseudo-login identities & scoped do-as delegation (variant d of #5684)

    This record settles the design #5889 was filed to settle. It conforms to parent #5684 (Drew-ruled, keen / simplicity-first) and changes no parent decision; the one place it touches a parent-adjacent mechanism (the one-time login token) is recorded explicitly in §7. Implementation is follow-on work, prioritised separately per the parent — this record is the design, not an implementation.

    0. Grounding — primitives that already exist (verified on laptop main 1f5ac11)

    • JoinCapability — pkgs/id/src/world/mod.rs:339: an invite/join proof, held and redeemed to enter a world.
    • delegate_to_friend — pkgs/id/src/world/core.rs:1651: an existing scoped delegation between participants in a world.
    • CapabilityBounds / invite_bounds — pkgs/id/src/world_session/types.rs (~L496): expiry (expires_at) and use-count bounds on capabilities.
    • effective_scopes — pkgs/id/src/world/core.rs:1718: resolves what a participant may effectively do, through delegation.
    • revoke_tree — pkgs/id/src/world/core.rs:1843: revokes a participant and everything delegated downstream of it.
    • Signed HTTP request authentication with replay protection (per the task packet's verified evidence): per-request signing already exists as a separate mechanism.

    Consequence: do-as delegation is a composition of these primitives, not a new subsystem. Anything below that cannot be expressed as a composition of the above plus one new artefact (the delegation grant, §2) is out of scope for the first implementation.

    1. The acted-as identity contract (cross-context)

    Every action in the system is attributable to a 4-tuple, and verifiers resolve all four parts:

    1. Authenticating principal — the real ID (the user's root identity from design(id): identity, login & delegation — simplicity-first key custody, security-code recovery, and pseudo-login identities #5684). It authenticates at login and signs delegation grants. It never signs day-to-day activity (parent rule, unchanged).
    2. Acted-as / effective identity — the pseudo-login identity that actually signs the action.
    3. Delegation grant — the signed artefact (§2) authorising (2) to act for (1), identified by grant id.
    4. Context — the world(s) and capability scope in which the action is taken.

    Contract rules:

    • An action is valid iff: the signature verifies against the pseudo-login identity's key; a live grant exists from the principal to that pseudo-login identity covering the context; and the action's scope ⊆ the grant's scope ⊆ the principal's own effective scope in that context (checked with effective_scopes semantics — delegation can only ever narrow, never widen).
    • Contexts do not leak: a grant minted for one world grants nothing in any other world. Cross-context use means one grant per context, all visible in the same management view (§6).
    • Friendly UI may render the action as the user's; the raw record always carries the full tuple (§5).

    2. The delegation grant — the one new artefact

    A grant is a signed statement by the principal's real key (the parent's signed-hash construction applied to delegation: the real key signs the grant, acceptance thereafter comes from verifying that signature, never from anyone's custody of the real key). Fields:

    • grant_id, principal_id, pseudo_login_id
    • scope — a set of (world, capabilities) pairs, expressed with existing scope types
    • bounds — a CapabilityBounds: expires_at (required, see §4) and optional max uses
    • created_at, nonce
    • signature by the principal

    The grant is stored server-side as a public artefact (it contains no secret material — the pseudo-login's private key is never in it) and is presented or referenced by id at verification time.

    3. Ownership forms — decided

    Three forms were on the table. They are not equals; each gets a different trust ceiling:

    Form Standing do-as scope? Revoked by Ceiling
    User-owned (the principal's real key created and can revoke the pseudo-login) — the default and the only recommended form for ongoing use Yes, via a §2 grant Principal at any time (§4) Grant scope
    Login-derived / nobody-owned (fresh identity materialised from an authentication event; no key controls it) No Session record deletion / session expiry only One session, shortest expiry, no grant renewal without a fresh authentication event
    Service-held pseudo-login (the service's custody variant (a) key acts) Only as variant (a) already allows Service + principal, per variant (a) rules Inherits variant (a)'s honesty statement verbatim: the service can act as the user

    Decisions:

    • User-owned is the canonical form. A pseudo-login is its own real ID (its own keypair), created under the principal's control, one per device / login method.
    • Login-derived pseudo-logins are session identities, not delegation holders. They answer "what signs in this browser session" and nothing more. The honest statement, for UX copy: nobody holds a key for this login; it ends when the session ends, and it cannot be extended — only replaced by logging in again. They may act only within the scope the authentication event itself carried, and never beyond the session.
    • A login-derived identity can be adopted: the principal, once authenticated by a stronger route, signs a §2 grant to it, converting it into a user-owned pseudo-login. Adoption is an explicit user-visible act, never automatic.

    4. Scope, expiry, revocation

    • Scope: least-privilege by default. Grant creation pre-fills the narrowest scope that covers the stated purpose (per world, per capability set) and renders it in plain language before the user confirms: "this login can do X in worlds Y until Z" (parent requirement).
    • Expiry: every grant has one. CapabilityBounds.expires_at is mandatory for grants (unlike invites, no unbounded default); the default is short (days, not months) and renewal is a fresh signed grant, not an edit — grants are immutable, supersession only.
    • Use bounds: optional uses cap via the same CapabilityBounds, for single-purpose delegations.
    • Revocation:
      • The principal revokes a grant (or a whole pseudo-login, i.e. all its grants) at any time from the management view; revocation is a signed statement by the principal (or an authenticated management action under variant (a), which inherits (a)'s honesty).
      • Revoking a pseudo-login uses revoke_tree semantics: everything delegated downstream of it dies with it.
      • Propagation: verifiers check grant liveness at verification time against the stored grant set; no verifier may cache liveness beyond a short TTL (minutes). Actions already taken under a then-live grant stand — they are history with provenance (§5), not retroactively invalidated. What revocation changes is the future, instantly at next verification.
      • Login-derived identities: revocation = deleting the server-side session record; there is no key to kill, and the design says so plainly rather than pretending otherwise.
      • A compromised pseudo-login never compromises the principal: killing it touches nothing about the real identity, its keys, or its other pseudo-logins (parent flow 5).

    5. Challenge signing — three different signings, kept separate

    Confusing these three is the main design hazard; they are distinct mechanisms with distinct artefacts:

    1. Delegation challenge signing (this design). To activate a session under a grant, the pseudo-login identity signs a challenge issued by the verifier: sign(pseudo_login_key, grant_id ‖ verifier_nonce ‖ context ‖ timestamp). The nonce is verifier-chosen, single-use, and short-lived (minutes). This proves live possession of the pseudo-login key and binds the session to one specific grant and context. It never involves the principal's key.
    2. Request authentication (existing). Per-request signed HTTP authentication with replay protection authenticates individual requests inside an established session. It is not a delegation proof and must not be treated as one: a valid request signature from a key with no live grant authorises nothing.
    3. Invite proofs (existing). Redeeming a JoinCapability proves an invite was extended. It creates membership; it confers no do-as authority and cannot substitute for a grant.

    Rule: authority comes only from the grant; challenge signing proves the session holds the granted key; request signing proves request origin. All three may compose in one flow, none may substitute for another.

    6. Raw-view and audit provenance

    • The raw activity record stores the full §1 tuple: acting pseudo-login ID, principal ID, grant id, and the grant's scope snapshot at action time.
    • The raw view renders exactly that — "pseudo-login P acted, under delegation grant G from user U, scope S" — even where the friendly UI renders the action as the user's (parent: provenance is visible in the raw view, full stop).
    • Grant lifecycle events (creation, adoption, supersession, revocation, expiry) are themselves recorded with the same provenance, so the delegation chain is auditable end to end.
    • The management view (parent flow 5) lists every pseudo-login with: form (§3), plain-language scope, expiry, last-used, and a revoke control — one row per pseudo-login, grants grouped under it.

    7. Relation to the parent's one-time login token — recorded, no conflict

    Parent comment (2026-11-04, Drew's own mechanism): an already-authenticated surface (CLI or web login) mints a one-time token to carry that authentication into a browser session. Composition with this design, decided here: redeeming that token creates (or attaches to) a login-derived pseudo-login session under §3 — the token transports an authentication that already happened; it does not mint a §2 grant and confers no standing do-as scope. If the browser session later needs standing scope, §3 adoption applies. This narrows nothing the parent decided; it names which §3 form the token lands in.

    Conflict check against #5684: no parent decision is changed by this record. Key-custody variants (a)/(b), security-code recovery (c), and the signed-hash construction are inputs, reused as-is. The only cross-references are §3's service-held row (inherits (a)'s honesty statement) and §7 above.

    8. Alternatives rejected

    • Real key signs activity directly, pseudo-login is just a label. Rejected: violates the parent's core rule (the real key never performs the activity) and destroys revocation granularity.
    • Impersonation flag on an account row ("act as user" bit, no separate identity). Rejected: no cryptographic provenance; the raw view could not distinguish actor from principal; revocation and scope would be policy theatre, exactly what the parent's honesty requirement forbids.
    • Bearer-token delegation with no signed grant (an opaque token is the authority). Rejected: possession = authority with no chain to audit, no scope binding, and theft is silent and total until expiry. The grant must be a signed, inspectable artefact.
    • Deterministically deriving the pseudo-login key from the login credential (e.g. from the password). Rejected: couples delegation identity to a low-entropy secret (the parent's own password-derived-key brute-force concern), and rotating the credential would silently rotate or orphan every delegation.
    • One global pseudo-login for all contexts. Rejected: violates least-privilege and per-device independent revocability (parent: one per device / method).

    9. Invariants implementation must hold

    1. The principal's real key signs grants, adoptions, and revocations — and nothing else in day-to-day operation.
    2. No action verifies without a live, in-scope, unexpired grant behind the acting pseudo-login identity.
    3. Delegation only narrows: effective scope of any pseudo-login action ⊆ grant scope ⊆ principal's effective scope, per context.
    4. Grants are immutable, always expiring, and revocable with tree semantics; revocation is effective at next verification.
    5. Raw provenance is never collapsed: actor, principal, grant, and scope snapshot are on every record.
    6. Challenge signing, request authentication, and invite proofs are implemented and verified as three separate checks; no one of them implies another.
    7. Login-derived identities hold no standing scope and cannot be renewed without a fresh authentication event.
    8. Every user-facing scope statement is plain-language and complete (who can act, as whom, where, until when) before the user confirms a grant.

    Recorded by queue task 13644 (repo-worker-code, lane code-o, direct lane). Issue #5889 stays open per its packet: this record completes the design decision; implementation splits are follow-on work to be filed/prioritised separately, not silently grown here.

  12. added this to the ID platform program milestone on Nov 12, 2026
  13. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged (bulk-intake concurrence) — design decision already recorded by task 13644; issue stays open per its packet for implementation splits

  14. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged — decision record already on this issue (task 13644); no dependency, no new packet

    • Agent: repo-worker-code
    • Session / ID: queue task 19926 · lane code-e
    • Found via: repo-health-code-pilot atomic claim (small_fix packet; triage follow-on of task 18400)

    Fresh verification (2026-11-17, this run): issue #5889 OPEN, labels task/small-fix + app/id + epic/id-program, no hard-stop labels, no comments since task 18400's triage note today (2026-11-17T03:04Z).

    Verdict (concurring with task 18400): the design this issue was filed to settle is settled — task 13644's full decision record is posted on this issue (2026-11-08, lane code-o), grounded in primitives verified on main, conforming to parent #5684 and changing no parent decision. Unlike a dep-gated item, nothing named blocks this issue: it stays OPEN per its packet for implementation splits, which the parent programme prioritises separately; none are filed yet and this triage files none (per task 18400's verdict). The #5684 gate leg naming this child record is satisfied in substance.

    Terminal for this task: task 19926 completes as triaged, naming task 18400's triage of record and task 13644's decision record. No follow-on packet enqueued.

  15. removed their assignment
    on Nov 20, 2026
  16. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Done check + close — Lane EC (archer), 2026-11-22

    Picked up via the parent triage: queue task 16820 (re-packet triage of parent #5684) named this issue as one of its two remaining gate legs. Fresh checks this pass:

    Closing #5889 as completed: the variant (d) design it asked for is decided and recorded. This clears the last child gate of parent #5684; it does not close or decide #5684 itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)epic/id-programReprioritization program epic (2026-11-12)status:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions