Kibitz

← The Kibitz Engine · deep dive

Kibitz Architecture

Kibitz is an account-free, serverless, peer-to-peer call + collaboration engine — an embeddable widget and a headless controller. This is the system overview the other docs slot into.

See also: verification.md (who gets in), agent-platform.md (agents in a room), threat-model.md (what's protected).


1. The shape

2. The room model

A room id (normalized from the link) maps to a deterministic signaling id. The first peer to claim it becomes the authority; later peers join as participants. The authority coordinates presence only — the roster, the lobby/knock gate, lock, kick, and the verification gate. It is just a participant's browser; if it leaves, the role migrates to another peer (heartbeat + reclaim), and the new authority rebuilds its state from what it inherited.

Presence runs as a star to the authority (each participant ↔ authority); content does not (next section).

3. Three transport planes

Plane Carries Topology Encryption Helper
Signaling / presence room join, roster, lobby/lock/kick, gate announces star → authority (PeerJS) WSS/TLS to the broker self-hosted broker signal.kibitz.chat
Media audio / video / screen full WebRTC mesh DTLS-SRTP, E2E Cloudflare TURN when direct fails
Data chat, co-browse, directed messages, agent envelopes full DTLS data mesh DTLS, E2E (same peer connections)

The crucial property: media and data are a peer-to-peer mesh, end-to-end encrypted — no participant (not even the authority) relays content, and there is no media server that could decode or record it. The broker sees only presence metadata; TURN forwards encrypted packets it can't read. (See threat-model.md.)

A TURN relay (Cloudflare Realtime) is used only when two networks can't connect directly; it forwards the still-encrypted call.

4. The composable engine

mount(opts) boots the engine and returns a controller (MountedWidget):

The Widget UI is just one consumer of this controller. The same controller powers the Whist reference game (headless, draws its own table) and the Agent SDK. An in-memory transport (createLocalBus) runs the real presence engine with no network, for deterministic tests.

5. Identity & verification

Two independent, composable layers, both peer-to-peer:

Who may enter a room is the verification gate: the link carries a verifier, the authority checks credentials before rostering.

6. Participant capabilities

Once in, what each participant may do is itself scoped — a general per-participant permission model (humans and agents), not an agent-only bolt-on. Each participant carries a Grant of what it may perceive (content that flows to it) and act (what it may emit):

Defaults are by kind (meta.role): a human is full; an agent is read-onlyread-chat/read-roster/receive-directed, no act, no media. The host can widen or revoke any grant live, with a per-agent consent panel + a local-only audit feed (blocked acts + grant changes). The model is pure and serializable (core/capabilities.ts).

The engine enforces it per-peer (not the app — there's no server to police it):

Disclosure: an agent may declare its model backend and whether what it perceives **egress**es the E2EE room — shown to the host, never a privilege it grants itself. See agent-platform.md.

7. Edge infrastructure

All stateless and content-blind, on Cloudflare:

The project is operated pseudonymously; nothing requires an account or holds call content.

8. Surfaces an integrator uses

9. Non-goals