Safety First

Antigravity is an Autonomous Agent. Unlike VS Code, it can execute terminal commands and delete files without explicit confirmation if not configured correctly.

⚠️ Critical Warning

Never run Antigravity in your root directory (e.g., `C:\` or `/`). Always open a specific project subfolder. There have been reports of agents recursively deleting parent directories when trying to "clean up".

1. Configure the Sandbox

Create a file named .antigravity/config.json in your project root to limit the agent's capabilities.

{
  "sandbox": {
    "allowNetwork": true,
    "allowFileWrite": true,
    "fileWriteMode": "prompt", // Options: "always", "prompt", "never"
    "protectedPaths": [
      ".git",
      ".env",
      "**/*.lock"
    ],
    "maxFileChangesPerAction": 10
  }
}

2. Use Docker Mode

For risky refactors, run the agent inside a Docker container. This ensures that even if it goes rogue, your host system remains untouched.

antigravity start --isolation=docker

3. Recovery

If files are deleted, check the detailed Agent History logs. Antigravity keeps a local cache of modified files for 24 hours.

antigravity restore --last-session