Skip to content

[FEATURE] Rooms: invite other people to a room with a scoped token or a client certificate #1960

Backlog

Description

@edenreich

Summary

Follows #1943 and #1954 (PR #1957).

A room is one user talking to agents today. This lets other people join a room on your daemon, the way teammates join a Slack channel: they read the log, post, ping members and see each other come and go. You decide who gets in with a room invite token or a client certificate (mutual TLS). Either one admits a person to the rooms you named, never to the rest of the daemon.

The binding's token can't be the invite. It authorizes everything the daemon serves: every session, approvals, the web terminal, the screen, artifacts and teleports. Handing it to a collaborator hands over the machine.

Design

  • People in a room
    • Every human has a name. The owner stays user and reads as "you", as today. A guest posts as their own name, and the log records it as the post's author with a person kind.
    • Mentions of a guest (@alice) never route to an agent. Routing, @all and room-wide posts work for a guest's post as for yours.
    • Each person gets their own first-visit welcome (FirstVisit per person, not per room).
    • When someone enters or leaves, the room shows a small notice, such as "→ alice joined #release". The pinned header lists the people present next to the members.
  • Invites by token
    • infer rooms invite <room> [--name alice] [--expires 7d] prints a token, and the daemon stores only its hash.
    • The token admits one person to one room: list_rooms (that room only), join_room, follow_room, post_room and leave_room. Every other frame and HTTP route answers unauthorized.
    • infer rooms invites lists the open invites, and infer rooms revoke <id> ends one, closing any connection it opened.
  • Invites by mutual TLS
    • With binding.tls.mode: ca, infer rooms invite <room> --cert issues a client certificate from the daemon's CA (~/.infer/daemon/pki/). Its subject names the person, and an extension lists the rooms it admits.
    • The binding takes the identity from the verified certificate, so a guest needs no token. Revoking adds the certificate's serial to a deny list the binding checks.
  • Enforcement
    • The binding handler decides, before any stage sees a frame, whether a connection is the owner (the binding token or an owner certificate) or a guest (an invite).
    • A guest's frames reach the rooms host only. clear_room and anything about sessions or approvals stay with the owner.
  • Guest clients

Security

A guest's post becomes a member's turn, and the member runs with the owner's tools on the owner's machine. In auto-with-judge the judge would weigh a guest's words as the request (#1957 quotes other members' posts, not people's). Before guests can trigger work, the room needs a rule for whose posts members act on. Two candidates:

  • A member answers a guest's post in plan mode (read-only).
  • A guest's post that routes to a member waits until the owner approves it in the room.

Open questions

  • Which of the two guest rules above, and should it be set per room or per invite?
  • Should a guest see the members' activity and approval notes, or only the posts?
  • Do guests need their own name check, so two invites can't both be "alice"?

Out of scope

Acceptance Criteria

  • infer rooms invite <room> issues a token, and with --cert a client certificate, each admitting one named person to that room only
  • A guest connection reaches only the rooms frames of its rooms. Sessions, approvals, the terminal, the screen and artifacts refuse it
  • Posts carry each person's name, and the room view shows them as their author, with you as "you"
  • Each person gets their own first-visit welcome, and the room shows when someone joins or leaves
  • infer rooms invites and infer rooms revoke list and end invites, and a revoked guest is disconnected
  • A guest's post that routes to a member follows the room's guest rule from the Security section
  • infer chat joins a room on another daemon with an invite, and the Room dropdown lists it
  • docs/rooms.md, docs/daemon.md and docs/browser-extension-protocol.md cover invites, guest scope and the person kind of posts
  • Tests cover token and certificate scope, revocation, per-person first visits and the join notices

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions