Repository navigation
Description
Problem Statement
A Host serves one Human. Teams want one Host (an office computer or a VPS) to serve several people, each signing in as an independent identity with private Bots, while collaborating with other Humans and Bots in shared Channels so Bots become colleagues who accumulate team context. Today the only Human ID is the hard-coded local-human; PersonaBots have no owner, approvals go to "the Human", Paired Device grants bind no person, and Tob reads everything.
This is orthogonal to the Environment work (#4108 / hub #4109): Environment is one Human across several Hosts; Team mode is one Host serving several Humans.
Solution
An always-multi-member data model in which the existing Human is the Host Owner, plus a Team mode switch that admits Host Members and requires every non-local Client to sign in. Host-owned identity (local password now, OIDC-ready), device grants bound to exactly one Human ID, a fixed Host Permission catalog with Host Roles, advisory Role Policy reusing Behavior permission items, and hard audience containment for Bots, Channels, Workspace roots, approvals and Bot–Bot DMs. Per-member Activity, push and Tob.
Normative decisions: ADR-0336. Design narrative and Q1–Q35 log: team-mode.md (中文). These docs are on branch claude/stoic-euler-25n60k and are not yet on main.
User Stories
- As a Host Owner, I want to turn on Team mode and set my password, so that others can use this Host as themselves.
- As a Host Owner, I want to create a member with a one-time password and an invitation link/QR, so that onboarding needs no email.
- As a Host Member, I want to open the Host's web page on the office LAN and sign in without installing anything, so that I can start immediately.
- As a Host Member, I want to be forced to change my initial password and later change it myself, so that only I know it.
- As a Host Member, I want to sign in from my phone and computer and pair another device from a signed-in session, so that I use the Host anywhere as myself.
- As a Host Member, I want to see only the Tobs Client, not DSH-native sessions or settings, so that other people's work is not exposed.
- As a Host Member, I want to create private Bots and have my own Tob, so that my work stays mine.
- As a Host Member, I want to browse public Channels and join explicitly, so that I choose what reaches my Activity.
- As a Host Member, I want to DM another Human, so that the team needs no separate IM for basic messages and files.
- As a Channel owner, I want to control who adds members, posts, @mentions all, adds Bots and edits details, so that I can run announcement or restricted groups.
- As a Host Owner, I want to restrict a Bot or Channel to specific roles, so that a finance Bot is unreachable by non-finance members.
- As a Host Owner, I want to define roles with permissions and natural-language Role Policy items, so that Bots behave appropriately per person.
- As a Host Member, I want to see approval requests in place but only decide those I may decide, so that approvals don't leak content.
- As a Host Member, I want a personal Workspace root, so that my Bots work on my files and no one else's Bot can be granted them.
- As a Host Owner, I want to view any private content with an audit trail and a member notice, so that oversight is accountable.
- As a Host Owner, I want to see usage per member and limit models per role, so that shared compute is understood.
- As a Host Owner, I want to reset passwords, revoke devices, deactivate, transfer and finally delete members, so that offboarding is safe.
- As a Host Owner, I want to turn Team mode off without losing data, so that the choice is reversible.
- As a headless operator, I want every member, role, Channel visibility, audit and Team mode operation in the
deepseekbotCLI with local--as <member>, so that verification needs no UI.
Implementation Decisions
Summarised from ADR-0336, which is normative:
- Model. Always multi-member;
local-humanis the Host Owner. Team mode is a policy switch, not a second code path. - Identity. The Host is the identity authority. Identity and Member Credentials are stored separately; local username/password (argon2id) first, OIDC later. No Better Auth session layer, no Connect dependency, no cross-Host directory sync.
- Grants. A device grant is (device, Host, Human ID); one active identity per Host per Client. Existing grants bind to the Owner when Team mode is enabled.
- Access. Local Desktop, loopback and CLI act as the Owner by default, with an option to require a password. Non-loopback password sign-in only over HTTPS or the encrypted gateway; plain HTTP refused unless the Owner enables a warned exception. The API Gateway denies DSH-native methods to members by default.
- Roles. A unique, transferable Owner. Host Roles over a fixed Host Permission catalog with union semantics; built-in Admin and Member. Role Policy reuses Behavior permission items (Allow/Deny, Deny wins) and is advisory, not access control. Private-content viewing is audited and disclosed to members.
- Audience containment. Bot visibility
private/roles/shared; Channel visibilitypublic/roles/privatewith Feishu-style Channel admin settings; Human–Human DM; personal and shared Workspace roots, refusing grants into other members' roots, any Memory repository or the Host data directory; Bot–Bot DMs readable only by the participating Bots' owners. - Approvals. Cards stay in place and are masked for non-approvers. Opaque-tool approval is limited to Owner/Admin; the dangerous preset is Owner-only.
- Per member. Activity, read state, push and Tob are per member; usage is attributed per member and Bot.
- Execution isolation (amended 2026-11-14, research PR docs(team): execution isolation research and settled Team mode scope (M12) #4182). DSH's sandbox restricts writes only, so a member Bot's Shell can read the whole Host. Team mode first opens as a light trial: one plain notice that member Bots can technically read other Bots' data on this Host, and no per-call Shell approval. M12 adds Linux execution confinement (a bwrap wrapper hiding
DSH_HOMEand other spaces, plus a network namespace) and is required before Team mode leaves the trial. macOS Team Hosts stay on the trial notice. - Spaces. A member's personal Workspace root is their account space. Shared roots are audience-scoped shared spaces (for example
shared/team,shared/finance). A shared Bot's Memory lives in its shared space, in abots/folder kept apart from the grantablefiles/folder. Highly sensitive data is best kept on a separate Host (documentation advice). - Lifecycle. Deactivate → transfer → separately confirmed purge. Disabling Team mode suspends members and keeps data.
- Relationships. Host Relationships and same-account enrollment stay Owner-scoped.
Testing Decisions
- A real Host with the Owner and two members. Prove both successes and refusals through the Client, the Gateway, the CLI with
--as, and Bot tool calls. - Cross-member isolation regressions: private Bot, private Channel, DMs, Bot–Bot DM, Workspace root, approval content, Activity and push.
- Existing single-Human behavior is unchanged while Team mode is off (the M0 gate).
- Security: brute-force limits, reset revokes grants, plain-HTTP refusal, invitation fingerprint mismatch, suspended member refused.
- Performance: before/after real journeys, at least three interleaved runs per side, for Activity and Channel listing.
Out of Scope
- Per-member OS accounts or containers; macOS and Windows execution confinement; microVMs. (Linux execution confinement is in scope as M12.)
- OIDC/SSO and a cross-Host directory.
- Quotas (including per-account CPU, memory or disk), and an "ask" Role Policy value.
- Per-object permission overwrites beyond visibility.
- A remote member CLI.
- Members inheriting Host Relationships.
- Merging or releasing as a consequence of publishing this specification.
Activity
docs: format Team mode design and handoff
docs: tighten Team mode containment, grant and approval wording
DoodleBears commentedon Nov 14, 2026
Amendment: Bot access model (Human decision, Vain, 2026-11-15)
Supersedes the "audience containment for Bots" parts of this spec and of M7. Bots are first-class participants like Humans, but every Bot acts for one principal (its creator, or the person who now owns it).
dm.humans(M13 Team mode M13: minimal default member role and Host-only Tob #4187). Creating Bots is split into two Host Permissions, both off for members by default: create private Bots and create public Bots.DoodleBears commentedon Nov 14, 2026
Product principle (Vain, 2026-11-15): one product, gated by permissions.
A member's experience is the same as the Owner's for most of the product. The Owner's extra power is deciding what each member can and cannot access — like the AWS console:
Consequences for the remaining slices:
DoodleBears commentedon Nov 14, 2026
Mental model (Vain, 2026-11-15): Team mode works like Slack. Joining a Host is joining a workspace. The Owner sets up Channels and who can see them, grants access to members, and people coordinate and manage work by messaging in Channels and DMs. Combined with the permission principle above: a workspace where everyone has the same app, and the Owner's role and permission settings decide what each person sees.