All posts

Google's Gemini Managed Agents Just Got Cron Triggers, Budget Caps, and Hooks

Google pushed an update to Gemini API Managed Agents on July 28 that I've been waiting for. It's not a new model. It's the production scaffolding that…

Industrial electrical control panel with toggle switches, timer dials, and amber indicator lights

Google pushed an update to Gemini API Managed Agents on July 28 that I've been waiting for. It's not a new model. It's the production scaffolding that makes running agents as background workers actually viable: budget caps, cron triggers, environment hooks, and a proper API to manage the sandboxes. None of this is conceptually new, but it fills the gaps that made me nervous about committing to the platform for anything beyond a demo.

What They Shipped

Six things landed in this release. Gemini 3.6 Flash is now the default model for managed agents, with no code changes required. But the parts that matter operationally are the new production primitives.

Cron triggers. You bind an agent, a prompt, an environment, and a cron expression into a single persistent resource. The trigger fires on schedule without you doing anything. Each run reuses the same sandbox, so files written in one execution are visible to the next. If a run fails five times in a row, the trigger pauses itself and you have to explicitly re-enable it.

Budget controls. A max_total_tokens parameter caps total input + output + reasoning tokens for a task. When the agent hits that cap, it pauses cleanly rather than running off the rails. You can resume it from where it stopped. This is the feature I most wanted when billing was opaque per-run.

Environment hooks. Drop a .agents/hooks.json file into your environment and attach scripts to pre_tool_execution and post_tool_execution events. Pre-execution hooks can block a tool call from running, not just log it. That means you can enforce policies inside the sandbox without touching the agent prompt or model.

Environments API. List, inspect, and delete sandbox sessions programmatically. Before this, recovering an environment ID after a client disconnected was painful. Now you can query active sessions by agent ID and reconnect, or clean up sandboxes when a pipeline finishes instead of waiting for the 7-day automatic TTL.

A free tier is included in this release, which removes the barrier to experimenting.

Cron Triggers: The Feature That Changes Agent Architecture

Running an agent on a schedule sounds simple. The tricky part has always been state: if every run starts with a blank sandbox, you have to persist your own state externally and re-hydrate it each time. The shared-sandbox model changes that. Files persist across cron executions, so the agent can accumulate context, leave checkpoints, and pick up where it left off without you wiring up a separate storage layer.

The auto-pause after five consecutive failures is a detail that signals production thinking. A cron trigger that fails silently and keeps charging you is worse than one that stops and tells you something is broken. Five failures, then pause, you decide when to restart. That's how reliable batch pipelines are supposed to behave.

I haven't run this at scale yet. I don't know how the sandbox handles long-running file state across weeks of executions or what the storage limits look like. Those are the questions I'd answer before building anything critical on this, but the architecture is pointing in the right direction.

Hooks Change the Security Conversation

The pre-execution hook capability is the feature I'd demonstrate to any enterprise team evaluating this. The usual objection: "How do I know the agent won't do something it shouldn't?" Environment hooks give you a programmable answer. You define what tool calls are allowed, write a blocking handler, drop it in .agents/hooks.json, and the sandbox enforces it regardless of what the model decides to do.

This is still early. I'd want to understand the latency overhead per tool call, especially in a tight loop where you're calling many tools in sequence. But the direction is right. Moving policy enforcement into the infrastructure layer instead of the prompt is how you build something you can actually audit and hand off to another team.

The Budget Control That Actually Works

The max_total_tokens parameter is the right abstraction. Agent loops fail late, after consuming many tokens doing something you'd have stopped much earlier if you'd noticed. A hard cap with a clean pause and a resume path is the pattern you'd use in any well-designed distributed system. Pause, inspect state, decide whether to continue.

One thing I couldn't confirm: whether you can update the token budget mid-run, or whether it's set only at task creation. That matters for adaptive budget management based on intermediate results. Worth testing before you build around it.

Where This Leaves the Platform

Six months ago, Managed Agents felt like an experiment. The sandbox was interesting, model routing was smart, but the operational tooling was thin. With cron triggers, budget controls, hooks, and the Environments API, it's starting to look like a real platform for background agentic workers.

The framing I keep coming back to: this is closer to how you'd architect a traditional cron job pipeline, with LLM reasoning as one of the steps. If you've built reliable batch pipelines before, most of your instincts apply here. The new questions are about token budgets, model behavior under failure, and whether sandbox isolation holds when you're running multiple concurrent agents against the same environment.

For teams already on the Gemini API, this is worth prototyping against your next agent project. The free tier removes the excuse to wait.

Google's announcement on Gemini Managed Agents