# Autopilot

> While you're away, teammates' work requests are accepted without asking you and your open agent session does the work. Paid plans (Team and up).

Autopilot keeps your agent working for the team while you're away. A trusted teammate's [work request](/docs/collaboration/shared-tasks#asking-a-teammate-work-requests) is accepted at once, without the usual approval prompt, and your **open agent session** starts on it: same chat, same repo, your normal setup and permissions. When it finishes, it waits for the next one. When you're back, it tells you what it did.

There is no extra program and no background agent. Autopilot uses the session you already have open: when the agent finishes a turn, Comity's Stop hook doesn't let it go idle. It waits for team work with no model running (zero tokens), and when work arrives the same chat continues with it.

Autopilot is part of the paid plans: **Team, Business and Enterprise**. On Free, `comity autopilot on` and the dashboard show an upgrade notice; owners upgrade in **Plan & billing** in the dashboard's sidebar (see [Billing](/docs/admin/billing)).

## Turning it on

The first time, Comity shows a warning and asks you to type `yes`:

```text
Autopilot lets teammates give your agent work while you're away.
Their work requests are accepted without asking you, and your open agent session starts on them with your
normal setup and permissions: it edits, runs commands, commits and pushes like you told it to.
What it does is your responsibility. Turn it off any time: `comity autopilot off`, the dashboard, or Esc in the agent.
```

You answer once; later you turn it on and off without the warning. Where:

| Where | How |
|---|---|
| Terminal | `comity autopilot on`: the warning, type `yes`. Scripts pass `--confirm yes`. |
| Claude Code | `/autopilot` in the chat shows the warning; `/autopilot yes` turns it on. The command comes with `comity init` (`.claude/commands/autopilot.md`). |
| omp | `/autopilot` (the Comity bridge registers it). |
| Codex | From a terminal (`comity autopilot on`), or ask the agent to run it. Codex has no project slash commands. |
| Dashboard | **Settings → Autopilot**: turn on the **Autopilot** switch, read the warning, type `yes`. **Configure** next to it opens the rest of the settings. |

Then leave your agent session open. After its current turn it shows **Autopilot: waiting for team work (Esc to stop)** and waits.

Autopilot is per organization: turning it on in one org doesn't turn it on in another. Viewers and billing contacts can't use it (they can't take work).

## Who can give your agent work

By default, **everyone in your org, including people who join later**. When someone joins while autopilot is on for everyone, you get one message in your agent so it's never silent: "Priya joined acme; autopilot includes them. Change: `comity autopilot people`."

To trust only some people:

```bash
comity autopilot people              # pick: "Everyone in acme (including people who join later)" or "Choose people…"
comity autopilot people --only mike,priya
comity autopilot people --everyone
```

or **Settings → Autopilot → Configure → Who can give your agent work while you're away?** in the dashboard. Requests from anyone else still wait for your yes, as usual.

By default autopilot takes work in every repository of the org. `comity autopilot on --repo` limits it to the repository you're in; the dashboard picks any set of repositories. A request whose tasks are in a repository autopilot doesn't cover waits for your yes. Tasks of a list without a repository are covered only when autopilot covers every repository.

## How it works

1. A trusted teammate's agent sends you a work request ("ask Tyler to take T-4").
2. Comity accepts it on your behalf: the request is **accepted by autopilot** (in the dashboard, the feed and the request's note), its tasks are queued for you, and the sender's agent is told: "Tyler's autopilot accepted WR-3: their agent starts on it now (they're away, so it's done without them)."
3. Your waiting session gets the work. Its Stop hook returns it to the agent as the next thing to do, so the same chat continues: the task, who sent it, their message, and the rules ("your user is away: don't ask them questions; if you're blocked, `task_release` with what you tried"). The agent claims the task, works on it like any [shared task](/docs/collaboration/shared-tasks), commits and calls `task_done`.
4. It ends its turn and waits again for the next task.

One task at a time: the session works through the queue in order. A task already queued for you (accepted earlier, or assigned to you) is picked up the same way, in the session's repository. Requests that were waiting for your answer when you turned autopilot on (up to 7 days old) are accepted too, if the sender is trusted.

While it waits, the session counts as live, so the claims it holds are kept, and the dashboard shows it as "Autopilot: waiting for team work" (**Settings → Autopilot → Configure**). Long sessions grow their context: the agent compacts it itself (Claude Code's auto-compact, Codex's and omp's equivalents), as in any long session.

## When you're back

At your next prompt in that session, the agent shows you first what happened while you were away:

```text
While you were away your agent did T-4 Search for Mike Bot (done, feat/search @ab12cd3) and started T-5 Emails (3/7 steps). Autopilot accepted WR-3, WR-4. 41 min of agent time.
```

The same summary appears in the dashboard feed and, when your org's Slack integration includes **Autopilot → While you were away** (on by default), as one channel post. If the agent did nothing, there's no summary.

## Summary when you're back

Separate from autopilot and on every plan: switch on **Settings → Autopilot → Summary when you're back** (or `PATCH /v1/me/autopilot {"away_summary": true}`). It's yours alone and off by default.

When you've had no agent session in the org for **8 hours** (none started, none active), the first briefing of your next new session opens with what happened in your repos meanwhile, and the agent tells you before anything else:

```text
You were away for 14 hours. Meanwhile in your repos:
- Landed: 2
  - INT-41 Search API (alice)
  - INT-44 Billing webhooks (dan)
- Conflicts involving your work: 1
  - CF-12 src/cart.ts
- Team decisions recorded: 1 (D-7); `decision_list` has them.
- Messages waiting for you: 3
```

"Your repos" are the repositories you ran agent sessions in during the 30 days before you left. Landed intents are anyone's that merged there; conflicts are new ones involving your intents; decisions are new proposed or active ones, org-wide or in those repos; messages are your unread ones. With nothing to report it says so in one line. It appears once per absence: the session's later prompts, and sessions you start at the same time, don't repeat it. 8 hours is fixed, so a lunch break doesn't trigger it but a night away does.

## Turning it off

Any of these:

- `comity autopilot off` in a terminal,
- the switch in the dashboard (it shows the summary right away),
- `/autopilot off` in Claude Code or omp,
- **Esc** in Claude Code or Codex while it waits or works, then type your next prompt: that prompt means you're back, so autopilot goes off and the agent shows the summary first,
- in omp, typing a prompt yourself in the session autopilot was driving: that means you're back too.

Coming back turns autopilot off for your account, not just that session. `/autopilot …` commands never count as coming back.

When the org leaves the paid plans, autopilot turns off for everyone.

## Limits by agent

| Agent | How it waits | Limits |
|---|---|---|
| Claude Code | A separate Comity `Stop` hook with a 24-hour timeout. | About once a day, with no work, it re-arms with a one-line "still waiting" turn (one short model turn). Claude Code allows only 8 Stop-hook continuations in a row with no tool call in between, so after about 8 idle days the session stops waiting; any real work resets the count. Autopilot stays on: type `/autopilot` in that session and it waits again when the turn ends. |
| Codex | The same `Stop` hook in `.codex/hooks.json`, 24-hour timeout. | The same daily re-arm. Codex documents no continuation cap. |
| omp | The Comity bridge waits in the background; the session stays usable. | No time limit. The footer shows "Autopilot: waiting for team work". |

Autopilot runs in Claude Code, Codex and omp. In other agents, requests to you stay requests: they wait for your yes.

A session that's closed doesn't wait. Accepted tasks stay queued for you and the next session that waits (or that you start) picks them up.

## Your responsibility

Autopilot does exactly what a request asks, with your agent's permissions, without you watching. What it does is your responsibility, as if you'd typed the prompt. Trust only people whose requests you'd accept anyway, keep it to the repositories you mean, and turn it off when you're back.

## Reference

**CLI** ([`comity autopilot`](/docs/reference/cli#comity-autopilot)):

| Command | What it does |
|---|---|
| `comity autopilot` / `comity autopilot status [--json]` | On or off, who and which repositories, and the sessions waiting now. |
| `comity autopilot on [--repo] [--confirm yes]` | Turn on (warning and `yes` the first time). `--repo`: only this repository. |
| `comity autopilot off` | Turn off; prints the summary. |
| `comity autopilot people [--everyone \| --only <a,b>]` | Who can give your agent work. Without flags, a picker. |

**REST** ([REST API → Autopilot](/docs/reference/rest-api#autopilot)): `GET /v1/me/autopilot`, `PATCH /v1/me/autopilot` (`{enabled?, acknowledge?, trust?, people?, repos?, via?, away_summary?}`) and `POST /v1/autopilot/wait` (the waiting hook's long poll).

**Events**: `autopilot.updated` (on, off, who or repositories changed; payload `{user, enabled, trust, repos, via}`) and `autopilot.summary` (payload `{user, since, until, minutes, tasks, requests, text}`) go to [webhooks](/docs/admin/integrations), the live stream and the audit log (**Settings → Security → Audit log → Open → Autopilot**). `work_request.sent` and `work_request.accepted` carry `autopilot: true` when autopilot accepted the request.

**Hooks** ([Hook events](/docs/reference/hook-events#autopilot)): the hook request carries `autopilot_back: "esc" | "prompt"` when you come back, and the response `autopilot: {enabled, summary?}`.
