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

Gemini API Managed Agents: 3.6 Flash, hooks, and more
Managed Agents in Gemini API now default to Gemini 3.6 Flash. New environment hooks let you block, lint, or audit tool calls inside the sandbox. Also, we’ve added budget controls, scheduled triggers, and free tier access.
Managed Agents in Gemini API are getting environment hooks, model selection, and free tier access. These capabilities build on our previous release introducing background tasks and remote MCP server integration.
With managed agents in the Gemini Interactions API, a single API call coordinates, reasoning, code execution, package installation, file management, and web retrieval inside an isolated cloud sandbox.
If you’re using an AI coding assistant, drop this in your terminal to give it access to the Interactions API skill: npx skills add google-gemini/gemini-skills --skill gemini-interactions-api.
Below are examples using the @google/genai TypeScript/JavaScript SDK. For Python or cURL, check out the Antigravity agent documentation.
npm install @google/genai
Gemini 3.6 Flash is now the default
The antigravity-preview-05-2026 agent now runs Gemini 3.6 Flash by default. No code changes are required. Your next interaction picks it up automatically.
You can also explicitly select models by passing agent_config.model when creating an interaction or managed agent. Use Gemini 3.5 Flash-Lite for lower cost, or pin to your model of preference.
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Audit all dependencies in package.json, upgrade outdated packages, and verify the build by running npm test.",
environment: "remote",
agent_config: {
type: "antigravity",
model: "gemini-3.5-flash-lite",
},
});
console.log(interaction.output_text);
Supported models include:
- Gemini 3.6 Flash (
gemini-3.6-flash, default): Balanced model for reasoning, coding, and tool use. - Gemini 3.5 Flash (
gemini-3.5-flash): Previous generation for general agentic workflows. - Gemini 3.5 Flash-Lite (
gemini-3.5-flash-lite): Lowest latency and cost on the Gemini 3.5 family.
Environment hooks: block, lint, and audit tool calls inside the sandbox
Environment hooks let you run your custom scripts before or after every tool call the agent makes inside its sandbox. Add a .agents/hooks.json into your environment and the runtime executes your handlers on pre_tool_execution or post_tool_execution events.
The matcher field supports regular expressions, allowing you to target multiple tools with | or catch everything with *:
{
"security-gate": {
"pre_tool_execution": [
{
"matcher": "code_execution|write_file",
"hooks": [
{
"type": "command",
"command": "python3 /.agents/hooks-scripts/gate.py",
"timeout": 10
}
]
}
]
},
"auto-format": {
"post_tool_execution": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "python3 /.agents/hooks-scripts/auto_lint.py",
"timeout": 15
}
]
}
]
}
}
In this configuration:
- The
security-gategroup runsgate.pybefore everycode_executionorwrite_filecall. 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-formatgroup runsauto_lint.pyafter every tool finishes to enforce code styling. - Hooks also support
httptype handlers that POST directly to an external endpoint.
For complete HTTP hook definitions and failure handling semantics, refer to the hooks documentation.
Teams are already using hooks to build production-grade validation pipelines. For example, AI-native investment bank Offdeal uses post_tool_execution hooks to run automated image verification inside the remote sandbox.
“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.”
– Alston Lin, Founder & CTO of OffDeal
Cost control and automation features
Free tier availability
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.
Budget controls
Because managed agents execute multi-turn autonomous loops, complex tasks can consume significant token budgets. To prevent runaway tasks, you can pass max_total_tokens inside agent_config to cap total consumption (input + output + thinking).
When the agent reaches the limit, execution safely pauses and the interaction returns status: "incomplete". The environment state is preserved, enabling you to continue where it stopped by passing previous_interaction_id with a fresh budget.
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Audit all modules in this repo and generate a migration report.",
agent_config: {
type: "antigravity",
max_total_tokens: 10000,
},
environment: "remote",
});
Scheduled execution with triggers
Automate recurring agent tasks with scheduled triggers. A trigger binds an agent, environment, prompt, and cron schedule into a persistent resource that fires without manual intervention. Each run reuses the same sandbox, so files persist across executions.
Environments API
The Environments API lets you list, inspect, and delete sandbox sessions from code. Recover environment IDs after a disconnect, or clean up sandboxes when your pipeline finishes instead of waiting for the 7-day TTL.
Get started with managed agents
These updates turn managed agents into cost-controlled, scheduled workers that operate autonomously inside real development environments without breaking your budget or requiring external orchestration.
Check out the Gemini Interactions API overview and the managed agents quickstart to explore custom agent definitions, environment configurations, network rules, and advanced streaming patterns.

