Skip to main content
Reuse an existing Antigravity sandbox by ID, or create a new one from repository sources and documented network rules.
This example uses an obsolete Antigravity EnvironmentConfig: repository sources no longer accept type="git" and url, and network.allow_internet_access is not part of the current schema. Apply the migration below before running the custom-environment agent. See Google’s environment schema.
antigravity_environment_config.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your Google API key

4

Configure or skip environment reuse

Before running, replace env_xxxxxxxx in agent_reuse with the ID of an existing environment. To run only the custom path, comment out the agent_reuse.print_response(...) block instead.
5

Update the environment configuration

Replace the environment dictionary in agent_custom with {'type': 'remote', 'sources': [{'type': 'repository', 'source': 'https://github.com/agno-agi/agno', 'target': '/workspace/agno'}]}. Unrestricted outbound network access is the default.
6

Run the example

Save the code above as antigravity_environment_config.py, then run:
Full source: cookbook/90_models/google/gemini_interactions/antigravity_environment_config.py