Docs

Team & admin

Security & data

What the CLI sends, what Comity stores, data modes, encryption, tokens, fail-open and fail-closed behavior.

11 min readUpdated

On this page

This page summarizes how Comity handles your data, from an engineer's point of view. The full statements are on the Security and Privacy pages.

What the CLI sends

Code analysis runs on your machine. On each agent event the hook sends:

Event Sent
Every event Repo remote fingerprints (e.g. github.com/acme/api) and, for a young history or a repo without a remote, the id of its first commit (root:<sha>; a repo without a remote also sends its folder name, never the path), branch, HEAD and merge-base SHAs, the agent tool and model, CLI version, OS, a hash of your machine id, an HMAC of the worktree path, the launch folder relative to the repo root
Session start Workspace package names and their folders (from package.json/pyproject manifests, up to 200)
Prompt The first 2,000 characters of the prompt (used to auto-draft the intent title and summary)
Plan The plan text, when the host reports one
Before/after an edit Repo-relative paths; after the edit, the local analysis: per file status and line counts, changed symbols (key, kind, change type, exported, signature hashes, compatibility), new references to contracts, and, in full data mode, normalized signature text
Shell command The command (up to 4,000 characters) and the paths it changed
End of turn An excerpt of the agent's last message (up to 500 characters) and the files touched, unless status sharing is off

The CLI never sends file contents or diffs. Raw local paths never leave the machine (only the hash and HMAC above). Turn off end-of-turn statuses per machine with COMITY_SHARE_STATUS=0, or org-wide with the share_session_status policy.

Agents also send what they write through the MCP tools: intents, messages, questions and answers, and context packs at handoffs and task releases.

Context packs

A context pack is a short, structured summary of an agent session (summary, decisions, files read or changed, commands and whether they passed, open questions, next steps, links), sent when work changes hands. It is never the transcript. The agent writes it through MCP; comity handoff builds it on your machine from the session transcript, keeping only file paths with their action and command lines with pass/fail (never messages, command output or file contents), and sends only that. Both the CLI and the server redact secrets, credential-looking values (secret-named variables, auth headers, credentials in URLs) and home folders, cap each field, and trim the whole pack to 6,000 characters. Packs are encrypted like other customer text, kept 90 days, then deleted. Events say only that a pack was sent (context: true), never its text.

Data modes

Each org has a data mode, shown as the Metadata only switch in Settings → Coordination. Owners change it there (or with PATCH /v1/org, see below). metadata_only is part of Business and up; full is available on every plan.

full (default) metadata_only
Normalized signature text of changed symbols sent by the CLI and stored not sent and never stored; only signature hashes
Stored contract signatures text and hash hash only
GitHub App sync reads changed files from GitHub and analyzes them in memory; stores symbols and contracts records only changed paths and line counts; no file contents fetched
Paths, symbol keys, compatibility, conflicts stored stored
Prompt excerpts, plans, statuses, messages stored (encrypted) stored (encrypted)
Intent titles in the GitHub comity/coordination check shown (secrets redacted) not shown: the intent's ref and status only
Context packs stored (encrypted) only the file list (paths and actions) is kept; free text (summary, decisions, file notes, commands, questions, next steps, links) is dropped by the server and never sent by the CLI

Conflict detection works in both modes: compatibility is computed on your machine and signature hashes are enough to detect a changed signature. In full mode, briefings and contract_lookup can show the old and new signature.

Changing the data mode

Owners turn Metadata only on or off in Settings → Coordination (turning it on asks for confirmation). Through the API, an owner's personal token with policy:write (or the dashboard session) sends:

Terminal
curl -X PATCH https://api.comity.so/v1/org \
  -H "Authorization: Bearer $COMITY_TOKEN" -H "Content-Type: application/json" \
  -d '{"data_mode": "metadata_only"}'

The response is {org: {id, slug, name, data_mode, auto_register_repos}, previous_data_mode, cleared_signatures}. Admins and other roles get 403 for data_mode. On Free and Team, turning metadata_only on returns 402 plan_required ({"plan": "business", "feature": "metadata_only"}) and the switch shows a Business pill with Upgrade. Each change is recorded as an org.data_mode_changed event ({from, to, cleared_signatures}) in the audit log.

