Docs

Team & admin

Policies

Every coordination policy rule, its default, and how org defaults and repo overrides combine.

9 min readUpdated

On this page

A policy decides how Comity coordinates your agents: whether intents are required, how serious each kind of conflict is, what blocks an edit, which paths are protected, and what gets posted to Slack. Defaults warn rather than block.

Policies are not where the team's agreements about the code live. "Postgres, not Mongo" or "never run prisma migrate reset" is a team decision: proposed by anyone (agents included), confirmed by a person, with its own reasons, owner and enforce rules (reserved paths, forbidden or required packages, forbidden commands) and its own mode (warn or block), independent of the severity map. Protected paths stay policy: who may edit a path at all. Both use the same override roles when they block.

Where policies live

  • Org default: applies to every repository.
  • Repo override (Team and up): rules set for one repository; everything else follows the org default.

The effective policy for a repo is Comity's defaults, overlaid with the org default, overlaid with the repo override. Objects merge key by key (for example severity); arrays and plain values replace.

Owners and admins edit policies in the dashboard under Settings → Coordination → Protected paths → Edit (pick the scope: Org default or a repository), or with the API. Everyone else sees the policy read-only (the button says View). Each save creates a new version and a policy.updated event in the audit log. Agents pick up a change on their next hook call.

Plans

Every plan has the org default policy. Some rules depend on the plan:

Rule Plan
Repo overrides Team and up
protected_paths (org default and repos) Team and up
cross_repo_contracts and projects Team and up
override.require_reason (audited overrides) Business and up

Below the plan, saving a new value returns 402 plan_required with plan and feature (repo_policies, protected_paths, cross_repo for creating a project or adding repos to one, or override_reasons), and the dashboard shows the plan's pill with Upgrade and keeps those controls read-only. What is already stored is kept and can be sent back unchanged (the dashboard does), and {"rules": {}} on a repo still removes its overrides. The effective policy leaves it out: repos follow the org default, there are no protected paths, no repo is matched across repos (every repo acts as cross_repo_contracts: off, projects included), and override reasons are optional. Upgrading applies the stored rules again.

With the API

Terminal
curl -s https://api.comity.so/v1/policies?repo=acme/api \
  -H "Authorization: Bearer $COMITY_TOKEN"
JSON
{
  "repo_name": "acme/api",
  "org": { "version": 3, "rules": { "require_intent": "auto", "ignore_paths": ["dist/**"] }, "updated_at": "2026-10-12T09:14:03.000Z", "updated_by": "0199…" },
  "repo": null,
  "effective": { "require_intent": "auto", "intent_ttl_hours": 24, "…": "…" }
}

