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

Admin

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

Google has added new hooks and cost-control features to managed agents in the Gemini API, while also expanding access to free tier projects. The changes are aimed at making agent workflows easier to validate, automate, and manage when tasks run across multiple tool calls.

In the new hook setup, the security-gate group runs gate.py before every code_execution or write_file call. If the script returns {"decision": "deny", "reason": "..."}, the tool call is skipped and the rejection reason is passed into the model’s context.

The auto-format group runs auto_lint.py after every tool finishes to enforce code styling. Hooks also support http type handlers that POST directly to an external endpoint. For complete HTTP hook definitions and failure handling semantics, refer to the hooks documentation.

Google said teams are already using hooks to build production-grade validation pipelines. It cited AI-native investment bank Offdeal, which uses post_tool_execution hooks to run automated image verification inside the remote sandbox.

Alston Lin, Founder & CTO of OffDeal, said: “OffDeal is an AI-native investment bank, and Archie is the AI analyst our bankers use every day. A requirement for banker-ready decks is company logos: buyer tables, sponsor columns, tombstone grids, often 30+ logos in a single deck, every one of which must be the right company, the appropriate size and aspect ratio, contain the name, have a transparent background, and have a high contrast when placed on a white slide.

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.”

Managed agents are now available on free tier projects. Developers can experiment with agentic workflows using an API key from a project without active billing.

Google also added a budget control for autonomous runs. Developers can pass max_total_tokens inside agent_config to cap total consumption, including input, output and thinking tokens.

When the agent reaches the limit, execution pauses and the interaction returns status: "incomplete". The environment state is preserved, allowing the task to continue later by passing previous_interaction_id with a fresh budget.

Source: blog.google.

Companies can share verified announcements through Newz9’s international press release submission page.