An org that is on metadata_only stays on it after a downgrade: Comity never lowers your privacy setting by itself. An owner can still switch back to full; turning metadata_only on again then needs Business.

  • Switching to metadata_only applies at once on the server: signature text already stored for the org (contract signatures and changed-symbol signatures) is cleared, and any signature text a CLI still sends is dropped. Hashes are kept, so detection keeps working.
  • Switching to full stores signature text again from the next edits on.
  • Members' CLIs follow the switch from their next hook call: every hook response carries the org's current mode, and the CLI stores it over the one it read at comity login (comity doctor and comity status refresh it too). No new login is needed.

Self-hosted operators can also run admin set-data-mode --org <slug> --mode full|metadata_only.

The same endpoint takes {"auto_register_repos": false} from owners and admins (Settings → Data → New repositories): hooks then no longer add unknown repos to the org unless the repo's comity.json names it. Changes are recorded as org.settings_changed ({setting, from, to}).

Encryption and isolation

  • Customer text (intent summaries and plans, messages, thread subjects, status excerpts, context packs, questions and answers, override reasons, Slack and webhook settings, GitHub App secrets and the GitHub webhook inbox, Notion OAuth tokens) is encrypted with AES-256-GCM under a data key unique to your org, wrapped by a master key that is not stored in the database.
  • Notion: Comity stores the titles and bodies of the to-dos or rows that become tasks (bodies encrypted), the Notion ids and links, the workspace name and icon, and the OAuth tokens (encrypted). Disconnecting revokes the token at Notion. See Integrations → Notion.
  • Identifiers Comity must search and compare (repo names, branches, paths, symbol keys, signature hashes, intent titles, shared task and task list titles, conflict explanations, the event log) are not encrypted at the application level.
  • Every request runs in a database transaction scoped to your org under PostgreSQL row-level security.

Sign-in and single sign-on

People sign in to the dashboard with email and password, GitHub, or, on Business and Enterprise, your identity provider through OpenID Connect (Okta, Microsoft Entra ID, Google Workspace, Auth0 and others). Owners can require SSO for members on the org's verified email domains; owners keep password and GitHub login as an audited break-glass. See Single sign-on.

Browser sign-in is hardened against bots and against links someone else sends you:

  • Bot checks: the sign-up, password-reset and demo-request forms on comity.so run Cloudflare Turnstile, which stays invisible unless Cloudflare wants a click. The log-in form adds it after 3 failed attempts for an email address or 10 from one network in 15 minutes. Only those four pages may load Cloudflare's challenge script (their Content-Security-Policy allows challenges.cloudflare.com; no other page does).
  • Verification links: a link from the verification email signs you in only in the browser you signed up in. Opened anywhere else, it verifies the address and sends you to log in, so a verification link someone else sends you can't sign you in to their account.
  • CLI approvals: comity.so/cli never takes the code from the link. You type the code your terminal shows, then the page shows the device name, when the login started and the IP address it came from, with a warning to deny it unless you started it. Deny any code someone else gave you.
  • Redirects after sign-in: ?next= only ever leads to a page on comity.so.
  • Password changes: resetting or changing your password signs out your other browsers, revokes your personal API tokens and CLI logins (run comity login again on each machine), and emails you a notice.

Tokens

  • Tokens look like cmt_ + 43 characters and are stored only as SHA-256 hashes.
  • comity login creates a personal token per machine, named cli · <hostname>, stored in your user config file with owner-only permissions (on Windows in %LOCALAPPDATA%, which a roaming profile does not sync). comity init never writes a token into the repo. Logging in again revokes the machine's previous cli · … token for that org, and comity logout revokes it (if the server can't be reached, revoke it on the Team tab). These tokens expire after 90 days (run comity login again), and you get an email each time one is created.
  • The CLI never sends a token to a server only because a repo's comity.json names it: COMITY_TOKEN goes there only if it is COMITY_SERVER, the hosted cloud or a server you have logged in to, and comity login asks before using such a server. Plain http:// servers are refused except on localhost. Self-hosted updates are installed only when the downloaded tarball matches the sha256 in the server's release manifest.
  • Personal tokens act as their user, with that user's role. They stop working when the user leaves the org. Service tokens (for CI or bots) have no user, can't call hooks or MCP, and are never billed.
  • Owners and admins create tokens on the Team tab (Tokens → Create token): a service token or a personal token for themselves, a scope preset, and an optional expiry (30 days, 90 days or 1 year). The token is shown once, with a usage snippet. API: POST /v1/tokens (needs tokens:write).
  • Revoke tokens on the Team tab or with DELETE /v1/tokens/:id. Removing a member revokes their tokens. Resetting or changing your password revokes your personal and CLI tokens in every org.
  • Dashboard sessions use the __Host-comity_session cookie: HttpOnly, Secure, SameSite=Lax and bound to api.comity.so only, so no other subdomain can set or read it. Passwords are hashed with Argon2id (OWASP parameters), and sign-in rate limits are kept in the database, per address (IPv6 by /64, IPv4 also by /24).
