Google shipped its second major update to Gemini API Managed Agents in three weeks. The July 28 release adds environment hooks, scheduled cron triggers, token budget controls, and free tier access — and quietly upgrades every existing agent to Gemini 3.6 Flash with zero code changes required. If the July 7 update made managed agents interesting, this one makes them worth building on in production.
Environment Hooks: Finally, a Compliance Gate Inside the Sandbox
The most substantive addition is environment hooks. Add a hooks.json file to your agent’s environment and the runtime will execute your handlers at two points in every tool call: before execution (pre_tool_execution) and after (post_tool_execution). The matcher field takes a regular expression, so one rule can intercept both code_execution and write_file, or catch everything with *.
When a pre-hook blocks a tool call, the reason flows back into the model’s context — the agent can adapt rather than silently fail. Here’s the minimal structure:
{
"groups": [
{
"name": "security-gate",
"hooks": [
{
"event": "pre_tool_execution",
"matcher": "code_execution|write_file",
"type": "command",
"command": "python gate.py",
"timeout": 5
}
]
}
]
}
The real-world case Google highlighted is instructive. OffDeal, a YC-backed AI investment bank, uses post-tool hooks to run a logo verification pipeline the moment their AI analyst generates a company list. Before this update, they couldn’t enforce pixel-level quality checks — correct company, right resolution, transparent background — inside a managed agent sandbox. Now they can. That’s the kind of compliance gate that was previously impossible without wrapping the API in external validation logic.
Hooks cover the tools Google runs inside the container: code execution, plus file read, write, list, and delete operations.
Scheduled Triggers: No More External Orchestrator
The second headline feature is cron triggers. You bind an agent, a prompt, an environment, and a cron expression into a persistent resource. It fires on its own schedule — no HTTP call, no Lambda function, no Airflow DAG. Standard Unix cron syntax. The trigger pauses itself automatically after five consecutive failures, which is the kind of production-safety detail that matters at 3 AM when you’d rather not be paged.
The detail worth noting: every scheduled run reuses the same sandbox. Files written by one execution are visible to the next. This means you can build genuinely stateful recurring workflows — a nightly code analysis that reads yesterday’s results, or a daily report agent that accumulates context over time — without building a persistence layer yourself.
Token Budget Controls and the Cost Predictability Problem
Production agent deployments have one consistent problem: runaway token consumption. The new max_total_tokens parameter in agent_config addresses this directly. When an agent hits the limit, it pauses cleanly and returns status: "incomplete". The environment state is preserved. Resume by passing previous_interaction_id with a fresh budget.
This is not exciting but it is necessary. Any agent running in a real pipeline needs a cost ceiling.
3.6 Flash Default and the Free Tier
All managed agents now default to Gemini 3.6 Flash. Existing Antigravity preview users don’t need to change anything — the upgrade is automatic. 3.6 Flash completes agentic workflows with fewer token-burning reasoning steps than 3.5 Flash, so most pipelines should see measurable efficiency gains without touching a line of code.
Managed agents are also now available on the Gemini API free tier. Experiment without enabling billing — standard Flash rate limits apply (roughly 10 requests per minute, 1,500 per day). One catch worth flagging: if you enable billing on a project, the free tier disappears on that project entirely. Keep your prototyping on a separate API key project if you want to stay on free tier.
What to Do Next
The hooks documentation is live on Google AI. The official announcement includes the full feature breakdown. If you’re already on managed agents from the July 7 update, everything in this release is live on your existing setup. If you haven’t tried managed agents yet, the free tier is now a reasonable starting point — spin up a sandboxed agent, mount a hooks.json, and see what a compliance gate looks like in practice before committing to a paid tier.













