{"id":49410,"topic":"ai","source":"blog.google","title":"Gemini API Managed Agents: 3.6 Flash, hooks, and more - blog.google","url":"https://blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","url_hash":"4f83eb85f710c5504e5c70c0d8e35025e746471c","author":"","summary":"<a href=\"https://news.google.com/rss/articles/CBMiugFBVV95cUxPVjZ3STZxcEtMM2xXUTFpSG1xTXJramphRGZuOFp6aC1CQnNhZVpfQlpGQjJBNmgxMDJvYXdoamdvbXVEelNPeXJXdFdaamdaNEVPeG1tLS1vaHFMMERuTk43OTBqX2xKcWp5N2UyTmFLaExtb3pvXzBGZDZvSjNPNE1aLURLUXlwTW5GTGh5ckRqbkUtYkdRTUhhSUFuNVlPS1lTcTE2eFdDMVUyZ1Fpb2VMMUo4OG1uU1E?oc=5\" target=\"_blank\">Gemini API Managed Agents: 3.6 Flash, hooks, and more</a>&nbsp;&nbsp;<font color=\"#6f6f6f\">blog.google</font>","content":"Gemini API Managed Agents: 3.6 Flash, hooks, and more\nManaged 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.\nWith 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.\nIf 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.\nBelow are examples using the @google/genai TypeScript/JavaScript SDK. For Python or cURL, check out the Antigravity agent documentation.\nnpm install @google/genaiGemini 3.6 Flash is now the default\nThe 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.\nYou 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.\nimport { GoogleGenAI } from \"@google/genai\";\nconst client = new GoogleGenAI({});\nconst interaction = await client.interactions.create({\n  agent: \"antigravity-preview-05-2026\",\n  input: \"Audit all dependencies in package.json, upgrade outdated packages, and verify the build by running npm test.\",\n  environment: \"remote\",\n  agent_config: {\n    type: \"antigravity\",\n    model: \"gemini-3.5-flash-lite\",\n  },\n});\nconsole.log(interaction.output_text);Supported models include:\n- Gemini 3.6 Flash (gemini-3.6-flash, default): Balanced model for reasoning, coding, and tool use.\n- Gemini 3.5 Flash (gemini-3.5-flash): Previous generation for general agentic workflows.\n- Gemini 3.5 Flash-Lite (gemini-3.5-flash-lite): Lowest latency and cost on the Gemini 3.5 family.\nEnvironment hooks: block, lint, and audit tool calls inside the sandbox\nEnvironment 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.\nThe matcher field supports regular expressions, allowing you to target multiple tools with | or catch everything with *:\n{\n  \"security-gate\": {\n    \"pre_tool_execution\": [\n      {\n        \"matcher\": \"code_execution|write_file\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 /.agents/hooks-scripts/gate.py\",\n            \"timeout\": 10\n          }\n        ]\n      }\n    ]\n  },\n  \"auto-format\": {\n    \"post_tool_execution\": [\n      {\n        \"matcher\": \"*\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 /.agents/hooks-scripts/auto_lint.py\",\n            \"timeout\": 15\n          }\n        ]\n      }\n    ]\n  }\n}In this configuration:\n- 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.\n- The auto-formatgroup runsauto_lint.pyafter every tool finishes to enforce code styling.\n- Hooks also support httptype handlers that POST directly to an external endpoint.\nFor complete HTTP hook definitions and failure handling semantics, refer to the hooks documentation.\nTeams 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.\n\"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.\nBefore 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.\"\n- Alston Lin, Founder & CTO of OffDeal\nCost control and automation features\nFree tier availability\nManaged agents are now available on free tier projects. Developers can experiment with agentic workflows using an API key from a project without active billing.\nBudget controls\nBecause 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).\nWhen 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.\nconst interaction = await client.interactions.create({\n  agent: \"antigravity-preview-05-2026\",\n  input: \"Audit all modules in this repo and generate a migration report.\",\n  agent_config: {\n    type: \"antigravity\",\n    max_total_tokens: 10000,\n  },\n  environment: \"remote\",\n});Scheduled execution with triggers\nAutomate 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.\nEnvironments API\nThe 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.\nGet started with managed agents\nThese updates turn managed agents into cost-controlled, scheduled workers that operate autonomously inside real development environments without breaking your budget or requiring external orchestration.\nCheck out the Gemini Interactions API overview and the managed agents quickstart to explore custom agent definitions, environment configurations, network rules, and advanced streaming patterns.","image_url":"https://storage.googleapis.com/gweb-uniblog-publish-prod/images/unnamed_2_vNnOv20.width-1300.png","lang":"en","published_at":"2026-07-28T16:00:42+00:00","fetched_at":"2026-07-30T03:15:05+00:00","status":"read","starred":0,"extract_state":"ok","summary_auto":"Gemini API Managed Agents: 3.6 Flash, hooks, and more\nManaged 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.","cluster_id":null,"extract_retries":0,"extract_error":null,"contract_version":"news_item.v1","format_contract_version":"news_item_formats.v1","dedup_url":"https://blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","quality_profile":{"profile_version":"extraction_quality.v2","bucket":"high","confidence":0.9,"failure_kind":"none","retryable":false,"retry_after_attempts":0,"reason":"High confidence: full text extraction produced 6602 characters.","operator_guidance":{"severity":"ok","recommended_action":"trust_full_text","next_step":"Use the extracted full text as the primary article source.","operator_label":"Ready","can_retry":false,"can_use_summary":false,"diagnostics_required":false},"content_depth":{"contract_version":"content_depth.v1","category":"full_text","label":"Full text","has_full_text":true,"has_summary":true,"content_length":6602,"summary_length":265,"usable_text_length":6602,"source_field":"content"},"legacy_collapsed":false,"signals":{"extract_state":"ok","extract_error":null,"extract_retries":0,"content_length":6602,"summary_length":265}},"news_item":{"id":49410,"canonical_url":"https://blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","source_url":"https://blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","title":"Gemini API Managed Agents: 3.6 Flash, hooks, and more - blog.google","source_name":"blog.google","author":null,"published_at":"2026-07-28T16:00:42+00:00","locale":"en","topic":"ai","tags":[],"rss_summary":"<a href=\"https://news.google.com/rss/articles/CBMiugFBVV95cUxPVjZ3STZxcEtMM2xXUTFpSG1xTXJramphRGZuOFp6aC1CQnNhZVpfQlpGQjJBNmgxMDJvYXdoamdvbXVEelNPeXJXdFdaamdaNEVPeG1tLS1vaHFMMERuTk43OTBqX2xKcWp5N2UyTmFLaExtb3pvXzBGZDZvSjNPNE1aLURLUXlwTW5GTGh5ckRqbkUtYkdRTUhhSUFuNVlPS1lTcTE2eFdDMVUyZ1Fpb2VMMUo4OG1uU1E?oc=5\" target=\"_blank\">Gemini API Managed Agents: 3.6 Flash, hooks, and more</a>&nbsp;&nbsp;<font color=\"#6f6f6f\">blog.google</font>","full_text":"Gemini API Managed Agents: 3.6 Flash, hooks, and more\nManaged 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.\nWith 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.\nIf 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.\nBelow are examples using the @google/genai TypeScript/JavaScript SDK. For Python or cURL, check out the Antigravity agent documentation.\nnpm install @google/genaiGemini 3.6 Flash is now the default\nThe 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.\nYou 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.\nimport { GoogleGenAI } from \"@google/genai\";\nconst client = new GoogleGenAI({});\nconst interaction = await client.interactions.create({\n  agent: \"antigravity-preview-05-2026\",\n  input: \"Audit all dependencies in package.json, upgrade outdated packages, and verify the build by running npm test.\",\n  environment: \"remote\",\n  agent_config: {\n    type: \"antigravity\",\n    model: \"gemini-3.5-flash-lite\",\n  },\n});\nconsole.log(interaction.output_text);Supported models include:\n- Gemini 3.6 Flash (gemini-3.6-flash, default): Balanced model for reasoning, coding, and tool use.\n- Gemini 3.5 Flash (gemini-3.5-flash): Previous generation for general agentic workflows.\n- Gemini 3.5 Flash-Lite (gemini-3.5-flash-lite): Lowest latency and cost on the Gemini 3.5 family.\nEnvironment hooks: block, lint, and audit tool calls inside the sandbox\nEnvironment 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.\nThe matcher field supports regular expressions, allowing you to target multiple tools with | or catch everything with *:\n{\n  \"security-gate\": {\n    \"pre_tool_execution\": [\n      {\n        \"matcher\": \"code_execution|write_file\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 /.agents/hooks-scripts/gate.py\",\n            \"timeout\": 10\n          }\n        ]\n      }\n    ]\n  },\n  \"auto-format\": {\n    \"post_tool_execution\": [\n      {\n        \"matcher\": \"*\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 /.agents/hooks-scripts/auto_lint.py\",\n            \"timeout\": 15\n          }\n        ]\n      }\n    ]\n  }\n}In this configuration:\n- 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.\n- The auto-formatgroup runsauto_lint.pyafter every tool finishes to enforce code styling.\n- Hooks also support httptype handlers that POST directly to an external endpoint.\nFor complete HTTP hook definitions and failure handling semantics, refer to the hooks documentation.\nTeams 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.\n\"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.\nBefore 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.\"\n- Alston Lin, Founder & CTO of OffDeal\nCost control and automation features\nFree tier availability\nManaged agents are now available on free tier projects. Developers can experiment with agentic workflows using an API key from a project without active billing.\nBudget controls\nBecause 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).\nWhen 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.\nconst interaction = await client.interactions.create({\n  agent: \"antigravity-preview-05-2026\",\n  input: \"Audit all modules in this repo and generate a migration report.\",\n  agent_config: {\n    type: \"antigravity\",\n    max_total_tokens: 10000,\n  },\n  environment: \"remote\",\n});Scheduled execution with triggers\nAutomate 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.\nEnvironments API\nThe 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.\nGet started with managed agents\nThese updates turn managed agents into cost-controlled, scheduled workers that operate autonomously inside real development environments without breaking your budget or requiring external orchestration.\nCheck out the Gemini Interactions API overview and the managed agents quickstart to explore custom agent definitions, environment configurations, network rules, and advanced streaming patterns.","excerpt":"Gemini API Managed Agents: 3.6 Flash, hooks, and more\nManaged 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.","extraction":{"state":"ok","confidence":0.9,"error":null,"explanation":"High confidence: full text extraction produced 6602 characters.","diagnostics_url":"/api/diagnose?url=https%3A//blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","quality_profile":{"profile_version":"extraction_quality.v2","bucket":"high","confidence":0.9,"failure_kind":"none","retryable":false,"retry_after_attempts":0,"reason":"High confidence: full text extraction produced 6602 characters.","operator_guidance":{"severity":"ok","recommended_action":"trust_full_text","next_step":"Use the extracted full text as the primary article source.","operator_label":"Ready","can_retry":false,"can_use_summary":false,"diagnostics_required":false},"content_depth":{"contract_version":"content_depth.v1","category":"full_text","label":"Full text","has_full_text":true,"has_summary":true,"content_length":6602,"summary_length":265,"usable_text_length":6602,"source_field":"content"},"legacy_collapsed":false,"signals":{"extract_state":"ok","extract_error":null,"extract_retries":0,"content_length":6602,"summary_length":265}}},"display_formats":["compact","card","full","digest_section","json"]},"daily_stack_record":{"title":"Gemini API Managed Agents: 3.6 Flash, hooks, and more - blog.google","url":"https://blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","summary":"Gemini API Managed Agents: 3.6 Flash, hooks, and more\nManaged 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.","source":"blog.google","date":"2026-07-28T16:00:42+00:00","content":"Gemini API Managed Agents: 3.6 Flash, hooks, and more\nManaged 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.\nWith 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.\nIf 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.\nBelow are examples using the @google/genai TypeScript/JavaScript SDK. For Python or cURL, check out the Antigravity agent documentation.\nnpm install @google/genaiGemini 3.6 Flash is now the default\nThe 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.\nYou 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.\nimport { GoogleGenAI } from \"@google/genai\";\nconst client = new GoogleGenAI({});\nconst interaction = await client.interactions.create({\n  agent: \"antigravity-preview-05-2026\",\n  input: \"Audit all dependencies in package.json, upgrade outdated packages, and verify the build by running npm test.\",\n  environment: \"remote\",\n  agent_config: {\n    type: \"antigravity\",\n    model: \"gemini-3.5-flash-lite\",\n  },\n});\nconsole.log(interaction.output_text);Supported models include:\n- Gemini 3.6 Flash (gemini-3.6-flash, default): Balanced model for reasoning, coding, and tool use.\n- Gemini 3.5 Flash (gemini-3.5-flash): Previous generation for general agentic workflows.\n- Gemini 3.5 Flash-Lite (gemini-3.5-flash-lite): Lowest latency and cost on the Gemini 3.5 family.\nEnvironment hooks: block, lint, and audit tool calls inside the sandbox\nEnvironment 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.\nThe matcher field supports regular expressions, allowing you to target multiple tools with | or catch everything with *:\n{\n  \"security-gate\": {\n    \"pre_tool_execution\": [\n      {\n        \"matcher\": \"code_execution|write_file\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 /.agents/hooks-scripts/gate.py\",\n            \"timeout\": 10\n          }\n        ]\n      }\n    ]\n  },\n  \"auto-format\": {\n    \"post_tool_execution\": [\n      {\n        \"matcher\": \"*\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 /.agents/hooks-scripts/auto_lint.py\",\n            \"timeout\": 15\n          }\n        ]\n      }\n    ]\n  }\n}In this configuration:\n- 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.\n- The auto-formatgroup runsauto_lint.pyafter every tool finishes to enforce code styling.\n- Hooks also support httptype handlers that POST directly to an external endpoint.\nFor complete HTTP hook definitions and failure handling semantics, refer to the hooks documentation.\nTeams 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.\n\"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.\nBefore 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.\"\n- Alston Lin, Founder & CTO of OffDeal\nCost control and automation features\nFree tier availability\nManaged agents are now available on free tier projects. Developers can experiment with agentic workflows using an API key from a project without active billing.\nBudget controls\nBecause 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).\nWhen 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.\nconst interaction = await client.interactions.create({\n  agent: \"antigravity-preview-05-2026\",\n  input: \"Audit all modules in this repo and generate a migration report.\",\n  agent_config: {\n    type: \"antigravity\",\n    max_total_tokens: 10000,\n  },\n  environment: \"remote\",\n});Scheduled execution with triggers\nAutomate 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.\nEnvironments API\nThe 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.\nGet started with managed agents\nThese updates turn managed agents into cost-controlled, scheduled workers that operate autonomously inside real development environments without breaking your budget or requiring external orchestration.\nCheck out the Gemini Interactions API overview and the managed agents quickstart to explore custom agent definitions, environment configurations, network rules, and advanced streaming patterns.","confidence":0.9,"diagnostics_url":"/api/diagnose?url=https%3A//blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","quality_bucket":"high","failure_kind":"none","retryable":false,"quality_reason":"High confidence: full text extraction produced 6602 characters.","quality_profile":{"profile_version":"extraction_quality.v2","bucket":"high","confidence":0.9,"failure_kind":"none","retryable":false,"retry_after_attempts":0,"reason":"High confidence: full text extraction produced 6602 characters.","operator_guidance":{"severity":"ok","recommended_action":"trust_full_text","next_step":"Use the extracted full text as the primary article source.","operator_label":"Ready","can_retry":false,"can_use_summary":false,"diagnostics_required":false},"content_depth":{"contract_version":"content_depth.v1","category":"full_text","label":"Full text","has_full_text":true,"has_summary":true,"content_length":6602,"summary_length":265,"usable_text_length":6602,"source_field":"content"},"legacy_collapsed":false,"signals":{"extract_state":"ok","extract_error":null,"extract_retries":0,"content_length":6602,"summary_length":265}},"tags":[]},"fallback_formats":["markdown","json","html"],"actions":{"read":"/item/49410","export_markdown":"/api/items/49410/export?format=markdown","export_json":"/api/items/49410/export?format=json","diagnose":"/api/diagnose?url=https%3A//blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/"},"formats":{"full":{"id":49410,"title":"Gemini API Managed Agents: 3.6 Flash, hooks, and more - blog.google","url":"https://blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","source":"blog.google","author":null,"published_at":"2026-07-28T16:00:42+00:00","locale":"en","topic":"ai","tags":[],"excerpt":"Gemini API Managed Agents: 3.6 Flash, hooks, and more\nManaged 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.","full_text":"Gemini API Managed Agents: 3.6 Flash, hooks, and more\nManaged 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.\nWith 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.\nIf 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.\nBelow are examples using the @google/genai TypeScript/JavaScript SDK. For Python or cURL, check out the Antigravity agent documentation.\nnpm install @google/genaiGemini 3.6 Flash is now the default\nThe 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.\nYou 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.\nimport { GoogleGenAI } from \"@google/genai\";\nconst client = new GoogleGenAI({});\nconst interaction = await client.interactions.create({\n  agent: \"antigravity-preview-05-2026\",\n  input: \"Audit all dependencies in package.json, upgrade outdated packages, and verify the build by running npm test.\",\n  environment: \"remote\",\n  agent_config: {\n    type: \"antigravity\",\n    model: \"gemini-3.5-flash-lite\",\n  },\n});\nconsole.log(interaction.output_text);Supported models include:\n- Gemini 3.6 Flash (gemini-3.6-flash, default): Balanced model for reasoning, coding, and tool use.\n- Gemini 3.5 Flash (gemini-3.5-flash): Previous generation for general agentic workflows.\n- Gemini 3.5 Flash-Lite (gemini-3.5-flash-lite): Lowest latency and cost on the Gemini 3.5 family.\nEnvironment hooks: block, lint, and audit tool calls inside the sandbox\nEnvironment 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.\nThe matcher field supports regular expressions, allowing you to target multiple tools with | or catch everything with *:\n{\n  \"security-gate\": {\n    \"pre_tool_execution\": [\n      {\n        \"matcher\": \"code_execution|write_file\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 /.agents/hooks-scripts/gate.py\",\n            \"timeout\": 10\n          }\n        ]\n      }\n    ]\n  },\n  \"auto-format\": {\n    \"post_tool_execution\": [\n      {\n        \"matcher\": \"*\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 /.agents/hooks-scripts/auto_lint.py\",\n            \"timeout\": 15\n          }\n        ]\n      }\n    ]\n  }\n}In this configuration:\n- 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.\n- The auto-formatgroup runsauto_lint.pyafter every tool finishes to enforce code styling.\n- Hooks also support httptype handlers that POST directly to an external endpoint.\nFor complete HTTP hook definitions and failure handling semantics, refer to the hooks documentation.\nTeams 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.\n\"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.\nBefore 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.\"\n- Alston Lin, Founder & CTO of OffDeal\nCost control and automation features\nFree tier availability\nManaged agents are now available on free tier projects. Developers can experiment with agentic workflows using an API key from a project without active billing.\nBudget controls\nBecause 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).\nWhen 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.\nconst interaction = await client.interactions.create({\n  agent: \"antigravity-preview-05-2026\",\n  input: \"Audit all modules in this repo and generate a migration report.\",\n  agent_config: {\n    type: \"antigravity\",\n    max_total_tokens: 10000,\n  },\n  environment: \"remote\",\n});Scheduled execution with triggers\nAutomate 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.\nEnvironments API\nThe 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.\nGet started with managed agents\nThese updates turn managed agents into cost-controlled, scheduled workers that operate autonomously inside real development environments without breaking your budget or requiring external orchestration.\nCheck out the Gemini Interactions API overview and the managed agents quickstart to explore custom agent definitions, environment configurations, network rules, and advanced streaming patterns.","reading_time_min":4,"extraction":{"state":"ok","confidence":0.9,"error":null,"explanation":"High confidence: full text extraction produced 6602 characters.","diagnostics_url":"/api/diagnose?url=https%3A//blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","quality_profile":{"profile_version":"extraction_quality.v2","bucket":"high","confidence":0.9,"failure_kind":"none","retryable":false,"retry_after_attempts":0,"reason":"High confidence: full text extraction produced 6602 characters.","operator_guidance":{"severity":"ok","recommended_action":"trust_full_text","next_step":"Use the extracted full text as the primary article source.","operator_label":"Ready","can_retry":false,"can_use_summary":false,"diagnostics_required":false},"content_depth":{"contract_version":"content_depth.v1","category":"full_text","label":"Full text","has_full_text":true,"has_summary":true,"content_length":6602,"summary_length":265,"usable_text_length":6602,"source_field":"content"},"legacy_collapsed":false,"signals":{"extract_state":"ok","extract_error":null,"extract_retries":0,"content_length":6602,"summary_length":265}}},"quality_profile":{"profile_version":"extraction_quality.v2","bucket":"high","confidence":0.9,"failure_kind":"none","retryable":false,"retry_after_attempts":0,"reason":"High confidence: full text extraction produced 6602 characters.","operator_guidance":{"severity":"ok","recommended_action":"trust_full_text","next_step":"Use the extracted full text as the primary article source.","operator_label":"Ready","can_retry":false,"can_use_summary":false,"diagnostics_required":false},"content_depth":{"contract_version":"content_depth.v1","category":"full_text","label":"Full text","has_full_text":true,"has_summary":true,"content_length":6602,"summary_length":265,"usable_text_length":6602,"source_field":"content"},"legacy_collapsed":false,"signals":{"extract_state":"ok","extract_error":null,"extract_retries":0,"content_length":6602,"summary_length":265}},"actions":{"read":"/item/49410","export_markdown":"/api/items/49410/export?format=markdown","export_json":"/api/items/49410/export?format=json","diagnose":"/api/diagnose?url=https%3A//blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/"}},"digest":{"id":49410,"title":"Gemini API Managed Agents: 3.6 Flash, hooks, and more - blog.google","url":"https://blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","source":"blog.google","topic":"ai","published_at":"2026-07-28T16:00:42+00:00","excerpt":"Gemini API Managed Agents: 3.6 Flash, hooks, and more 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.","quality_bucket":"high","quality_reason":"High confidence: full text extraction produced 6602 characters.","reading_time_min":4,"cluster_id":null},"card":{"display_title":"Gemini API Managed Agents: 3.6 Flash, hooks, and more - blog.google","subtitle":"blog.google · 2026-07-28","summary":"Gemini API Managed Agents: 3.6 Flash, hooks, and more Managed Agents in Gemini API are getting environment hooks, model selection, and free tier access. These capabilities build on our previous release introducing…","badges":["quality:high"],"links":{"read":"/item/49410","original":"https://blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","diagnose":"/api/diagnose?url=https%3A//blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/"},"quality_warning":null},"export":{"title":"Gemini API Managed Agents: 3.6 Flash, hooks, and more - blog.google","url":"https://blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","summary":"Gemini API Managed Agents: 3.6 Flash, hooks, and more\nManaged 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.","source":"blog.google","date":"2026-07-28T16:00:42+00:00","content":"Gemini API Managed Agents: 3.6 Flash, hooks, and more\nManaged 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.\nWith 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.\nIf 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.\nBelow are examples using the @google/genai TypeScript/JavaScript SDK. For Python or cURL, check out the Antigravity agent documentation.\nnpm install @google/genaiGemini 3.6 Flash is now the default\nThe 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.\nYou 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.\nimport { GoogleGenAI } from \"@google/genai\";\nconst client = new GoogleGenAI({});\nconst interaction = await client.interactions.create({\n  agent: \"antigravity-preview-05-2026\",\n  input: \"Audit all dependencies in package.json, upgrade outdated packages, and verify the build by running npm test.\",\n  environment: \"remote\",\n  agent_config: {\n    type: \"antigravity\",\n    model: \"gemini-3.5-flash-lite\",\n  },\n});\nconsole.log(interaction.output_text);Supported models include:\n- Gemini 3.6 Flash (gemini-3.6-flash, default): Balanced model for reasoning, coding, and tool use.\n- Gemini 3.5 Flash (gemini-3.5-flash): Previous generation for general agentic workflows.\n- Gemini 3.5 Flash-Lite (gemini-3.5-flash-lite): Lowest latency and cost on the Gemini 3.5 family.\nEnvironment hooks: block, lint, and audit tool calls inside the sandbox\nEnvironment 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.\nThe matcher field supports regular expressions, allowing you to target multiple tools with | or catch everything with *:\n{\n  \"security-gate\": {\n    \"pre_tool_execution\": [\n      {\n        \"matcher\": \"code_execution|write_file\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 /.agents/hooks-scripts/gate.py\",\n            \"timeout\": 10\n          }\n        ]\n      }\n    ]\n  },\n  \"auto-format\": {\n    \"post_tool_execution\": [\n      {\n        \"matcher\": \"*\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 /.agents/hooks-scripts/auto_lint.py\",\n            \"timeout\": 15\n          }\n        ]\n      }\n    ]\n  }\n}In this configuration:\n- 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.\n- The auto-formatgroup runsauto_lint.pyafter every tool finishes to enforce code styling.\n- Hooks also support httptype handlers that POST directly to an external endpoint.\nFor complete HTTP hook definitions and failure handling semantics, refer to the hooks documentation.\nTeams 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.\n\"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.\nBefore 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.\"\n- Alston Lin, Founder & CTO of OffDeal\nCost control and automation features\nFree tier availability\nManaged agents are now available on free tier projects. Developers can experiment with agentic workflows using an API key from a project without active billing.\nBudget controls\nBecause 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).\nWhen 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.\nconst interaction = await client.interactions.create({\n  agent: \"antigravity-preview-05-2026\",\n  input: \"Audit all modules in this repo and generate a migration report.\",\n  agent_config: {\n    type: \"antigravity\",\n    max_total_tokens: 10000,\n  },\n  environment: \"remote\",\n});Scheduled execution with triggers\nAutomate 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.\nEnvironments API\nThe 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.\nGet started with managed agents\nThese updates turn managed agents into cost-controlled, scheduled workers that operate autonomously inside real development environments without breaking your budget or requiring external orchestration.\nCheck out the Gemini Interactions API overview and the managed agents quickstart to explore custom agent definitions, environment configurations, network rules, and advanced streaming patterns.","confidence":0.9,"diagnostics_url":"/api/diagnose?url=https%3A//blog.google/innovation-and-ai/technology/developers-tools/expanding-managed-agents-gemini-api-3-6-flash-hooks/","quality_bucket":"high","failure_kind":"none","retryable":false,"quality_reason":"High confidence: full text extraction produced 6602 characters.","quality_profile":{"profile_version":"extraction_quality.v2","bucket":"high","confidence":0.9,"failure_kind":"none","retryable":false,"retry_after_attempts":0,"reason":"High confidence: full text extraction produced 6602 characters.","operator_guidance":{"severity":"ok","recommended_action":"trust_full_text","next_step":"Use the extracted full text as the primary article source.","operator_label":"Ready","can_retry":false,"can_use_summary":false,"diagnostics_required":false},"content_depth":{"contract_version":"content_depth.v1","category":"full_text","label":"Full text","has_full_text":true,"has_summary":true,"content_length":6602,"summary_length":265,"usable_text_length":6602,"source_field":"content"},"legacy_collapsed":false,"signals":{"extract_state":"ok","extract_error":null,"extract_retries":0,"content_length":6602,"summary_length":265}},"tags":[],"format_contract_version":"news_item_formats.v1"}}}