PUT /v1/policies (org default) or PUT /v1/policies?repo=<owner/name> stores a new version for that scope. It needs an owner or admin with the policy:write scope (the dashboard has it; tokens from comity login don't).

Terminal
curl -s -X PUT https://api.comity.so/v1/policies \
  -H "Authorization: Bearer $COMITY_TOKEN" -H "Content-Type: application/json" \
  -d '{"rules": {"require_intent": "auto", "ignore_paths": ["dist/**", "**/*.lock"], "severity": {"path_overlap": "warn"}}}'

Warning

The rules you PUT become the whole stored rule set for that scope; they are not merged with the previous version. Send every rule you want to keep overriding. {"rules": {}} on a repo removes all its overrides. The dashboard re-reads the stored rules and sends only your edits merged into them.

Comity stores exactly the rules you send. A repo override of require_intent stores only require_intent, so the repo keeps following the org default for everything else, including later changes to fail_mode and protected_paths. Objects such as severity merge key by key; arrays replace the org's, except protected_paths, which adds to it. The merged result is validated; an invalid value returns 400 validation with the failing field.

The PUT response is the GET response plus warnings: a list of messages, one per repo protected path that changes an org protected path with the same glob. It's empty when nothing is shadowed.

Note

Before October 19, 2026, saving a repo override stored every rule with its default value filled in, so the repo stopped following the org default for all rules, not just the ones you changed. Those stored versions are kept as they are, because Comity can't tell which values you chose. In Settings → Coordination → Protected paths → Edit, such a repository shows Repo override on every rule. To fix it, click Remove repo overrides, then set again the rules that should differ from the org default.

Rules

require_intent

"off" | "auto" | "required". Default "auto".

  • auto: the first prompt of a session auto-drafts a private intent (titled from the prompt's first line). Plans become the intent's plan. The agent confirms it with intent_declare, keeping its number.
  • required: like auto, and an edit (pre_edit) by a session without a declared intent is blocked with: "This repository's policy requires a declared intent before editing. Declare one with the intent_declare MCP tool, then retry."
  • off: no auto-drafts.

intent_ttl_hours

Integer > 0. Default 24. A draft, active or blocked intent with no activity for this long, and no active session working on it, becomes expired.

session_idle_minutes

Integer > 0. Default 30. A session with a hook event within this window is active; quieter sessions are idle. MCP tools without session_id act as this MCP client's one live session within this window (never a guess among several). An intent whose agent sessions all went away this long ago is stale: briefings say "no agent active for N min", and it opens no new conflicts (its existing ones stay) until an agent picks it up again or it expires after intent_ttl_hours.

ended_intent_grace_minutes

Integer ≥ 0. Default 2. An intent whose agent sessions ended (the agent exited, its session expired, or a new agent started in the same checkout replaced it) and that has nothing on a branch — not in_review, no commit of its own, no pushed branch the GitHub App tracks — stops opening new conflicts this many minutes after its last agent activity, instead of after session_idle_minutes. Its existing conflicts stay. An agent that was killed without exiting still counts as live until session_idle_minutes, unless you start a new agent in the same checkout and branch.

severity

Severity per conflict kind: "info" | "warn" | "block".

Kind Default
path_overlap info
symbol_overlap warn
contract_break warn
textual_merge warn
duplicate_work warn
dependency_order warn
protected_path block

textual_merge and duplicate_work are accepted but no detector produces them today. See Conflicts.

block_contract_break_when_criticality

Array of "low" | "normal" | "high" | "frozen". Default ["high", "frozen"]. A contract break escalates to a block only when the contract's criticality is in this list.

block_min_confidence

Number 0–1. Default 0.85. A finding needs at least this confidence to block; below it, it is downgraded to a warning.

exclusive_max_files

Integer > 0. Default 50. An exclusive path claim (intent mode: "exclusive") only blocks others when it covers at most this many files; a broader claim is treated as shared.

protected_paths

Array of { glob, owners, fail_closed }. Default []. Team and up (see Plans).

Field Type Default Notes
glob string Required. Repo-relative glob, e.g. db/migrations/**.
owners string[] [] user:<email>. Other prefixes (such as team:) are rejected with a 400.
fail_closed boolean false While Comity is unreachable, the CLI blocks edits under this glob by anyone except its owners, even when fail_mode is open. See Fail-closed.

An edit under a protected path produces a protected_path conflict (severity block by default).

JSON
{ "protected_paths": [{ "glob": "db/migrations/**", "owners": ["user:diego@acme.com"] }] }

A repo's protected_paths add to the org's: the repo is protected by every org rule plus its own. A repo rule with the same glob as an org rule replaces that rule's owners and fail_closed for this repo, and the PUT returns a warning saying so. A repo override can't remove an org protected path. To exempt one repo, change the org rule (for example, make its glob narrower) and add the rule back to the other repos.

In Settings → Coordination → Protected paths → Edit, a repo scope shows the org's protected paths as read-only rows above the repo's own.

exclusive_by_default

Array of globs. Default []. Paths matching these are treated as exclusively claimed by whoever edits them first.

ignore_paths

Array of globs. Default []. Ignored by every detector: generated files, lockfiles, build output.

override

Field Default Notes
override.allowed_roles ["owner", "admin"] Roles that may override a conflict. Any of owner, admin, member, viewer, billing.
override.require_reason true When true, an override needs a reason of 3–2,000 characters (after trimming). When false, the reason is optional. Business and up: on Free and Team reasons are always optional and the effective value is false (see Plans).

notify

Slack notifications. See Integrations → Slack.

Field Default Notes
notify.slack_events ["conflict.detected:block", "hook.blocked", "work_request.sent", "autopilot.summary"] <event type> or <event type>:<info|warn|block>; a severity suffix matches that severity and above.
notify.slack_min_severity "warn" Events that carry a severity are only posted at or above this.

fail_mode

"open" | "closed". Default "open". What hooks do when Comity can't be reached (network error, no answer within 400 ms, or a 5xx error):

  • open: the agent proceeds; the CLI logs the failure. See How it works → Fail-open.
  • closed: the CLI (0.5.2 or later) blocks the agent's edits and shell commands that may write in this repo until Comity answers again; reads continue. The hook learns the setting from Comity's answers and caches it on each machine for up to 7 days, so it applies on machines whose agents have reached Comity since you changed it. A developer can override it in an emergency with comity fail-open, which is reported in the audit log. Suspended orgs always fail open. See How it works → Fail-closed.

briefing_max_tokens

Integer 200–4,000. Default 1500. Size budget of a briefing (about 4 characters per token).

share_session_status

Boolean. Default true. Teammates see each session's latest status (an excerpt of the agent's last message at the end of a turn, plus files touched) in briefings and search. Individual developers can also opt out with COMITY_SHARE_STATUS=0.

cross_repo_contracts

"org" | "projects" | "off". Default "org". Which other repos this repo's contracts (HTTP routes, workspace packages) are matched against:

  • org: every repo in the org whose policy is also org, plus repos in a shared project.
  • projects: only repos that share a project.
  • off: none.

Both repos of a pair must allow it.

Team and up: on Free no contracts are matched across repos, and projects are kept but not used (see Plans).

arrival_notices

Boolean. Default true. When another developer's agent starts a session in this repo, teammates' agents with a live session here get a one-time notice. See Messaging.

Full default policy

JSON
{
  "require_intent": "auto",
  "intent_ttl_hours": 24,
  "session_idle_minutes": 30,
  "severity": {
    "path_overlap": "info",
    "symbol_overlap": "warn",
    "contract_break": "warn",
    "textual_merge": "warn",
    "duplicate_work": "warn",
    "dependency_order": "warn",
    "protected_path": "block"
  },
  "block_contract_break_when_criticality": ["high", "frozen"],
  "block_min_confidence": 0.85,
  "exclusive_max_files": 50,
  "protected_paths": [],
  "exclusive_by_default": [],
  "ignore_paths": [],
  "override": { "allowed_roles": ["owner", "admin"], "require_reason": true },
  "notify": { "slack_events": ["conflict.detected:block", "hook.blocked", "work_request.sent", "autopilot.summary"], "slack_min_severity": "warn" },
  "fail_mode": "open",
  "briefing_max_tokens": 1500,
  "share_session_status": true,
  "cross_repo_contracts": "org",
  "arrival_notices": true
}

Try Comity now.

Start free →

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