ADR 0038: Antigravity CLI and GitHub Copilot CLI
Status: Accepted (2026-10-23), D1–D4 approved by Vincent (D1 without Gemini CLI, D3 and D4 after check (a)). Ships after 0.4.8, before the external test.
Source: product request by Vincent (2026-10-23), relayed by the internal session. Gemini CLI stopped serving individual accounts on 2026-06-18 (“migrate to the Antigravity suite”); it still serves Gemini API and enterprise keys.
Facts are from the official docs, read on 2026-10-23: antigravity.google/docs/cli/headless, /docs/mcp?tab=cli, /docs/cli/gcli-migration, github.com/google-antigravity/antigravity-cli; docs.github.com/en/copilot/reference/copilot-cli-reference/ (cli-programmatic-reference, cli-config-dir-reference), /how-tos/copilot-cli/customize-copilot/add-mcp-servers, github.com/github/copilot-cli. Nothing was run: what the docs leave open is listed under “Checked on a real run”.
Context
Section titled “Context”wats runs an agent headless, one prompt per run, with a per-run MCP config
holding the wats server and its runner token, and the same three access
levels for every runtime (ADR 0011): swarm-only (the wats tools only),
workspace (confined to its directory), inherit (the user’s own
environment, only with agent.review or agent.allow). A runtime that
cannot be confined gets fewer levels, as Mistral Vibe (ADR 0033).
Antigravity CLI (agy) |
Copilot CLI (copilot) |
|
|---|---|---|
| Source | closed (public repo, no license stated) | public repo, no license stated |
| Headless | agy -p, --output-format stream-json (tool steps, usage) |
copilot -p, --output-format json (JSONL; events not documented), -s |
| MCP config | ~/.gemini/config/mcp_config.json, project .agents/mcp_config.json |
~/.copilot/mcp-config.json, project .mcp.json, .github/mcp.json (skipped in -p unless trusted) |
| Per-run isolation | no flag nor variable documented | COPILOT_HOME moves the whole config dir |
| Tools | permissions.allow in settings.json; workspace reads and writes auto-allowed; shell soft-denied headless; --sandbox |
--available-tools, --excluded-tools, --allow-tool, --deny-tool, path checks to cwd plus --add-dir |
| Auth | interactive login, tokens in the OS keyring | COPILOT_GITHUB_TOKEN (fine-grained PAT), or /login stored under COPILOT_HOME |
| Usage per run | tokens (input, output, thinking, cache), no dollars | none documented; one premium request per prompt |
| Sessions | --continue, --conversation; persistence not documented |
COPILOT_HOME/session-state/, --continue, --resume |
| Turns, model | no max-turns; --model, --effort |
no max-turns; --model |
Servers wats share can read |
yes: mcpServers, serverUrl or url |
yes: mcpServers, as Claude Code’s |
Decision
Section titled “Decision”1. GitHub Copilot CLI: a full runtime and an MCP host
Section titled “1. GitHub Copilot CLI: a full runtime and an MCP host”Checked on v1.0.103 (check (a) and copilot --help):
-
the stored login survives a fresh
COPILOT_HOMEwithout a prompt; -
the JSONL ends with
result(exitCode,usage.premiumRequests), andsession.usage_checkpointcarriestotalNanoAiu(AI credits); -
the builtin
github-mcp-serverloads even in a fresh home. -
MCP host:
wats setup copilot --mcpaddswatsto~/.copilot/mcp-config.json, a JSON edit after a backup. -
Agent runs:
copilot -p <prompt> --output-format json -s --no-ask-user.- Isolation:
COPILOT_HOME=<agent dir>/copilot-home, whosemcp-config.jsonholds onlywatswith the run’s token (0600), plus--disable-builtin-mcps. - Project servers stay off:
-pskips them unless the folder is trusted, and wats never trusts it. - Auth: the stored login, else
COPILOT_GITHUB_TOKENin the node’s environment (D3).
- Isolation:
-
swarm-only is the default:
--available-tools wats(Copilot names MCP tools<server>(tool)). -
workspace: the run starts in the workspace, with no
--add-dir.--available-toolsadds the tools ofagent.toolsand the lent servers.- The shell (
shell(cmd:*)) stays off unless listed.
-
inherit: the user’s
~/.copilot, withwatsadded through--additional-mcp-config. It needsagent.revieworagent.allow. -
Budgets (D4):
--max-ai-creditsper run, from what is left of a newagent.max_ai_credits_per_day, and every run counts as one premium request against the runs per day. There are no dollars and no tokens. -
Model:
--model,--max-autopilot-continuesas the turn limit.data.viatakes the model and effort fromuser.message. -
wats sharereads~/.copilot/mcp-config.json. -
Sessions in the isolated home are pruned with the run’s transcripts.
2. Antigravity CLI: an MCP host, then a swarm-only agent runtime
Section titled “2. Antigravity CLI: an MCP host, then a swarm-only agent runtime”wats setup antigravity --mcp adds wats to
~/.gemini/config/mcp_config.json.
As an agent, check (b) on Antigravity CLI 1.4.6 settled the open points.
The login does not survive a fresh HOME: with the keychain refused, the
OAuth token goes to $HOME/.gemini/antigravity-cli/antigravity-oauth-token.
Without a TTY it prints JSONL: init (cwd, tools, permission mode),
step_update (step type, text, usage), and result (status, response,
turns, usage in input, output, thinking and cache tokens). Its default
tools are broad: commands, file edits, the browser and its JavaScript,
call_mcp_tool, image generation, the web, subagents, messages and
schedules.
- A persistent home per agent:
<data dir>/agent/<name>/home,0700.- Its
.gemini/config/mcp_config.jsonholds onlywatswith the run’s token, rewritten0600at each run. - Its
.gemini/antigravity-cli/settings.jsonholds the agent’spermissionsrules (§2.1). - Its
.gemini/config/hooks.jsonholds the gate (§2.1). agy1.4.6 has no login command: the OAuth comes with the first prompt (a URL, then a pasted code).wats setup antigravity --agentruns one short prompt there on a terminal, and the token stays in the keychain or in that home’s token file (0600).- The docs say plainly that this file is a Google OAuth token whose
scopes include
cloud-platform. They also say that deleting the agent directory revokes the login on this machine.
- Its
2.1 Two locks: the permission rules and the gate
Section titled “2.1 Two locks: the permission rules and the gate”- Permission rules (settings.json
permissions, precedence Deny > Ask > Allow). At swarm-only:- denied:
read_file(*),write_file(*),command(*),read_url(*)andexecute_url(*); - allowed:
mcp(wats/*). Nomcp(*)deny: it would beat that allow, and the run’s MCP config holds onlywatsanyway.
- denied:
- The gate, a
PreToolUsehook with matcher*runningwats hook antigravity. The rules do not cover the browser, subagents, messages, schedules or images, so the gate answers"deny"(a hard block) for every tool its level does not allow,"allow"for thewatsMCP tools, and atworkspacefor the lent ones and file tools on paths inside the workspace. - No ancestor config: the run starts in its own directory inside the
data directory. wats checks before each run that no
.agents/directory lies along its ancestors.
2.2 Levels
Section titled “2.2 Levels”- swarm-only: the default. It is §2.1, nothing else.
- workspace (re-checked at Vincent’s request, against the docs’
permissions and sandbox pages):
- The run starts in the workspace. Files inside it are auto-allowed, and outside it they default to Ask.
command(*)andread_url(*)stay denied unlessagent.toolslends the shell or the web.- A lent shell needs
--sandbox: Seatbelt on macOS, namespaces on Linux; the workspace stays writable, everything else is out of reach, and there is no network. Since 1.4.4 the sandbox silently does nothing where it is unavailable, so wats checks that it held (the firstcommandstep of a run) and refuses the shell otherwise. - The gate also checks file paths against the workspace, which makes a second boundary.
- Offered: check (d) on 1.4.6 showed that Ask fails closed in
-pmode. A read outside the workspace was denied at once, as aTOOL_ERROR, and the run ended withdenied_actionsand an empty response, which wats records as an error. - Check (c) showed that
$HOME/.gemini/config/hooks.jsonis honoured headless, and that a deny rule still wins after the gate’s allow. - A lent shell needs
--sandbox. wats lends it on macOS only for now, since Linux has the silent no-op.
- inherit: not in the first version. Antigravity has no per-run MCP
config, so an inherit run would need wats written into your own
mcp_config.jsonwith a per-run token (agy mcp addedits the same file). It comes back when Antigravity gets a per-run MCP config.
2.3 Runs and budgets
Section titled “2.3 Runs and budgets”- The command line is
agy -p <prompt> --output-format stream-json --print-timeout <agent.timeout>, plus--modeland--effortwhen they are set. Both values go intodata.via. - Budgets are tokens, minutes and runs, read from the
resultevent. No dollars: the free tier is a quota. - Closed source: wats cannot audit what it reads or sends. The docs say so next to the access levels.
2.4 To check on a real run
Section titled “2.4 To check on a real run”- (c) The gate: what name and arguments a
watsMCP call arrives with, and whether adenystops arun_commandin-pmode. - (d) What Ask does in
-pmode: deny, error, or wait.
4. Detection
Section titled “4. Detection”copilot and agy join the CLIs wats setup looks for on PATH, and
both are proposed as agents.
Decisions for Vincent
Section titled “Decisions for Vincent”- D1. Scope: Copilot CLI and Antigravity CLI as runtimes and MCP hosts. Gemini CLI is dropped: wats supports only CLIs that can be both (Vincent’s rule). Approved.
- D2. Antigravity as an agent: swarm-only by default, locked by its permission rules and the gate. Workspace is offered, since check (d) showed Ask fails closed. Inherit waits for a per-run MCP config. Approved.
- D3. Copilot agent auth: the stored login (check (a)), with
COPILOT_GITHUB_TOKENas the fallback. Approved. - D4. Budgets without dollars:
- Copilot: AI credits through its own
--max-ai-creditscap, plus runs (premium requests) and minutes; - Antigravity: tokens, minutes and runs. Approved.
- Copilot: AI credits through its own
Checked on a real run
Section titled “Checked on a real run”- Copilot (a): done on v1.0.103, see §1. Still open: whether
--available-tools watsalone keepsshell,readandwriteout. The first run of the branch build shows it insession.tools_updated. - Antigravity (b), (c) and (d): done on 1.4.6, see §2.
Alternatives
Section titled “Alternatives”- Gemini CLI, as an MCP host for API-key users: dropped. wats supports only CLIs that are both host and runtime, and Gemini CLI’s individual users have moved to Antigravity.
- Antigravity workspace through
--sandbox: the docs describe it as terminal restrictions, not a file boundary. To revisit if they document one. - Copilot without isolation, denying the user’s servers one by one
with
--deny-tool: fragile, since a server added later would be allowed.
From wats v0.5.11 · source on GitHub
We are the swarm.