Google updated Managed Agents in the Gemini API with a set of new capabilities aimed at running coding tasks and agentic workflows with greater control and automation. The agent now uses Gemini 3.6 Flash by default, while environment hooks allow developers to block, inspect, or audit tool calls inside an isolated cloud sandbox environment.
These additions are part of the Gemini Interactions API, which coordinates reasoning, code execution, package installation, file management, and web information retrieval through a single API call. In a previous release, Google added support for background-running tasks and integration with remote MCP servers.
Gemini 3.6 Flash Becomes the Default Model
The antigravity-preview-05-2026 agent now automatically runs using Gemini 3.6 Flash, with no code changes required. According to Google, the next interaction will use the new model automatically, while a different model can be selected by passing a value to agent_config.model when creating the interaction or managed agent.
Supported models include Gemini 3.6 Flash, the default and balanced model for reasoning, coding, and tool use; Gemini 3.5 Flash, the previous generation of general-purpose agentic workflow models; and Gemini 3.5 Flash-Lite, which offers the lowest latency and cost within the Gemini 3.5 family.
Hooks for Controlling Tool Calls
Environment hooks allow custom scripts to run before or after every tool call executed by the agent inside a sandbox environment. The developer adds an .agents/hooks.json file to the environment, and the runtime then executes handlers associated with the pre_tool_execution and post_tool_execution events.
The matcher field supports regular expressions for targeting multiple tools, such as code execution and file-writing operations, or for matching all tools. A pre-execution hook can return a result containing a rejection decision and its reason, causing the tool call to be skipped and the rejection reason to be passed into the model context. Post-execution hooks enable validation or formatting operations after the tool finishes and also support HTTP handlers that send requests directly to an external endpoint.
Google provides an example of these capabilities at OffDeal, which describes itself as an AI-native investment bank. According to Alston Lin, OffDeal’s founder and chief technology officer, the company uses a post-execution hook to automatically validate the company logos generated by its Archie agent, including their quality, dimensional accuracy, background, and contrast, and then publish a record of the approved files.
Greater Cost and Operational Control
Managed Agents are now available in projects that use the free tier, allowing developers to try agentic workflows with an API key from a project that has no active billing.
To limit token consumption in multi-round autonomous tasks, max_total_tokens can be configured to specify total token usage, including input, output, and reasoning operations. When the limit is reached, the task stops safely and the interaction returns the incomplete status while preserving the environment state. Execution can be resumed using previous_interaction_id and a new budget.
Scheduled Triggers and Environment Management
Scheduled triggers allow an agent, environment, instruction, and cron-formatted schedule to be linked in a persistent resource that runs automatically without manual intervention. Each run reuses the same sandbox environment, allowing files to persist between executions.
The Environments API also provides functions for listing, inspecting, and deleting sandbox sessions programmatically. According to Google, this can be used to recover environment IDs after a connection interruption or clean up environments when a particular pipeline ends, rather than waiting for the seven-day retention period to expire.
Google says these updates make Managed Agents more like scheduled, cost-controlled workers capable of operating autonomously inside real development environments without breaking the budget or requiring an external orchestration layer. The company encourages developers to review the Gemini Interactions API overview and the Managed Agents quickstart guide to learn about custom agent definitions, environment settings, network rules, and advanced streaming patterns.