# How to run Google Antigravity inside OpenBot safely

> Set up OpenBot with Google Antigravity over ACP without breaking Google's Terms of Service, switch unattended routines to a Gemini API key, and trigger agents from openbot-cli or webhooks.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2026-12-06 | Topics: [AI](https://flaviocopes.com/tags/ai/) | Canonical: https://flaviocopes.com/openbot-antigravity/

If you want persistent AI teammates that have their own workspace, browser, history and scheduled routines, [Grok Bot](https://flaviocopes.com/grok-bot/) is the turnkey option, and [T3 Code](https://flaviocopes.com/t3-code/) is great as a coding workbench.

[OpenBot](https://openbot.run) sits right in the middle.

One quick note on the name before we start: this guide is about OpenBot by Nightly Labs ([nightly-labs/openbot](https://github.com/nightly-labs/openbot)), not CopilotKit's workspace at `open.bot` that shares the same name.

It's a local-first desktop app (with an optional Linux server, Docker container, and mobile apps) where you run persistent agents backed by the AI tools you already pay for: Codex, Claude Code, Grok, OpenCode, and Google Antigravity.

![The OpenBot homepage presenting persistent multi-provider AI agents on your own computer](https://images.flaviocopes.com/openbot-antigravity/openbot-homepage.webp?v=3fab80cc)

The big question everyone asks before they connect their Google AI Pro or [Google AI Ultra](https://flaviocopes.com/google-ai-ultra/) plan to a third-party bot workspace is simple: will this get my account flagged?

Let's see how OpenBot talks to Google Antigravity, why it stays inside Google's updated Terms of Service, how to set it up on macOS, and where the line sits between your Google sign-in and a Gemini API key.

## Why OpenBot stays inside Google's Terms of Service

In December 2026 Google rewrote clause 6 of the [Antigravity Terms of Service](https://antigravity.google/terms/). I broke down the full policy change in [what gets Google Antigravity accounts banned](https://flaviocopes.com/google-ai-account-bans/).

The rule is simple. You can wrap the official, unmodified Antigravity CLI (`agy`) in a third-party interface over the Agent Client Protocol (ACP), run it in headless mode (`agy -p`), or call it as a subagent from another harness (I covered [calling `agy -p` as a subagent](https://flaviocopes.com/antigravity-subagent/)).

What stays banned is extracting Antigravity OAuth tokens to hit Google's private endpoints directly, making the harness a raw completions proxy for an external loop, or pooling personal subscriptions across users.

OpenBot's Gemini provider (`antigravity` in [nightly-labs/openbot](https://github.com/nightly-labs/openbot)) is built around those boundaries:

- It spawns the official, unmodified Antigravity CLI over ACP (`acp`) instead of implementing its own OAuth shim.
- It never calls Google's internal Code Assist endpoints (`cloudcode-pa`, `daily-cloudcode-pa`, or `v1internal`) for usage or verification links.
- It disables account pooling for Gemini, so OpenBot will never rotate turns across multiple personal Google accounts behind your back.
- On CLI 1.5.16 and newer, it checks remaining quota by running the unmodified headless command `agy -p /usage --output-format json --print-timeout 20s`, and stops if the CLI tries to bill that command as a regular turn.

Here's how requests flow through OpenBot, depending on whether you run an interactive teammate on your Google plan, or an unattended routine on an API key:

```mermaid
flowchart TD
  accTitle: How OpenBot connects to Google Antigravity over ACP and API keys
  accDescr: OpenBot runs the unmodified Antigravity CLI over ACP for interactive teammates using Google sign-in, checks quota with headless agy usage, falls back to a backup model when a quota window locks, and routes unattended routines through a saved Gemini API key.
  U["OpenBot workspace (chat, queue, routines)"] --> P{"Auth mode for Gemini row"}
  P -->|"Interactive work (Google sign-in)"| A["Unmodified Antigravity CLI over ACP"]
  A --> G["Google AI Pro or Ultra plan"]
  A -.->|"Quota check (0 billed turns)"| Q["agy -p /usage --output-format json"]
  G -->|"Quota window locked"| F["Automatic failover to backup model"]
  P -->|"24/7 proactive routines"| K["Saved GEMINI_API_KEY"]
  K --> API["Gemini API (AI Studio or Vertex AI)"]
```

If you're just starting to set up Antigravity on your Mac, I recommend starting with [the complete guide to Google Antigravity](https://flaviocopes.com/antigravity/).

You can also download the free [Antigravity Handbook](https://flaviocopes.com/ebooks/antigravity-handbook/) to read it offline.

## Install OpenBot and pick the right Antigravity CLI

Download the macOS disk image from [openbot.run](https://openbot.run) or the [GitHub Releases page](https://github.com/nightly-labs/openbot/releases) (Apple Silicon `arm64` or Intel `x64`, macOS 13 or newer) and drag `OpenBot.app` into `/Applications`.

On first launch, you pick a language and sign in to an OpenBot account using a one-time email code.

Even though the account sign-in is required before you reach the workspace, your chats, files and browser sessions are all local to the computer running OpenBot.

![The OpenBot first-launch sign-in screen showing email one-time code authentication](https://images.flaviocopes.com/openbot-antigravity/openbot-step2.webp?v=cba6c173)

Next is a detail that might trip you up if you already have the Antigravity IDE installed.

OpenBot **never** searches your `PATH` for a binary named `antigravity`, because the Antigravity editor installs its own `antigravity` launcher, which is not the ACP CLI.

You have 2 clean options:

1. Click **Download** on the Gemini row inside OpenBot's **Settings > Providers** screen. OpenBot downloads Google's official Antigravity CLI from `google-antigravity/antigravity-cli` into its own managed folder (Google's license does not allow OpenBot to bundle the binary inside the DMG) and checks for updates automatically.
2. Point OpenBot at the `agy` CLI you already installed on your Mac (version 1.5.3 or newer) by setting `OPENBOT_ANTIGRAVITY_PATH` before launching OpenBot.

![Downloading the managed Gemini Antigravity CLI inside OpenBot Settings > Providers > Gemini](https://images.flaviocopes.com/openbot-antigravity/openbot-gemini-download.webp?v=15936146)

Let's check the `agy` version and models already available on my Mac:

```bash
agy --version
agy models
```

![Terminal output showing agy version 1.5.17 and available Gemini 4 and Claude models](https://images.flaviocopes.com/openbot-antigravity/agy-models.webp?v=c8f07dca)

With `agy` 1.5.17 installed at `~/.local/bin/agy`, you can launch OpenBot against that exact binary from a terminal:

```bash
OPENBOT_ANTIGRAVITY_PATH="$HOME/.local/bin/agy" open -a OpenBot
```

If you prefer clicking **Download** inside OpenBot instead, you don't need the environment variable at all.

OpenBot will keep its managed copy updated, without touching your system `agy`.

## Sign in with Google vs. saving a Gemini API key

Inside OpenBot's Gemini provider settings, clicking **Connect** will run an ACP `authenticate` call with `oauth-personal` and will open `accounts.google.com` in your browser.

Once you sign in, OpenBot asks the CLI for `model/list` and keeps Google's own ordering. On my Mac, OpenBot downloaded Antigravity CLI `v1.5.25` and exposed all 8 models from my plan, starting with [Gemini 4 Neon](https://flaviocopes.com/gemini-4-neon-review/) and Gemini 4 Carbon:

![OpenBot Settings > Providers > Gemini showing a connected Google account, the Add key option for a Gemini API key, managed runtime v1.5.25, and available Gemini 4 models](https://images.flaviocopes.com/openbot-antigravity/openbot-gemini-connected.webp?v=dfc6a769)

Notice the green circular Gemini quota indicator in the left sidebar next to Codex and Grok, and the **Add key** button right under **Accounts**.

You can save a **Gemini API key** (`GEMINI_API_KEY`) on that same Gemini provider page.

This single toggle changes how OpenBot routes turns, and is the cleanest way to separate interactive work from unattended proactive bots.

| Setting | Google sign-in (`oauth-personal`) | Saved Gemini API key (`GEMINI_API_KEY`) |
| --- | --- | --- |
| Best for | Interactive personal teammates you prompt yourself | 24/7 scheduled routines, webhook bots, and heavy queues |
| Billing | Your Google AI Pro or Ultra subscription | Pay-as-you-go or [Google AI Ultra monthly API credits](https://flaviocopes.com/google-ai-ultra-api-credits/) |
| Models listed | Full plan catalog (Gemini 4 Neon, Carbon, Hydrogen, plus Claude/GPT) | API key Gemini models only (no Carbon, Claude, or GPT) |
| Quota reading | `agy -p /usage --output-format json` (5-hour and weekly buckets) | None (returns API rate-limit errors directly) |
| Priority when both are set | Overridden while a key is saved | Always takes precedence (`apiKeyInUse`) |

One practical quirk to know upfront: if you save a Gemini API key on the default Gemini row, OpenBot will route turns through the key instead of your Google sign-in, and will move agents off any model the key does not serve. Removing the key will put your Google plan back in charge.

## How OpenBot checks Antigravity quota and fails over

Since the Antigravity ACP server does not push the plan usage, OpenBot checks the remaining 5-hour and weekly buckets using the unmodified headless CLI:

```bash
agy -p /usage --output-format json --print-timeout 20s | jq '{
  status,
  num_turns,
  groups: [.command.data.groups[] | {
    name,
    buckets: [.buckets[] | {
      id,
      window,
      remaining: ((.remaining_fraction * 100 | round | tostring) + "%"),
      reset_time
    }]
  }]
}'
```

When I ran this on `agy` 1.5.17, it returned immediately with `num_turns: 0` and 0 billed tokens:

![Terminal output of agy headless usage JSON showing zero billed turns and four quota buckets](https://images.flaviocopes.com/openbot-antigravity/agy-usage-json.webp?v=235c18fa)

Notice the `1970-01-01T00:00:00Z` reset time on the untouched Claude and GPT pool. OpenBot ignores resets before year 2000 so untouched buckets stay clean in the UI.

Even better is what happens when you actually hit a limit. If Google replies with a timed quota lock ("Individual quota reached" or "Third-party quota reached" followed by a reset timer), OpenBot parses that reset delay, pauses turns against that bucket, and automatically moves the agent to a **backup model on another provider** (say Codex or Claude Code) while keeping the same chat and workspace.

Context length works cleanly too. Antigravity has no explicit ACP compaction command, so when a long-running teammate fills its context window, OpenBot rotates the underlying Antigravity session in `handoff` mode. It saves the work steps, starts a fresh session behind the same thread, and passes the handoff summary across so you never lose the agent's workspace or history.

## Create a Gemini 4 Neon teammate

With Gemini connected, click the `+` button in the sidebar to create a persistent agent. Pick a name, an avatar, and set **Model** to **Gemini 4 Neon · High**:

![Creating a new Gemini 4 Neon agent inside OpenBot with Gemini 4 Neon High selected](https://images.flaviocopes.com/openbot-antigravity/openbot-create-agent.webp?v=5ddd8cd1)

Click **Create agent** and OpenBot spins up a dedicated workspace folder on disk (`~/OpenBot/Agents/agent-...`) and starts a fresh Antigravity ACP session behind that thread:

![The newly created Gemini 4 Neon agent running live inside OpenBot](https://images.flaviocopes.com/openbot-antigravity/openbot-agent-live.webp?v=bd1364b2)

## Making agents proactive: routines, webhooks, and `openbot-cli`

Once your teammate is up, you don't have to sit in the window and chat with it by hand.

To make it proactive, OpenBot gives you 3 mechanisms:

### 1. Scheduled and webhook routines

In any agent's routine editor, you can set **When to run** to a schedule or to **Webhook** (up to 64 webhook routines per host).

A webhook routine will generate a unique URL and a [Standard Webhooks](https://www.standardwebhooks.com/) signing secret (`whsec_...`).

Every incoming `POST` request will have 3 headers (`X-OpenBot-Timestamp`, `X-OpenBot-Delivery-Id` and `X-OpenBot-Signature`) where the signature is `sha256=` followed by the lowercase hex HMAC-SHA256 of `<timestamp>.<deliveryId>.<body>`.

Here is a small Node.js script that signs and sends a webhook event to an OpenBot routine:

```js
import { createHmac, randomUUID } from 'node:crypto'

const body = JSON.stringify({
  type: 'deployment.completed',
  data: { environment: 'production' },
})
const deliveryId = randomUUID()
const timestamp = String(Math.floor(Date.now() / 1000))
const signature = createHmac('sha256', process.env.OPENBOT_WEBHOOK_SECRET)
  .update(`${timestamp}.${deliveryId}.${body}`)
  .digest('hex')

const response = await fetch(process.env.OPENBOT_WEBHOOK_URL, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-OpenBot-Timestamp': timestamp,
    'X-OpenBot-Delivery-Id': deliveryId,
    'X-OpenBot-Signature': `sha256=${signature}`,
  },
  body,
})

if (response.status !== 200 && response.status !== 202) {
  throw new Error(`OpenBot rejected the event: ${response.status}`)
}
```

Keep the same `deliveryId` and `body` if you retry after a `503` (for example while a host is waking up). OpenBot deduplicates receipts by delivery ID for 7 days, so retries return `200` without triggering a duplicate run.

You can also filter the incoming JSON payload by event `type` and JSON Pointer rules (e.g. `/environment` equal to `production`) so the agent only wakes up on the exact events you care about.

### 2. Triggering agents from your own scripts with `openbot-cli`

OpenBot ships a standalone Node.js CLI right inside the macOS app bundle (tested on OpenBot 0.85.0).

You don't need to install a separate package to use it:

```bash
alias openbot-cli='node "/Applications/OpenBot.app/Contents/Resources/cli/openbot-cli.mjs"'
openbot-cli --help
```

![Terminal output showing openbot-cli commands and exit codes from the macOS app bundle](https://images.flaviocopes.com/openbot-antigravity/openbot-cli-help.webp?v=d898ef85)

To let local scripts talk to an agent, open that agent's **Settings > Permissions** and turn on **Local scripts** (it is off by default, and agents cannot enable it for themselves).

Once enabled, OpenBot listens on `127.0.0.1` on a random port and writes three `0600` files (`url`, `token`, `headers`) inside `~/Library/Application Support/OpenBot/automation/`.

Now your shell scripts, Git hooks, cron jobs, and anything that can run on your computer can list enabled agents, queue tasks, or wait for structured JSON replies.

Here is a real run against the `Gemini 4 Neon` agent I just created (which completed in about 22 seconds on the first turn):

```bash
openbot-cli list --json | jq .
openbot-cli run "Gemini 4 Neon" \
  "Run pwd and tell me the full path and how many files are in it, in one short sentence." \
  --wait --timeout 2m --json | jq '{ok, exitCode, status, answer}'
```

![Terminal output showing openbot-cli listing the Gemini 4 Neon agent and receiving a structured JSON answer from a live run](https://images.flaviocopes.com/openbot-antigravity/openbot-cli-live.webp?v=b2410ab6)

The exit codes are meant for automation: `0` means the turn finished, `1` means the turn failed or was refused, `3` means the agent paused to ask a human a question or request approval, `4` means `--wait` timed out while the agent keeps working, `5` means OpenBot is not running or Local scripts is disabled.

### 3. Always-on hosting (shared Mac, Linux server, or Docker)

If you close your MacBook, local routines stop until the laptop wakes up.

If you want to run OpenBot on an always-on Mac at home (or share one host with your partner), I walked through the full `pmset` and Docker setup in [How to share one OpenBot computer across your house from a Mac](https://flaviocopes.com/openbot-shared-mac/).

One important ToS rule if you share an OpenBot host with another person: do not put your personal Google Antigravity OAuth sign-in on a shared server where someone else can trigger turns. Google's consumer subscription is for single-user use, so switch the Gemini row on a shared host to a saved `GEMINI_API_KEY` instead.

For a dedicated Linux VPS, OpenBot also ships a headless server mode for Ubuntu 24.04/26.04 or Docker so your teammates stay online 24/7 and connect to your desktop and iPhone apps:

```bash
curl -fsSL https://raw.githubusercontent.com/nightly-labs/openbot/main/scripts/install-server.sh | sudo bash
sudo openbot login
```

On a headless Linux server with no desktop browser, OpenBot falls back to a paste-the-address sign-in flow for Gemini, or you can skip browser sign-in and run the server with a saved Gemini API key.

## OpenBot vs. Grok Bot vs. T3 Code

These tools solve overlapping problems, so it helps to be clear on what each one actually owns:

| Tool | Where it runs | Antigravity support | Proactive automation | Pricing and license |
| --- | --- | --- | --- | --- |
| **OpenBot** | Your Mac, Windows, Linux, or self-hosted Docker/VPS | Native ACP (`agy`) + saved `GEMINI_API_KEY` + backup failover | Schedules, signed webhooks, `openbot-cli`, shared team channels | Free for noncommercial use (PolyForm Noncommercial 1.0.0), commercial license for business use |
| **[Grok Bot](https://flaviocopes.com/grok-bot/)** | xAI-managed cloud Linux VM (24/7) | Not native (locked to xAI stack) | Built-in routines, skills, and cloud browser | Bundled in X / legacy Cursor subscriptions |
| **[T3 Code](https://flaviocopes.com/t3-code/)** | Local server + linked remote machines | Native ACP (`agy`) | `schedule_task` (intervals, fixed times, webhooks) | Free, open source (MIT) |

## How I would use it (and where it is a bad fit)

If I set up a persistent bot team around Google Antigravity, here is how I would split the work to get the best of both worlds, without risking my Google AI Ultra plan.

First, I would keep coding sessions inside [T3 Code](https://flaviocopes.com/t3-code/) (or the [T3 Code Handbook](https://flaviocopes.com/ebooks/t3-code-handbook/) workflows), because Git worktrees, inline diffs and PR review guides are built specifically for writing and reviewing code.

Second, I would use OpenBot for non-IDE persistent teammates that live alongside my browser, files, and local tools. For interactive teammates I chat with during the day, I would connect Antigravity over ACP using my Google AI Ultra sign-in, and configure a backup model on Codex or Claude Code so a 5-hour quota lock never stalls a thread.

Third, for any routine that runs unattended on a schedule or fires from a webhook while I am away, I would put it on a saved Gemini API key funded by my [Google AI Ultra monthly API credits](https://flaviocopes.com/google-ai-ultra-api-credits/) (or route that specific agent to an API-key provider). That keeps my personal OAuth sign-in strictly tied to interactive work.

There are 3 clear cases where OpenBot is the wrong tool:

- **Strict sandboxing.** After first-launch consent, OpenBot runs agents with `danger-full-access` and `approvalPolicy: never`. Agents can edit files, run shell commands, and drive the embedded browser without asking every step, so only give them tasks you trust and keep backups.
- **Commercial team deployment on the free tier.** The source code is open on GitHub, but it uses the **PolyForm Noncommercial 1.0.0** license. Personal projects, study, and research are free, while running it for a business requires a commercial license.
- **Zero-maintenance 24/7 cloud hosting.** Unlike Grok Bot, OpenBot does not hand you a managed cloud computer out of the box. If you want bots working while your laptop is closed, you have to maintain a home Mac mini, a Linux VPS, or a Docker host yourself.