Scope Allows
hooks:evaluate Agent hooks (/v1/hooks/evaluate)
mcp:tools The MCP server
intents:read / intents:write Intents, sessions, presence, team context, scope checks
conflicts:read / conflicts:write Conflicts and actions
messages:read / messages:write Messages, conversations, questions
repos:read / repos:write Repos and projects
members:read / members:write Members, invites, usage
tokens:write Creating tokens
policy:read / policy:write Policies
events:read Events, feed, stats, the SSE stream
snapshots:write Reserved

Tokens from comity login get every scope except repos:write, members:write, tokens:write, policy:write and snapshots:write. To call admin endpoints from scripts, create a token on the Team tab or use the dashboard.

Dashboard scope presets:

Preset Scopes Token types
CI / GitHub Actions repos:read, intents:read, conflicts:read, events:read service or personal
Full agent the comity login scopes (above) personal only

Text from teammates

Agents read text written by other people's agents. Comity marks it as peer text (⟦peer:…⟧ … ⟦/peer:…⟧) and its MCP instructions tell agents to treat it as data, never as instructions. Status excerpts, prompt excerpts and plans (before an intent title, summary or plan is drafted from them) and replies from Ask my agent copies are scanned for common secret formats (private keys, Comity, GitHub, AWS, Slack and Stripe-style keys, JWTs, token=-style values, values of variables named like *_KEY or *_SECRET) and redacted ([redacted:<kind>]) before storage.

Fail-open

If Comity is unreachable, slow (more than 400 ms before an edit or shell command, 1.5 s for other events), or answers with something unexpected, the hook allows the action and writes one line to hook.log in the CLI config folder. Blocking happens only when Comity answers with a block under your policy, or in a fail-closed repo (next section).

Fail-closed

A repo with policy fail_mode: "closed" requires Comity. While Comity is unreachable (network error, no answer within 400 ms, or a 5xx error), the CLI (0.5.2 or later) denies the agent's edits and shell commands that may write in that repo, with a reason the agent and you can read; reads and plainly read-only commands still run. Protected paths with fail_closed do the same for their globs. The hook knows the policy from Comity's last answer, cached on the machine for up to 7 days; with nothing cached it fails open. Auth errors (401, 403) are not outages and keep failing open, and so do suspended orgs. Agents whose hooks can't block (Cline on Windows, Kiro under Windows PowerShell 5.1, MCP-only clients) stay fail-open.

In an emergency a developer can run comity fail-open in their terminal (or set COMITY_FAIL_OPEN=1) to let edits through during the outage; every use is reported to the org as a hook.fail_open audit event once Comity answers again. Enforcement runs in the CLI on developers' machines: it keeps agents from editing without coordination, but a developer who modifies their CLI can bypass it. Details: How it works → Fail-closed.

Audit log

Comity records an event per org for hook blocks and warnings, fail-open overrides used during an outage (hook.fail_open, reported when Comity is back), conflicts (detected, acknowledged, resolved, overridden with the encrypted reason), intents, sessions, messages (without text), policy changes, members, invites, tokens, integrations and billing. Allowed hook calls are not logged as events. Browse them in Settings → Security → Audit log → Open, page through GET /v1/events, or stream with GET /v1/stream, on every plan. Events are kept indefinitely.

CSV export (Business and up): Download CSV next to Open downloads the newest 10,000 events, and Export CSV in the log downloads the events of the chosen type. Both call GET /v1/events.csv (optional ?type=a,b, any role with events:read), which answers comity-audit-<slug>-<date>.csv with the columns id, occurred_at, type, actor, actor_kind, actor_id, subject_kind, subject_id, repo, payload, newest first. On Free and Team it returns 402 plan_required ({"plan": "business", "feature": "audit_export"}) and the dashboard shows a Business pill with Upgrade instead of the buttons.

Audited overrides (Business and up): the policy's override.require_reason makes every override carry a reason, stored encrypted with the conflict and shown in the audit log. On Free and Team a reason is optional.

Try Comity now.

Start free →

npm i -g comity-cli && comity login && comity init