Gemini API Managed Agents Add Hooks That Can Block Tool Calls, Plus Token Budgets

Google's July 28 update to Gemini API managed agents adds environment hooks that run scripts before and after tool calls, a max_total_tokens cap, cron-based scheduled triggers, free-tier access, and Gemini 3.6 Flash as the default model.

On July 28, Google published an update to managed agents in the Gemini API1. The notable addition is environment hooks, which run custom scripts before and after tool calls inside the sandbox (pre_tool_execution / post_tool_execution). Target tools can be selected with regex matchers, and pre-execution hooks can block an operation and return a denial reason1.

The update also adds max_total_tokens in agent_config, capping total consumption across input, output, and thinking. When the cap is reached, execution pauses and returns status: "incomplete", with the environment state preserved so the run can resume1. Also new: Triggers, which bind an agent, environment, prompt, and cron schedule into a single persistent resource for recurring runs; an Environments API for listing and deleting sandbox sessions; and availability on projects whose API keys have no active billing1. The antigravity-preview-05-2026 agent now defaults to Gemini 3.6 Flash with no code changes required, and agent_config.model can still select Gemini 3.5 Flash or 3.5 Flash-Lite explicitly1.

Sources

  1. Gemini API Managed Agents: 3.6 Flash, hooks, and more - Google official blog (Philipp Schmid, Mariano Cocirio, July 28, 2026)

We publish the latest AI news every day.

Subscribe via RSS Get new posts the moment they go live.

Search other keywords →