Back to News Feed
Google AI Blog36d ago{"$":{"xmlns:author":"http://www.w3.org/2005/Atom"},"name":["Philipp Schmid"],"title":["Member of the Technical Staff"],"department":["Google DeepMind"],"company":[""]}

Gemini API Managed Agents: 3.6 Flash, hooks, and more

Google DeepMind has unveiled a significant expansion to the Managed Agents capabilities within the Gemini API, marking a major step forward for developers aiming to deploy reliable, production-grade AI agents. By introducing environment hooks, granular model selection, and robust budget controls, Google is providing the infrastructure necessary to move beyond experimental workflows into fully autonomous, enterprise-ready systems.

These latest updates build upon the foundation established by previous releases, which introduced remote MCP server integration and background task management. With the Gemini Interactions API, developers can execute a single API call to orchestrate complex reasoning, code execution, package management, and web retrieval within a secure, isolated cloud sandbox.

Gemini 3.6 Flash: The New Default

The most immediate change for developers is the transition to Gemini 3.6 Flash as the default model for the antigravity-preview-05-2026 agent. This update is seamless; existing integrations will automatically leverage the new model without requiring any modifications to the codebase.

For those requiring specific performance profiles, Google has introduced the ability to explicitly define the model via the agent_config.model parameter. This flexibility allows teams to optimize for cost, latency, or reasoning depth depending on the specific needs of the task.

  • Gemini 3.6 Flash (Default): Optimized for a balanced approach to reasoning, coding, and tool utilization.
  • Gemini 3.5 Flash: Retained for legacy support and established agentic workflows.
  • Gemini 3.5 Flash-Lite: The most cost-effective and low-latency option within the Gemini 3.5 family.

Introducing Environment Hooks

Perhaps the most transformative addition is the introduction of environment hooks. These allow developers to inject custom logic before or after any tool call executed within the agent’s sandbox. By placing a .agents/hooks.json file in the environment, developers can define handlers for pre_tool_execution or post_tool_execution events.

This feature enables sophisticated security and quality control pipelines. Using regular expressions, developers can target specific tools or apply global rules across all sandbox activities.

"Teams are already using hooks to build production-grade validation pipelines. For example, AI-native investment bank Offdeal uses post_tool_execution hooks to run automated image verification inside the remote sandbox."

The utility of these hooks is best illustrated by real-world applications. Alston Lin, Founder and CTO of Offdeal, explains how hooks solved a critical bottleneck for their AI analyst, Archie:

"Before agent hooks, we couldn’t do this on Gemini’s managed agents: the sandbox is remote, so our validation code had nowhere to run. With hooks, a post_tool_execution hook triggers our pipeline inside the sandbox the moment Archie writes its company list, fetching candidates, enforcing pixel-level quality checks, verifying each logo with Gemini vision, and publishing a manifest of approved files that are the only images allowed into the deck."

Cost Control and Operational Efficiency

As agents become more autonomous, managing token consumption and operational costs becomes paramount. To address this, Google has introduced several key management features:

  • Budget Controls: Developers can now set a max_total_tokens limit within the agent_config. If an agent hits this threshold, the execution pauses safely, returning an "incomplete" status. The state is preserved, allowing developers to resume the task later by passing the previous interaction ID along with a refreshed budget.
  • Free Tier Access: Managed agents are now accessible to developers on the free tier, allowing for experimentation and prototyping without the requirement of an active billing account.
  • Scheduled Triggers: To support recurring tasks, Google has added scheduled execution. This allows developers to bind an agent, environment, and prompt to a cron schedule, ensuring persistent resources and file reuse across multiple runs without manual intervention.
  • Environments API: This new interface allows for the programmatic inspection, listing, and deletion of sandbox sessions. It provides developers with the ability to clean up resources efficiently or recover environment IDs after a disconnection, moving away from reliance on the default 7-day time-to-live (TTL).

Getting Started

These enhancements transform Managed Agents from simple experimental tools into sophisticated, cost-controlled, and scheduled workers. By providing the hooks necessary for security and validation, alongside the operational controls required for production, Google is significantly lowering the barrier to entry for building complex, autonomous AI systems.

For developers looking to integrate these features, the Gemini Interactions API documentation provides comprehensive guides on custom agent definitions, network rule configurations, and advanced streaming patterns. Whether you are building an AI-native financial analyst or an automated code-auditing pipeline, these new capabilities offer the control and reliability needed to scale your agentic workflows effectively.

To begin, developers can install the latest SDK via npm: npm install @google/genai

For those utilizing Python or cURL, full documentation is available via the Antigravity agent resources, providing a clear path to implementing these powerful new features in your next project.

#agents#api#developer