Skip to content
Available on:
Antigravity 2.0Antigravity CLI

The terminal sandbox isolates agent shell commands inside OS-level container boundaries to protect your workstation and sensitive files.

Antigravity includes a Terminal Sandbox that isolates shell commands executed by agents. Sandboxed commands can write to your project folders, temp directories, and common build caches, and read system directories like /usr and /etc so your tools keep working. Sensitive files like ~/.ssh and .env are blocked, anything not explicitly mounted is invisible inside the sandbox, and network access is limited to domains you’ve approved.

The sandbox is built on native operating system primitives, so there are no virtual machines or Docker images to manage and no startup delay:

Operating SystemTechnologyDetails
LinuxNamespacesKernel namespaces isolate the filesystem, hide host processes, and cut off networking.
macOSsandbox-execSeatbelt profiles (SBPL) restrict filesystem access and socket connections.

Whether the sandbox is used is controlled by your permission preset, configured under Settings → General → Permission Settings:

PresetSandboxCommands
DefaultOnAllowed in sandbox; ask outside
Request ReviewOffAlways ask
TurboOffAllowed without prompting, unrestricted

You can override the global preset in an individual project under Settings → Projects. Projects default to Inherit General upon creation, which follows your global preset.

Refer to Agent Permissions for the full preset behavior, including file access, MCP tools, and web page reads.

Some commands cannot work inside the sandbox — for example, those needing network access or talking to system services. The agent can request to run such commands outside the sandbox, where they run on your host with full privileges. These requests always pause for your approval, unless the command is already covered by a command allow or deny rule.

To let a specific command run without prompting — inside or outside the sandbox — add a command allow rule:

command(git push)
command(regex:docker compose .*)

The sandbox derives its access boundaries from your Permissions configuration:

  • Filesystem: Your project folders are mounted read-write. Paths allowed under read_file are mounted read-only, and paths allowed under write_file are mounted read-write, on top of the default system mounts. Everything else is inaccessible.
  • Network: Sandboxed commands run without network access by default. Domains allowed under read_url are added to the sandbox’s outbound allowlist.

Antigravity includes a Terminal Sandbox that isolates shell commands executed by agents. Sandboxed commands can write to your project folders, temp directories, and common build caches, and read system directories so your tools keep working. Sensitive files like .env are blocked, anything not explicitly mounted is invisible inside the sandbox, and network access is limited to domains you’ve approved.

You can configure the sandbox globally or per project.

In Settings > General, under Agent Settings:

  • Enable Sandbox Mode (Preview): Runs agent terminal commands inside the sandbox.
  • Terminal Command Auto Execution: Set to Proceed in Sandbox to let sandboxed commands run without approval; commands that need to run outside the sandbox still ask first. The other options are Require Review and Always Proceed.

Select a project under Settings > Projects to override these settings for that project. Each setting gains an Inherit General option, and Enable Sandbox Mode becomes a dropdown: Inherit General, Enabled, or Disabled.

The Security Preset dropdown in the same settings section bundles the terminal and file access policies:

PresetTerminal Command Auto ExecutionOutside-of-folders file access
DefaultRequire ReviewAlways Ask
Full machineRequire ReviewAllow
Turbo modeAlways ProceedAllow

None of the presets turn the sandbox on. Enabling Enable Sandbox Mode switches the preset to Custom, where you set each option yourself — a common combination is the sandbox with Proceed in Sandbox.

When a command needs to run outside the sandbox—because it matches an unsandboxed(...) rule, the agent requested it, or the sandbox is disabled—the command runs on your host with full privileges. Depending on your execution policy, the agent pauses for your approval first.

The sandbox derives its access boundaries from your Permissions configuration:

  • Filesystem: Your project folders are mounted read-write. Paths allowed under read_file are mounted read-only, and paths allowed under write_file are mounted read-write, on top of the default system mounts. Everything else is inaccessible.
  • Network: When network access is enabled, domains allowed under read_url are added to the sandbox’s outbound allowlist.
  • Escape hatches (unsandboxed): To let specific commands run outside the sandbox without disabling it entirely, add an unsandboxed allow rule:
    unsandboxed(git push)
    unsandboxed(docker compose .*)
  • Agent Permissions: Configure allow, deny, and ask rules.
  • Agent Settings: Command execution policies and file access controls.
  • Settings: Global application and CLI preferences.
  • Projects: Multi-folder configuration and per-project settings.