Skip to content
Main Site News Console

Gemini API Hosted Proxy: 3.6 Flash, Hooks, and More

· Google AI Translated
GoogleGemini

July 28, 2026

Managed Agents in the Gemini API Now Default to Gemini 3.6 Flash

Managed Agents in the Gemini API now use Gemini 3.6 Flash by default. New environment hooks let you intercept, inspect, or audit tool calls within the sandbox. We’ve also added budget controls, scheduled triggers, and free-tier access.

Philipp Schmid
Google DeepMind, Staff Technical Lead

Mariano Cocirio
Google DeepMind, Product Manager

Managed Agents in the Gemini API now support environment hooks, model selection, and free-tier access. These features build on the previously announced background tasks and remote MCP server integrations.

With Managed Agents in the Gemini Interactions API, a single API call can coordinate reasoning, code execution, package installation, file management, and web retrieval inside an isolated cloud sandbox.

If you’re using an AI coding assistant, run the following command in your terminal to give it the Interactions API skill:

Terminal window
npx skills add google-gemini/gemini-skills --skill gemini-interactions-api

The examples below use the @google/genai TypeScript/JavaScript SDK. For Python or cURL usage, see the Antigravity agent documentation.

Terminal window
npm install @google/genai

Gemini 3.6 Flash Is Now the Default Model

The antigravity-preview-05-2026 agent now runs Gemini 3.6 Flash by default. No code changes are required—the next interaction will automatically use this model.

You can also explicitly select a model when creating an interaction or Managed Agent by passing agent_config.model. To reduce costs, you can use Gemini 3.5 Flash-Lite, or pin the agent to your preferred model.

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): A balanced model for reasoning, coding, and tool use.
  • Gemini 3.5 Flash (gemini-3.5-flash): The previous-generation model for general-purpose agent workflows.
  • Gemini 3.5 Flash-Lite (gemini-3.5-flash-lite): The lowest-latency, lowest-cost model in the Gemini 3.5 family.

Environment Hooks: Intercept, Inspect, and Audit Tool Calls in the Sandbox

Environment hooks let you run custom scripts before or after every tool call executed by an agent in the sandbox. After adding .agents/hooks.json to the environment, the runtime executes the corresponding handlers when a pre_tool_execution or post_tool_execution event occurs.

The matcher field supports regular expressions. Use | to match multiple tools or * to match all tools:

{
"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-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 reason for the denial is passed into the model context.
  • The auto-format group runs auto_lint.py after every tool execution to enforce code style guidelines.
  • Hooks also support http handlers, which can send POST requests directly to external endpoints.

For the complete HTTP hook definition and failure-handling semantics, see the hook documentation.

Some teams are already using hooks to build production-grade validation pipelines. For example, AI-native investment bank OffDeal uses a post_tool_execution hook to run automated image validation inside a remote sandbox.

“OffDeal is an AI-native investment bank, and Archie is the AI analyst our bankers use every day. Company logos are essential for creating banker-facing presentations: more than 30 logos typically appear across buyer tables, sponsor columns, and tombstone grids. Each logo must correspond to the correct company, have the appropriate size and aspect ratio, include the company name, have a transparent background, and maintain high contrast when placed on a white slide.

Before agent hooks, we couldn’t do this with Gemini’s Managed Agents: because the sandbox is remote, there was nowhere to run our validation code. With hooks, the post_tool_execution hook triggers our pipeline inside the sandbox the moment Archie writes the company list: it retrieves candidate logos, performs pixel-level quality checks, uses Gemini Vision to validate each logo, and publishes a list of approved files. Only those images can then be added to the presentation.”

—Alston Lin, Founder and CTO of OffDeal

Cost Controls and Automation Features

Free-Tier Availability

Managed Agents now support free-tier projects. Developers can use an API key from a project without active billing enabled to experiment with agent workflows.

Budget Controls

Because Managed Agents execute multiple autonomous loops, complex tasks can consume a large token budget. To prevent tasks from running out of control, pass max_total_tokens in agent_config to limit total token consumption, including input, output, and thinking tokens.

When the agent reaches this limit, execution pauses safely, and the interaction returns status: "incomplete". The environment state is preserved, so you can continue execution from where it stopped by passing previous_interaction_id and setting a new budget.

const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "A