Skip to content

Users & accounts

A role bounds what its holder may do; it says nothing about people. The team edition adds the missing layer: a user is a person, the user holds a role (see roles), and the user’s groups govern shared resources (which models they may pick, which knowledge bases they can read). The partition key moves with the person: every user gets their own session, memory, notes, workspace, engine home and quota on the one daemon.

The team edition shipped in v0.14.0. The design is ADR-0004 and ADR-0003; the behavior contract is docs/contract/rbac.md.

Store tables (schema v12, the same SQLite file): users (username, display name, argon2id password hash, role, daily quota, disabled flag), groups (model allowlist and default), users_groups (membership), plus web_sessions and invites for the panel.

[[role]]
name = "member" # the permission set (see roles)
mode = "readonly"
budget_daily_usd = 2.0

An existing install migrates itself on first start: user operator (role admin) is created, admin identities bind to it, and each distinct non-admin role with at least one identity becomes a user named after that role. A single-user install ends with exactly one user, operator, and identical behavior. The operator’s local surfaces (terminal, CLI, web panel login) act as that user.

Where it lives
User partition <data>/users/<username>/{checkpoints,memory,notes,attachments,engine-home,ka,workspace}
Session one per user (sessions.username), adopted at the first message
Identities any number of channel identities per user (identities.username)
Audit every row carries the acting username beside the hash chain
Web one login per user (web_sessions), reach derived from the role

The operator keeps the profile’s own directories; everyone else lives under users/. Pre-team <data>/roles/<r> trees move to <data>/users/<r> once on first start.

Terminal window
ka-agent user invite --role member --group dev # prints a one-time code (24 h)
ka-agent user list # accounts with role, state, groups, identities
ka-agent user set ana --quota 3.0 --group dev,ops
ka-agent user reset ana # clear the password, drop web sessions

The invite is redeemed at the panel’s /invite page with a new password (argon2id, stored as a PHC string; NULL until the first login sets it). Invites are table-backed, so several can be outstanding at once: 24 h TTL, five attempts, constant-time compare. Admin resets work by clearing the hash and minting a new invite; there is no email infrastructure of any kind.

ka-agent user disable <name> pauses everything for the admin to decide: web sessions are deleted, the identities resolve to nothing (inbound messages are refused exactly like an unknown sender: no reply, one audit row surfaced on the panel’s contacts page), and their crons pause through the existing pause machinery. user enable reverses all four. Nothing is deleted implicitly:

  • ka-agent user export <name> writes a tar of the user’s session, memory, notes and attachment trees under backups/.
  • ka-agent user purge <name> --yes deletes the data trees (the account row and audit history stay, and it warns when no export exists).

A group carries a model policy: models_allow (the catalog union across a user’s groups; absent or empty means every model) and models_default (the first non-null across the user’s groups in alphabetical order, else the profile default). A model outside the policy is a named refusal, never a silent fallback. /model stops being admin-only here: every caller sees the listing filtered to what their groups allow.

A per-user quota_daily_usd overrides the role’s budget_daily_usd and the profile [budgets] when set; the effective order is user quota, then role cap, then profile cap. Over-quota actions always escalate (see approvals). The panel’s usage page takes ?user=<name> for a per-account split and ?format=csv for a download (admins only).

Groups are managed from the panel (/groups) and back the shared resources: knowledge bases and shared agents.

[retention]
turns_days = 365 # 0 keeps forever (the default)
attachments_days = 90

Both extend the store’s existing prune job (no new scheduler); 0 keeps everything, which is the default for an internal tool. The audit chain is never pruned; exports exist so that a purge is a deliberate act.

One daemon, one store, one bot token per channel, one audit chain: the organization is the trust boundary. There is no SSO/OIDC/SAML/SCIM, no MFA, no email: local accounts plus admin-minted invites are sized for 5 to 15 people, and multi-tenant hosting stays a non-goal. See roles for what a user’s role partitions, and the RBAC contract for the enforcement table.