⚡ Gemini 3.6 Flash as the Default Model
- Automatic upgrade: Managed agents now default to the new Gemini 3.6 Flash model, requiring zero code modifications.
- Efficiency gains: The 3.6 Flash model reduces overall output token usage by 17%, and cuts token consumption by up to 65% on long-horizon software engineering tasks.
- Manual selection: Developers can still override the default to choose Gemini 3.5 Flash or Gemini 3.5 Flash-Lite using
agent_config. [2, 3, 4, 5]
🪝 Synchronous Environment Hooks
- Tool intercepting: New synchronous hooks let you intercept code execution and file system tools inside the remote Linux sandbox.
- Pre & post events: Features explicit
pre_tool_executionandpost_tool_executionevent hooks. - Runtime guardrails: Allows you to block dangerous commands, lint code syntax, or audit tool actions using regex matching before they execute. [1, 2, 6, 7]
🛡️ Production & Budget Controls
- Runaway protection: Implements token budget limits via
max_total_tokensparameters to halt endless, runaway autonomous loops. - State preservation: When budget caps are triggered, the agent pauses automatically without losing its active sandbox environment state.
- Environments API: Provides new endpoints to inspect, list, and explicitly delete active sandboxed environments.
- Scheduled triggers: Supports background execution and automated task scheduling without requiring active HTTP socket connections. [2, 7, 8, 9, 10]
💸 Accessibility & Ecosystem Updates
- Free tier access: Managed agents are now available on free tier projects, allowing you to test agentic workflows with a standard API key without active billing. [1, 9]
- MCP Integration: Fully integrates with the remote Model Context Protocol (MCP) to seamlessly connect your custom tools and databases. [1, 2]
- Interactions API GA: The underlying Interactions API has reached general availability, rendering it Google’s primary default schema for Gemini development. [10]
- What specific tools (e.g., Python execution, bash commands, web search) your agent uses?
- If you need a code example showing how to structure the new environment hooks or budget parameters? [2, 6, 7]
Read more
. How to know if an image is AI generated or not
. Understanding the AI economy
. Apply now for the Google for Startups Gemini Startup Forum.
**********************************************************************
. Use Gemini in Google Forms to quickly create a new quiz
. Prevent accidental disclosures with new Reply All BCC warnings in Gmail
. Dilip Gavit Wins Gold & Mohammed Basil Wins Silver | Highlights | Commonwealth Games Glasgow 2026
. Play Points members and comic book fans can score exclusive rewards with Google Play
. Google is signing the EU AI Act Code of Practice on Transparency of AI-Generated Content
. Gemini Robotics 2 brings whole body intelligence to robots
. NOAA and Google Cloud collaborate to advance weather forecasting.
. Google Workspace Weekly Recap – July 31, 2026
. Meet Qwen3.8-Max: A New Bar for Coding and Cowork
. 5 ways to host the ultimate dinner party with Google Search
. 5 ways AI Mode in Search helps you enjoy the real world
. These Google Trends show people really want to touch grass
. 2026-07-01 124 344 Codex Pets Meet The Team USEN YOUTUBE 1920×1080
. OpenAI’s New AI ASTRA Is Total Overkill (Ends The GPT Era)
. 3 new ways nonprofits can put AI to work
for more refer Gemini website click here
for more refer Artificial Intelligence website click here

