Google's Gemini API Managed Agents Gain Hooks, Model Selection, and Free Tier Access
· 3 min read ·
Google has rolled out a significant update to Managed Agents within the Gemini API, introducing environment hooks, model selection flexibility, and free tier availability. These additions expand on a previous release that brought background tasks and remote MCP server integration to the platform.
With Managed Agents in the Gemini Interactions API, a single API call can coordinate reasoning, code execution, package installation, file management, and web retrieval within an isolated cloud sandbox. This architecture allows developers to build complex agentic workflows without needing to manage infrastructure themselves.
Gemini 3.6 Flash Becomes the Default Model
The antigravity-preview-05-2026 agent now runs on Gemini 3.6 Flash by default. The change requires no code modifications — the next interaction automatically adopts the new model. Gemini 3.6 Flash is described as a balanced model suited for reasoning, coding, and tool use.
Developers can also explicitly choose which model to use by passing the agent_config.model parameter when creating an interaction or managed agent. This opens up options for cost optimization and model pinning. The supported model lineup includes Gemini 3.6 Flash as the default, Gemini 3.5 Flash for general agentic workflows from the previous generation, and Gemini 3.5 Flash-Lite, which offers the lowest latency and cost within the Gemini 3.5 family.
One of the most notable additions is environment hooks, which allow developers to run custom scripts before or after every tool call an agent makes inside its sandbox. By placing a .agents/hooks.json file into the environment, the runtime will execute designated handlers on either pre_tool_execution or post_tool_execution events.
The matcher field supports regular expressions, making it possible to target specific tools using patterns like code_execution|write_file or to catch all tool calls with *. For example, a security-gate hook group can run a Python script before every code execution or file write operation. If that script returns a deny decision with a reason, the tool call is skipped and the rejection reason is fed back into the model's context.
Similarly, an auto-format hook group can run a linting script after every tool completes to enforce consistent code styling. Hooks also support HTTP-type handlers that can POST directly to an external endpoint, offering flexibility for teams with existing validation infrastructure.
Real-world adoption is already underway. OffDeal, an AI-native investment bank, uses post_tool_execution hooks to run automated image verification inside the remote sandbox. Alston Lin, Founder and CTO of OffDeal, explained that banker-ready presentation decks require company logos that meet strict criteria for size, aspect ratio, transparency, and contrast. Before hooks existed, the remote nature of the sandbox meant validation code had nowhere to run. With hooks, a pipeline triggers the moment the AI analyst writes its company list, fetching candidates, enforcing pixel-level quality checks, verifying each logo with Gemini vision, and publishing a manifest of approved files.
Cost Control, Scheduling, and Sandbox Management
Managed agents are now available on free tier projects, allowing developers to experiment with agentic workflows using an API key from a project without active billing. This lowers the barrier to entry for teams exploring the platform's capabilities.
Because managed agents execute multi-turn autonomous loops, complex tasks can consume significant token budgets. To address this, Google introduced budget controls via the max_total_tokens parameter within agent_config. This caps total consumption across input, output, and thinking tokens. When the agent reaches the limit, execution safely pauses and the interaction returns a status of incomplete. The environment state is preserved, so developers can resume by passing previous_interaction_id along with a fresh budget.
Scheduled execution is another new capability. Triggers bind an agent, environment, prompt, and cron schedule into a persistent resource that fires without manual intervention. Each scheduled run reuses the same sandbox, meaning files persist across executions — useful for recurring maintenance or reporting tasks.
The Environments API rounds out the update by letting developers list, inspect, and delete sandbox sessions programmatically. This makes it possible to recover environment IDs after a disconnect or clean up sandboxes when a pipeline finishes, rather than waiting for the default seven-day time-to-live to expire.
Together, these updates transform Managed Agents into cost-controlled, schedulable workers that can operate autonomously inside real development environments. Developers looking to explore custom agent definitions, environment configurations, network rules, and advanced streaming patterns can consult the Gemini Interactions API overview and the managed agents quickstart guide. If you found this breakdown helpful, share it with your team or network — and let us know how your organization plans to use these new capabilities.