DEV Community

Cover image for Using Docker Sandboxes with Google Antigravity
Dmitry Kabanov
Dmitry Kabanov

Posted on Edited on Originally published at dmitrykabanov.com

Using Docker Sandboxes with Google Antigravity

It is 2026, and it is common to run AI agents in a terminal or an integrated development environment for coding tasks.

The problem is, AI agents can be insecure to run directly on your machine: only in Summer 2026 were several incidents reported.1 I have recently experienced a strange situation myself when Antigravity, an AI agent from Google, has asked me if it was allowed to run tests from the Tests/ directory one level above the current working directory, because it has looked there for unknown reason. Of course, many software packages look for different things on the file system, for example, for a C compiler, etc. However, they usually check some predefined system locations like /usr/bin on Linux.

So, after that had happened, I have started to think about running AI agents strictly in virtual machines instead of directly. It turned out that Docker Inc. has a special solution for this: Docker Sandboxes. These are isolated virtual machines that also run Docker containers inside of them. That is, each sandbox has its own Docker daemon, filesystem and network, so it cannot break into other Docker containers (normally, Docker containers share the same kernel, for example, on macOS several Docker containers run inside the same virtual Linux machine). Hence, the sandboxes are designed to be more secure: however, they use normal Docker facilities to automatically mount a project directory inside the sandbox, so that an AI agent can work with the project code.

Docker Sandboxes can be used with different AI agents. Below I describe how to use them with Google Antigravity.

How to run Google Antigravity

First, install the sbx utility as instructed here.

Many popular AI agents are supported and can be started with the command

sbx run <agent>
Enter fullscreen mode Exit fullscreen mode

where <agent> is the lowercase name of an AI agent.

Strangely,

sbx run gemini
Enter fullscreen mode Exit fullscreen mode

still exists, although gemini is deprecated since June 2026; however,

sbx run antigravity
Enter fullscreen mode Exit fullscreen mode

is not yet available.2

Fortunately, there is an official Docker image for Google Antigravity. It can be run with the command:

sbx run "docker.io/sbx/antigravity:latest"
Enter fullscreen mode Exit fullscreen mode

When the container starts, one needs to authorize the agent, which opens an authorization webpage in a browser. After that, using the agent inside the sandbox is as convenient as running it directly on the machine, because the project directory is automatically mounted inside the sandbox. Yet, running inside the sandbox should be more secure, as there is more control over what the agent can access on your computer.

Originally published at https://dmitrykabanov.com/blog/2026/using-docker-sandboxes-with-google-antigravity/.


  1. GenAI and Agentic AI Exploit Roundup Q3 2026 ↩

  2. Google renamed its AI Agent Gemini to Antigravity
    in May 2026 ↩

Top comments (0)