---
title: "Google Antigravity Sandbox | Cosmonic"
description: "Sandbox Google Antigravity with Cosmonic Desktop: connect it over MCP and install the cosmonic-sandbox skill so the code it writes runs in a local WebAssembly sandbox, isolated from your files, network, and keys."
canonical: "https://cosmonic.com/docs/desktop/agents/antigravity-sandbox/"
---

# Google Antigravity Sandbox

Cosmonic Desktop is a local **AI sandbox** for [Google Antigravity](https://antigravity.google/): the code Antigravity writes is compiled to WebAssembly and runs on your own machine with no access to your files, network, or keys until you grant it. Two settings wire it up, one for launching Antigravity from Build with the sandbox playbook and one for installing Desktop's MCP server into Antigravity; use either or both.

## Sandbox Google Antigravity with Cosmonic Desktop

### 1. Settings → Agents: launch Antigravity from Build

Open **Settings → Agents**. The **Detected agents** card lists every coding agent Desktop found by its home directory (`~/.gemini/antigravity-cli` (Antigravity shares the `~/.gemini` home with Gemini CLI; its own state under `antigravity-cli` is how Desktop tells the two apart)) or on your login shell's PATH, and says whether each one is launchable from Build. In the **Skills** card, turn on **Google Antigravity** to install the `cosmonic-sandbox` skill at `~/.gemini/skills/cosmonic-sandbox/`. This is the same install the one-time **Set up your coding agents** dialog offers on first run; nothing is installed silently.

The skill is the sandbox playbook: it teaches Antigravity to compile what it generates to a WebAssembly component and deploy it into the local sandbox instead of running it raw on your host. Once it is installed, Build can launch Antigravity directly: open **Build** in the sidebar, pick Antigravity as the agent, describe what you want, and its output lands in a sandboxed workload you can inspect before it runs.

Antigravity reads the same `~/.gemini/skills` directory as Gemini CLI, so installing the skill for one covers both.

### 2. Settings → MCP Server: install Desktop's MCP server into Antigravity

Open **Settings → MCP Server**. Under **Install in your AI client**, turn on **Google Antigravity**: The Antigravity CLI (`agy`) has no `mcp` subcommand, so Desktop's toggle edits the MCP config the CLI and the Antigravity IDE share, `~/.gemini/config/mcp_config.json`, directly. This registers `cosmonicd mcp serve` as an MCP server in Antigravity's own configuration, and the `cosmonic_*` tools (observe, deploy, build) are available the next time you start it. Expand **Instructions** on the same card to copy the manual snippet instead.

To do it by hand, add the server to `~/.gemini/config/mcp_config.json`:

```json
{
  "mcpServers": {
    "cosmonic": {
      "command": "/Applications/Cosmonic Desktop.app/Contents/Resources/cosmonicd",
      "args": ["mcp", "serve"]
    }
  }
}
```

### 3. Verify the connection

Open the MCP panel in the Antigravity IDE (or start `agy`); the `cosmonic` server should be listed. Antigravity reads only this home-level file, not the inline `mcpServers` map in `settings.json` that Gemini CLI uses and not project-local configs.

### Skills over MCP

Desktop's MCP server also publishes its skill family (`cosmonic-sandbox`, `cosmonic-go`, `cosmonic-nats`, `cosmonic-nats-tuning`, and `cosmonic-kafka`) through the MCP **Skills extension** (`io.modelcontextprotocol/skills`). A client that supports [Skills over MCP](https://github.com/modelcontextprotocol/ext-skills) gets the playbooks the moment it connects, with nothing written to its skills directory, so the MCP registration above is enough on its own for those clients. The on-disk skill from **Settings → Agents** covers clients that read a skills directory but do not yet speak the extension, and it is what Build relies on to launch Antigravity.

## What Antigravity can do once connected

Its full tool surface (observe, deploy, build) and the guardrails are covered in [Connect Coding Agents](https://cosmonic.com/docs/desktop/coding-agents/#what-the-agent-can-do); the tools work only while Cosmonic Desktop is running.

## Frequently asked questions

### How do I sandbox Google Antigravity?

Install Cosmonic Desktop, then under Settings → Agents turn on Google Antigravity to install the cosmonic-sandbox skill, and under Settings → MCP Server register Desktop’s MCP server in Antigravity. From then on the code Antigravity writes is compiled to WebAssembly and runs in a local sandbox with no access to your files, network, or keys until you grant it.

### Does Antigravity itself run inside the sandbox?

No. Antigravity keeps running in your terminal or IDE exactly as before. What changes is where its output executes: the programs and MCP servers it builds run as sandboxed WebAssembly workloads on your machine instead of directly on your host.

### Do I need both the skill and the MCP server?

They do different jobs. The MCP server gives Antigravity the tools to build, deploy, and observe sandboxed workloads; the skill gives it the know-how to use them by default. Desktop also publishes its skills over the MCP Skills extension, so a client that supports Skills over MCP gets the playbook from the connection alone.

### What can the code Antigravity writes reach inside the sandbox?

Nothing by default. Each workload starts with no filesystem, network, or credential access; you grant exactly the capabilities it needs in its manifest, and everything else stays denied. The same manifest deploys unchanged to Cosmonic Control on Kubernetes.

### Does Antigravity share configuration with Gemini CLI?

The skills directory, yes: both read \`~/.gemini/skills\`, so one install covers both. MCP registration is separate: Antigravity reads only \`~/.gemini/config/mcp_config.json\`, which the CLI and the IDE share, while Gemini CLI uses \`settings.json\`.

## Next steps

- The server's trust model and tool reference: [Connect Coding Agents](https://cosmonic.com/docs/desktop/coding-agents/).
- Sandbox the tool servers your agent calls: [Sandbox MCP Servers](https://cosmonic.com/docs/desktop/sandbox-mcp-servers/).
- What an AI sandbox is and why it matters: [AI Sandbox](https://cosmonic.com/ai-sandbox/).

Last updated on **Nov 9, 2026** by **Eric Gregory**
