Gemini API Managed Agents: 3.6 Flash, hooks, and more
We’re announcing even more new capabilities in Managed Agents in Gemini API so developers can build reliable, production-ready agents.
Managed Agents in Google's Gemini API have received several enhancements, including environment hooks, model selection options, and free tier access. These improvements build upon previous additions such as background tasks and remote MCP server integration. A single API call now coordinates reasoning, code execution, package installation, file management, and web retrieval within an isolated cloud sandbox.
To access the Interactions API skill, users can run the command `npx skills add google-gemini/gemini-skills --skill gemini-interactions-api` in their terminal.
Examples of using the @google/genai TypeScript/JavaScript SDK are provided, with Python and cURL instructions available in the Antigravity agent documentation. The Antigravity agent, updated to run Gemini 3.6 Flash by default, requires no code modifications once activated. Users can also explicitly select models by specifying `agent_config.model` when creating an interaction or managed agent. Lower-cost Gemini 3.5 Flash-Lite and user-defined models are available for selection.
Environment hooks enable users to run custom scripts before or after every tool call the agent makes inside its sandbox. By adding a `.agents/hooks.json` file to the environment, the runtime executes the handlers on pre_tool_execution or post_tool_execution events. The matcher field supports regular expressions, allowing targeting of multiple tools with `|` or catching all tools with `*`. Detailed HTTP hook definitions and failure handling semantics can be found in the hooks documentation.
Teams have already utilized hooks to create production-grade validation pipelines. For instance, investment bank Offdeal employs post_tool_execution hooks to run automated image verification inside the remote sandbox. This ensures company logos meet specific criteria, such as correct branding, size, aspect ratio, transparency, and contrast, before being published to a slide deck.
Managed agents are now available on free tier projects, enabling developers to experiment with agentic workflows using a key from a billing-free project. To prevent excessive token consumption, developers can set a maximum total token limit within `agent_config`. If the agent reaches the limit, execution safely pauses, returning a status of "incomplete." The environment state remains preserved, allowing users to continue where they left off by passing `previous_interaction_id` with a fresh budget.
Scheduling recurring agent tasks is possible through scheduled triggers. This feature binds an agent, environment, prompt, and cron schedule into a single resource, executing without manual intervention. Each run utilizes the same sandbox, permitting file persistence across executions. The Environments API allows users to list, inspect, and delete sandbox sessions from code, preserving environment IDs after disconnection or cleaning up sandboxes upon pipeline completion instead of waiting for the 7-day TTL.
These updates position managed agents as cost-controlled, scheduled workers operating autonomously within real development environments while respecting budget constraints and avoiding external orchestration requirements.
Written by urgent.news from Google AI Blog's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.