Antigravity (Interactions)
Run the Antigravity managed autonomous agent in a sandbox through the Gemini Interactions API.
Run the Antigravity managed agent through the Gemini Interactions API. Antigravity is a general-purpose autonomous agent that plans, runs code, browses the web, and produces artifacts (PDFs, HTML, slides) inside a managed Linux sandbox.
The environment parameter selects the sandbox:
| Value | Behavior |
|---|---|
"remote" | Fresh remote Linux sandbox. |
"env_<id>" | Reuse a previously provisioned sandbox. |
dict | Full EnvironmentConfig (sources, network rules). |
GeminiInteractions in Agno sends Antigravity requests in the foreground and forces store=True so each interaction is retrievable. The Google API also supports background Antigravity execution. Use the Google Gen AI SDK directly when you need background execution.
Code
from agno.agent import Agent
from agno.models.google import GeminiInteractions
agent = Agent(
model=GeminiInteractions(
agent="antigravity-preview-05-2026",
environment="remote",
),
markdown=True,
)
if __name__ == "__main__":
agent.print_response("What is the capital of France?")Usage
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateSet your API key
export GOOGLE_API_KEY=xxxInstall dependencies
uv pip install -U "google-genai>=2.3" agnoRun Agent
Save the code above as antigravity.py, then run:
python antigravity.py