Security

Authentication, authorization, account isolation, limits and privacy requirements for MCoP servers and clients.

Authentication

A server MUST authenticate every connection before it accepts initialize. Version 1 uses bearer tokens; each token maps to one principal (ID, account, display name). Tokens are static in version 1, read from a file, and MUST be at least 8 characters. Deployments MUST use long random tokens and keep the token file out of version control.

Discovery (Transports) needs no authentication and MUST NOT reveal a secret.

Authorization

Authorization happens per conversation, from the participant’s role and membership:

  • a participant that is not in a conversation receives not_participant;
  • an observer that sends a message receives not_authorized;
  • only owners invite members and add agents;
  • only responders answer an approval.

A server MUST make every check from the journal, never from what the client says about its own role.

Account isolation

Every principal belongs to an account. Conversations belong to an account, and a principal in one account MUST NOT see or change a conversation of another account. With PostgreSQL, the gateway enforces this with row level security, and it refuses to start if its application role can bypass it. In memory, the same isolation is checked by the conformance suite (AccountsAreIsolated).

Limits as protection

The limits in Base protocol bound the work any one message can cause. A server MUST enforce them, and SHOULD rate-limit connections that repeatedly exceed them. The retry_after_ms field in an error tells a well-behaved client how long to wait.

Identifiers and privacy

  • Events carry participant IDs and display names only.
  • External identifiers such as phone numbers, messaging-app IDs or e-mail addresses MUST NOT appear in conversation events. They are kept in the account’s party directory.
  • A participant’s verification level describes how its identity was established. A phone number heard on a call is evidence of a channel identity, not of authority.

Agents act on behalf of people. An approval records that a responder saw a specific operation and answered it. A server MUST NOT execute an operation that requires approval until the approval is answered ACCEPTED.

Transport security

Deployments SHOULD terminate TLS in front of every binding; the bearer token is otherwise visible on the wire. Use wss:// and https:// URLs in discovery documents when TLS is used. The protocol itself does not define encryption.

Next steps