Terminal sandbox
Section titled âTerminal sandboxâThe terminal sandbox isolates agent shell commands inside OS-level container boundaries to protect your workstation and sensitive files.
macOS and Linux
Section titled âmacOS and LinuxâOverview
Section titled âOverviewâAntigravity includes a terminal sandbox that isolates shell commands executed by agents. Sandboxed commands can write to your project folders, temporary directories, and common build caches, and read system directories such as /usr and /etc so your tools keep working. Sensitive files such as ~/.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 System | Technology | Details |
|---|---|---|
| Linux | Namespaces | Kernel namespaces isolate the filesystem, hide host processes, and cut off networking. |
| macOS | sandbox-exec | Seatbelt profiles (SBPL) restrict filesystem access and socket connections. |
Configuration
Section titled âConfigurationâYour permission preset controls whether the sandbox is used. Configure your preset under Settings > General > Permission Settings:
| Preset | Sandbox | Commands |
|---|---|---|
| Default | On | Allowed in sandbox; ask outside |
| Request Review | Off | Always ask |
| Turbo | Off | Allowed 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.
Unsandboxed commands
Section titled âUnsandboxed commandsâ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 .*)Permissions integration
Section titled âPermissions integrationâThe sandbox derives its access boundaries from your Permissions configuration:
- Filesystem: Your project folders are mounted read-write. Paths allowed under
read_fileare mounted read-only, and paths allowed underwrite_fileare 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_urlare added to the sandboxâs outbound allowlist.
Windows
Section titled âWindowsâOverview
Section titled âOverviewâAntigravity includes a terminal sandbox that isolates shell commands executed by agents. Sandboxed commands can write to your project folders, temporary directories, and common build caches, and read system directories so your tools keep working. Sensitive files such as .env are blocked, anything not explicitly mounted is invisible inside the sandbox, and network access is limited to domains youâve approved.
Configuration
Section titled âConfigurationâYou can configure the sandbox globally or per project.
Global settings
Section titled âGlobal settingsâIn Settings > General, under Agent Settings, configure the following options:
- 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.
Project settings
Section titled âProject settingsâ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.
Security presets
Section titled âSecurity presetsâThe Security Preset dropdown in the same settings section bundles the terminal and file access policies:
| Preset | Terminal Command Auto Execution | Outside-of-folders file access |
|---|---|---|
| Default | Require Review | Always Ask |
| Full machine | Require Review | Allow |
| Turbo mode | Always Proceed | Allow |
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.
Unsandboxed commands
Section titled âUnsandboxed commandsâ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.
Permissions integration
Section titled âPermissions integrationâThe sandbox derives its access boundaries from your Permissions configuration:
- Filesystem: Your project folders are mounted read-write. Paths allowed under
read_fileare mounted read-only, and paths allowed underwrite_fileare mounted read-write, on top of the default system mounts. Everything else is inaccessible. - Network: When network access is enabled, domains allowed under
read_urlare added to the sandboxâs outbound allowlist. - Escape hatches (
unsandboxed): To let specific commands run outside the sandbox without disabling it entirely, add anunsandboxedallow rule:unsandboxed(git push) unsandboxed(docker compose .*)
How it works
Section titled âHow it worksâWith the terminal sandbox enabled, Antigravity CLI executes commands inside an OS-level isolation boundary. Commands can write to your workspace, temporary directories, and common build caches, and read system directories such as /usr and /etc so your tools keep working. Sensitive files such as ~/.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 System | Technology | Details |
|---|---|---|
| Linux | Namespaces | Kernel namespaces isolate the filesystem, hide host processes, and cut off networking. |
| macOS | sandbox-exec | Seatbelt profiles (SBPL) restrict filesystem access and socket connections. |
CLI configuration
Section titled âCLI configurationâEnable the sandbox in ~/.gemini/antigravity-cli/settings.json, or interactively using /config:
{
"enableTerminalSandbox": true,
"toolPermission": "proceed-in-sandbox"
}The configuration supports the following settings:
enableTerminalSandbox(boolean, default:false): Runs agent commands inside the sandbox.toolPermission(string, default:"request-review"): Setting this to"proceed-in-sandbox"lets sandboxed commands run automatically, while commands that need to run outside the sandbox still prompt for review. Refer to Settings for the other modes.
CLI flags
Section titled âCLI flagsâYou can also control sandboxing when launching the CLI:
# Force the sandbox on for this session
antigravity --sandboxThe CLI supports the following sandbox flag:
--sandbox: Turns the sandbox on for the session, overridingsettings.json.
CLI permissions integration
Section titled âCLI permissions integrationâThe sandbox derives its access boundaries from your Permissions configuration:
- Filesystem: Workspace folders and paths allowed under
write_fileare mounted read-write. Paths allowed underread_fileare mounted read-only, on top of the default system mounts. Denied paths are blocked, and everything else is inaccessible. - Network: Sandboxed commands run without network access by default. Domains allowed under
read_urlare added to the sandboxâs outbound allowlist. - Escape hatches (
unsandboxed): Commands matching anunsandboxedallow rule run outside the sandbox without prompting. This is useful for tools that canât work inside the isolation boundary, such as Docker or commands that talk to system services.
The agent can also request to run a command outside the sandbox on its ownâfor example, to retry a command that failed due to sandbox restrictions. These requests always require your approval unless the command matches an unsandboxed allow rule.
Example
Section titled âExampleâThe following example configures sandbox allow and deny rules in settings.json:
{
"permissions": {
"allow": [
"command(npm test)",
"command(git diff)",
"unsandboxed(git push)",
"read_file(/var/log/app)",
"write_file(src/)"
],
"deny": [
"command(rm -rf /)",
"command(sudo *)",
"write_file(/home/user/.ssh)"
]
}
}With this configuration:
npm testandgit diffrun inside the sandbox.git pushruns outside the sandbox usingunsandboxed(git push).rm -rf /andsudoare always blocked.
Interactive prompts
Section titled âInteractive promptsâWhen a command needs review, you can approve it once or turn the approval into a standing rule:
Do you want to proceed?
1. Yes
2. Yes, and always allow in this conversation for commands that start with 'npm test'
3. Yes, and always allow for commands that start with 'npm test' (Persist to settings.json)
4. NoWhen the agent asks to bypass the sandbox, the prompt calls it out explicitly so you can judge the risk:
đ Allow sandbox bypass for command execution?
â ď¸ Confirm the command is safe to run outside of the sandbox with full network and disk access.Approving âalways allowâ here records an unsandboxed(...) rule instead of a plain command(...) rule.
Related resources
Section titled âRelated resourcesâExplore related documentation and guides:
- 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.