ai newsDo., 15. Okt.
EilmeldungMeta and Apple team up to make Muse AI models run better on Macs

Google AI Studio Managed Agents: Antigravity nutzt standardmaessig Gemini 3.6 Flash

Googles verwaltete Agenten in AI Studio erhalten ein grosses Update: Antigravity laeuft standardmaessig mit Gemini 3.6 Flash, ist im Free Tier verfuegbar und bietet Environment Hooks, mit denen sich einzelne Tool Calls im Sandbox-Umfeld blockieren, pruefen oder linten lassen. Ausserdem gibt es Token-Budget-Limits und Cron-Planung.

dev.toSamstag 05:43 · 10.10.DE14 Min. Lesezeit

Veröffentlicht am 10. Okt. • Zuerst erschienen auf aitecharchive.com

Die verwalteten Agenten von Google AI Studio haben am 28. Juli 2026 ihr bislang groesstes Upgrade erhalten: Der Antigravity-Agent nutzt nun standardmaessig Gemini 3.6 Flash, laeuft im kostenlosen Tarif und verfuegt ueber Environment-Hooks, mit denen sich jeder Tool-Aufruf innerhalb der Sandbox blockieren, pruefen oder linten laesst. Dazu kommen Token-Budget-Limits, cron-gesteuerte Trigger und eine programmierbare Environments API. Fuer Entwickler und kleine Teams, die Agent-Frameworks bisher nur vom Rand beobachtet haben, ist dies das erste Mal, dass sich ein produktionsreifer autonomer Agent ohne jegliche Infrastruktur und ohne Kosten bauen und testen laesst.

Fazit: Wer 2026 KI-Agenten entwickelt, findet in den verwalteten Agenten von Google AI Studio nun den schnellsten kostenlosen Weg von der Idee bis zum funktionierenden autonomen Workflow. Allein das Hooks-System, mit dem ein eigenes Skript jeden Tool-Aufruf des Agenten genehmigen oder ablehnen kann, loest das groesste praktische Problem autonomer Agenten: zu verhindern, dass sie Befehle ausfuehren, die nicht autorisiert wurden. Der kostenlose Tarif macht das Angebot fuer jeden mit Google-Konto zugaenglich, und die Token-Limits sowie die geplanten Trigger machen es produktionsreif statt nur ein Demo-Spielzeug.

Verwaltete Agenten sind von Google gehostete KI-Agenten, die autonom innerhalb einer isolierten Linux-Sandbox laufen. Ein einziger API-Aufruf an die Gemini API stellt die Sandbox bereit, und der Agent reasoning, schreibt und fuehrt Code aus, installiert Pakete, liest und schreibt Dateien und durchsucht das Web, ganz ohne dass Sie selbst Infrastruktur verwalten muessen. Der standardmaessige verwaltete Agent heisst Antigravity agent (antigravity-preview-05-2026) und ist dasselbe Agent-Framework, das auch Googles eigene Agent-Produkte antreibt.

Anders als bei einem gewoehnlichen Chat-Aufruf, bei dem man eine Frage stellt und eine Antwort erhaelt, nimmt ein verwalteter Agent eine einzige Anweisung entgegen und durchlaeuft eine mehrstufige Schleife: Er plant, ruft Tools auf, beobachtet die Ergebnisse und iteriert, bis die Aufgabe erledigt ist oder ein Budget-Limit erreicht wird. Google beschreibt dies als eine konfigurierbare Agent-Umgebung: Man liefert Anweisungen, Tools und Environment-Konfiguration, und Google betreibt die gesamte Ausfuehrungsschleife in einer sicheren Cloud-Sandbox.

Einen tieferen Vergleich dazu, wie sich verwaltete Agenten in die breitere Landschaft von Agent-Betriebssystemen und Frameworks einordnen, finden Sie in unserem Leitfaden zum Einrichten eines KI-Agenten-Betriebssystems.

Googles zweites grosses Update fuer verwaltete Agenten (das erste war der Start am 19. Mai 2026, gefolgt von einem Update am 7. Juli, das Background-Ausfuehrung und remote MCP einfuehrte) brachte fuenf Funktionen, die verwaltete Agenten von einer interessanten Vorschau zu einer Plattform machen, auf der sich lohnt zu bauen. Die offizielle Ankuendigung im Google-Blog enthaelt die vollstaendige Aufschluesselung.

Der Antigravity-Agent laeuft nun standardmaessig mit Gemini 3.6 Flash, ganz ohne Codeaenderungen. Ihre naechste Interaktion verwendet das Modell automatisch. Gemini 3.6 Flash wurde am 21. Juli 2026 veroeffentlicht und wird von Google als das ausgewogene Modell fuer reasoning, Programmierung und Tool-Nutzung beschrieben, was genau das ist, was ein Agent den ganzen Tag tut. Es verbraucht 17 Prozent weniger Output-Tokens als Gemini 3.5 Flash und benoetigt weniger reasoning-Schritte fuer mehrstufige Workflows.

Sie koennen ein Modell auch explizit ueber agent_config.model auswaehlen:

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 ", // explizite Modellauswahl }, }); console. log ( interaction. output_text ); Vollbildmodus aktivieren Vollbildmodus beenden 2. Zugriff im kostenlosen Tarif Verwaltete Agenten sind nun fuer Projekte im kostenlosen Tarif verfuegbar.

Sie koennen mit agentischen Workflows experimentieren, indem Sie einen API-Key eines Projekts verwenden, fuer das keine Abrechnung aktiviert ist. Es gelten die Standard-Rate-Limits des kostenlosen Flash-Tarifs, etwa 15 Anfragen pro Minute und 1.500 Anfragen pro Tag gemaess der Rate-Limits-Dokumentation der Gemini API. Die Environment-Berechnung wird waehrend der Vorschauzeit nicht abgerechnet.

Ein wichtiger Haken: Sobald Sie die Abrechnung fuer ein Projekt aktivieren, verschwindet der kostenlose Tarif fuer dieses Projekt vollstaendig. Halten Sie Ihr Prototyping auf einem separaten API-Key-Projekt, wenn Sie im kostenlosen Tarif bleiben moechten.

Das ist der Teil, der das praktische Problem loest. Agenten arbeiten autonom, das ist der Sinn der Sache, aber es bedeutet auch, dass man nicht jeden Schritt beobachtet. Environment-Hooks erlauben es, eigene Skripte vor oder nach jedem einzelnen Tool-Aufruf auszufuehren, den der Agent innerhalb seiner Sandbox taetigt. Sie fuegen eine Datei a.agents/hooks.json zu Ihrer Umgebung hinzu, und die Runtime fuehrt Ihre Handler bei zwei Ereignissen aus.

Laut der Hooks-Dokumentation von Google sind die fuenf integrierten Tools, die sich abfangen lassen: code_execution, read_file, write_file, list_files und delete_file. Das matcher-Feld verwendet RE2-Regular Expressions, sodass Sie mit | mehrere Tools ansprechen oder mit * alles abfangen koennen.

Agenten durchlaufen mehrstufige Schleifen, sodass eine komplexe Aufgabe viele Tokens verbrauchen kann. Sie uebergeben max_total_tokens innerhalb von agent_config, um den Gesamtverbrauch zu begrenzen; dabei werden Input, Output und Thinking zusammen gerechnet. Erreicht der Agent das Limit, pausiert die Ausfuehrung sicher und die Interaktion gibt den Status incomplete zurueck. Der Environment-Zustand bleibt erhalten, sodass Sie mit previous_interaction_id und einem neuen Limit uebergeben koennen und der Agent dort weitermacht, wo er aufgehört hat.

Ein Trigger bindet einen Agenten, eine Umgebung, einen Prompt und einen cron-Zeitplan in einer dauerhaften Ressource zusammen, die ausloest, ohne dass man eingreifen muss. Jeder Lauf verwendet dieselbe Sandbox, sodass Dateien ueber die Laeufe hinweg erhalten bleiben; der Agent baut auf seiner eigenen frueheren Arbeit auf, statt von vorn zu beginnen. Laut der Agenten-Uebersicht von Google pausieren Trigger automatisch nach fuenf aufeinanderfolgenden Fehlern, ein Detail der Produktionssicherheit, das um 3 Uhr nachts entscheidend ist. Eine separate Environments API ermoeglicht es, Sandbox-Sitzungen aus Code heraus aufzulisten, zu inspizieren und zu loeschen, sodass man aufraeumen kann, sobald die Pipeline fertig ist, statt auf die 7-Tage-TTL zu warten.

Environment-Hooks sind die praktisch nuetzlichste Funktion dieses Updates. Hier ist, wie man sie von Grund auf einrichtet.

Erstellen Sie ein Projektverzeichnis mit folgender Struktur:

my-agent-project/.agents/ AGENTS.md # Systemanweisungen und Persona hooks.json # Hook-Definitionen hooks-scripts/ gate.py # Ihr Pre-Tool-Schutzskript auto_lint.py # Ihr Post-Tool-Aufraeumskript app.py # Ihr eigentlicher Anwendungscode Vollbildmodus aktivieren Vollbildmodus beenden Schritt 3: Schreiben Sie Ihre hooks.json Die Hooks-Datei gruppiert Ereignisdefinitionen unter eigenen Namen. Jede Gruppe kann unabhaengig aktiviert oder deaktiviert werden. Hier ein funktionierendes Beispiel, das destruktive Shell-Befehle blockiert, bevor sie ausgefuehrt werden, und Python-Dateien nach dem Schreiben automatisch formatiert:

{ "security-gate": { "enabled": true, "pre_tool_execution": [ { "matcher": "code_execution", "hooks": [ { "type": "command", "command": "python3 /.agents/hooks-scripts/gate.py", "timeout": 10 } ] } ] }, "auto-format": { "post_tool_execution": [ { "matcher": "write_file", "hooks": [ { "type": "command", "command": "python3 /.agents/hooks-scripts/auto_lint.py", "timeout": 15 } ] } ] } } Vollbildmodus aktivieren Vollbildmodus beenden Schritt 4: Schreiben Sie Ihr Pre-Tool-Schutzskript Ihr Pre-Tool-Skript erhaelt eine JSON-Payload auf stdin, die den Tool-Aufruf beschreibt, und muss eine JSON-Entscheidung auf stdout ausgeben. Liefert es {"decision": "deny", "reason": "..."} zurueck, wird der Tool-Aufruf uebersprungen, und der Grund wird in den Kontext des Modells eingespeist, damit der Agent sich anpassen und einen anderen Weg versuchen kann.

#!/usr/bin/env python3 import json, sys, re payload = json. load ( sys. stdin ) tool_name = payload. get ( " tool_call ", {}). get ( " name ", "" ) args = payload. get ( " tool_call ", {}). get ( " args ", {}) # Destruktive Shell-Befehle blockieren if tool_name == " code_execution ": code = args. get ( " code ", "" ) destructive_patterns = [ r " rm\s+-rf\s+/ ", r " DROP\s+TABLE ", r " git\s+push\s+--force ", r " shutdown ", r " reboot ", ] for pattern in destructive_patterns: if re. search ( pattern, code, re. IGNORECASE ): print ( json. dumps ({ " decision ": " deny ", " reason ": f " Blocked destructive command matching pattern: { pattern } " })) sys. exit ( 0 ) # Alles andere erlauben print ( json. dumps ({ " decision ": " allow " })) Vollbildmodus aktivieren Vollbildmodus beenden Wenn Ihr Skript nicht erkanntes JSON, reinen Text oder gar nichts ausgibt, behandelt die Runtime dies als Genehmigung (allow). Stellen Sie daher sicher, dass Ihre Ablehnungs-Pfade immer gueltiges JSON ausgeben.

Post-Tool-Hooks laufen, nachdem ein Tool abgeschlossen ist. Sie koennen abgeschlossene Aktionen nicht blockieren oder rueckgaengig machen, aber sie koennen Code automatisch formatieren, Tests ausfuehren, Aktivitaeten protokollieren oder Pipelines ausloesen.

#!/usr/bin/env python3 import json, sys, subprocess payload = json. load ( sys. stdin ) tool_name = payload. get ( " tool_call ", {}). get ( " name ", "" ) args = payload. get ( " tool_call ", {}). get ( " args ", {}) if tool_name == " write_file " and args. get ( " path ", "" ). endswith ( ".py " ): filepath = args. get ( " path ", "" ) try: subprocess. run ([ " python3 ", " -m ", " black ", filepath ], timeout = 10 ) subprocess. run ([ " python3 ", " -m ", " flake8 ", filepath ], timeout = 10 ) except Exception: pass # Don't fail the hook on lint errors Enter fullscreen mode Exit fullscreen mode Schritt 6: Bereitstellen und testen Binden Sie Ihr Projektverzeichnis als Umgebung des Agents ein und senden Sie einen Test-Prompt:

from google import genai client = genai. Client () interaction = client. interactions. create ( agent = " antigravity-preview-05-2026 ", input = " Create a Python script that lists all CSV files in the workspace and reports their row counts. ", environment = " remote ", agent_config = { " type ": " antigravity ", " max_total_tokens ": 10000, # cap the first run }, ) print ( interaction. output_text ) print ( f " Status: { interaction. status } " ) Enter fullscreen mode Exit fullscreen mode Versucht der Agent einen destruktiven Befehl, verweigert Ihr Gate-Skript diesen, und der Agent sieht den Ablehnungsgrund und passt sich an. Schreibt er eine Python-Datei, läuft Ihr Auto-Format-Hook automatisch mit Black und Flake8.

Token-Obergrenzen verhindern ausufernde Kosten. Setzen Sie bereits beim ersten Lauf eine Grenze, nicht erst beim fünften. Das Pause-and-Resume-Verhalten bedeutet, dass Sie durch eine frühe Begrenzung nichts verlieren.

Erreicht der Agent die Obergrenze, gibt er den Status "incomplete" zurück. So setzen Sie ihn fort:

interaction = client. interactions. create ( agent = " antigravity-preview-05-2026 ", input = " Continue from where you stopped. ", environment = " remote ", previous_interaction_id = " your-previous-interaction-id ", agent_config = { " type ": " antigravity ", " max_total_tokens ": 50000, # fresh budget for the continuation }, ) Enter fullscreen mode Exit fullscreen mode Laut der Agents-Übersicht von Google kann eine einzelne Interaction mehrere reasoning loops auslösen und verbraucht dabei typischerweise 100K bis 3M Token. Das Environment-Computing wird während der Preview nicht abgerechnet, sodass die Token-Kosten der Hauptkostentreiber sind.

Scheduled Triggers lassen einen Agenten nach einem Cron-Zeitplan laufen, ohne dass ein externer Orchestrator nötig ist. Keine Lambda-Funktion, kein Airflow-DAG, kein HTTP-Aufruf erforderlich. Jeder Lauf nutzt dieselbe Sandbox erneut, sodass Dateien, die eine Ausführung schreibt, für die nächste sichtbar sind.

Das ist leistungsstark für wiederkehrende Workflows:

Der offiziellen Ankündigung zufolge pausieren Trigger automatisch nach fünf aufeinanderfolgenden Fehlern. Dies ist ein Sicherheitsmechanismus für den Produktivbetrieb, der verhindert, dass ein defekter Trigger nachts unbemerkt Ihr Budget verbraucht.

Hooks sind nicht auf Skripte innerhalb der Sandbox beschränkt. Sie unterstützen auch HTTP-Handler, die das Event-JSON direkt an Ihren eigenen Endpunkt POSTen. Damit können Sie:

Der HTTP-Handler-Typ sendet das Event-JSON als POST-Anfrage aus dem Sandbox-Netzwerk heraus. Ihr Server liefert dasselbe Decision-JSON-Format ( {"decision": "allow"} oder {"decision": "deny", "reason": "..."} ) im Response-Body zurück.

Starten Sie noch heute auf dem Free Tier. Richten Sie einen sandgeboxten Agenten ein, legen Sie eine hooks.json-Datei an, und sehen Sie sich in der Praxis an, wie ein Compliance-Gate aussieht, bevor Sie sich auf einen kostenpflichtigen Tarif festlegen. Setzen Sie beim ersten Lauf ein Token-Limit. 10.000 Token reichen aus, um zu sehen, was der Agent tut, und dank Pause/Resume-Verhalten können Sie jederzeit fortfahren. Verwenden Sie Gemini 3.5 Flash-Lite für einfache wiederkehrende Schleifen und Gemini 3.6 Flash für echte reasoning-Aufgaben. Dieser Ansatz, Modelle in Agent-Frameworks einzubinden, funktioniert auch jenseits des Google-Ökosystems. Sehen Sie dazu unseren Leitfaden zu system over model: plugging new LLMs into agent frameworks.

Managed Agents beseitigen die Infrastrukturhürde. Sie benötigen keinen Kubernetes-Cluster, kein Docker-Setup und keine serverless Funktion. Ein einziger API-Aufruf stellt die gesamte Sandbox bereit. Nutzen Sie Scheduled Triggers, um wiederkehrende Aufgaben zu automatisieren: eine wöchentliche Wettbewerbsanalyse, eine tägliche Inventurprüfung, einen monatlichen Report aus Ihren aktuellen Daten. Das Hooks-System stellt sicher, dass der Agent keine destruktiven Befehle ohne Ihre Freigabe ausführen kann, was das Sicherheitsnetz ist, das die meisten Unternehmensinhaber benötigen, bevor sie einem autonomen Agenten echte Aufgaben anvertrauen. Für einen umfassenderen Rahmen zur Wahl der richtigen Agent-Architektur siehe unseren agent operating system decision framework.

Die Environments API ist Ihr Freund. Listen, inspizieren und löschen Sie Sandbox-Sessions aus dem Code heraus. Stellen Sie Environment-IDs nach Verbindungsabbrüchen wieder her. Räumen Sie auf, sobald Ihre Pipeline fertig ist, statt auf die 7-Tage-TTL zu warten. Das Trigger-with-Same-Sandbox-Design bedeutet, dass Sie keine Persistenzschicht bauen müssen. Die Sandbox IST Ihr Zustand. Kombinieren Sie dies mit Hooks für Compliance und max_total_tokens für Kostenkontrolle, und Sie haben einen produktionsreifen autonomen Agenten mit Guardrails, Budgets und Scheduling, die direkt in die Plattform integriert sind.

Quellen: Gemini API pricing, Gemini API rate limits

Managed Agents sind nicht der einzige Weg, KI-Agenten zu bauen, aber die einzige Variante, bei der die Infrastruktur vollständig abstrahiert ist. So vergleichen sie sich:

Wenn Sie den Agent-OS-Ansatz erkunden möchten, deckt unser Leitfaden zum Bau eines kostenlosen KI-Agenten-Betriebssystems einen 5-Schichten-Stack mit kostenlosen Tools ab, und unsere Durchführung zu Google Antigravity 2.0 als Agent OS zeigt, wie man Projekte, Memory, Skills und Hooks im breiteren Antigravity-Ökosystem konfiguriert.

F: Was ist ein Managed Agent in Google AI Studio?

A: Ein Managed Agent ist ein KI-Agent, den Google für Sie hostet und ausführt. Ein einzelner API-Aufruf stellt eine Linux-Sandbox bereit, in der der Agent reasoning betreibt, Code schreibt und ausführt, Dateien verwaltet und autonom das Web durchsucht. Der Standard-Managed-Agent ist der Antigravity Agent ( antigravity-preview-05-2026 ), angetrieben von Gemini 3.6 Flash. Sie verwalten keine Server, Container oder Orchestrierung. Google übernimmt die gesamte Execution Loop.

A: Ja, Managed Agents sind jetzt auf dem Gemini API Free Tier verfügbar. Sie können mit agentic Workflows experimentieren, und zwar mit einem API-Schlüssel aus einem Projekt ohne aktivierte Abrechnung. Es gelten die Standard-Flash-Rate-Limits (etwa 15 RPM und 1.500 RPD). Das Environment-Computing ist während des Preview-Zeitraums kostenlos. Wenn Sie die Abrechnung für ein Projekt aktivieren, verschwindet der Free Tier für dieses Projekt.

F: Was sind Environment Hooks bei Gemini Managed Agents?

A: Environment Hooks sind benutzerdefinierte Skripte, die vor ( pre_tool_execution ) oder nach ( post_tool_execution ) jedem Tool-Aufruf ausgeführt werden, den der Agent in seiner Sandbox tätigt. Before-Hooks können einen Tool-Aufruf genehmigen ( allow ) oder blockieren ( deny ). Bei einer Blockierung sieht der Agent den Ablehnungsgrund und passt sich an. After-Hooks führen Aufräumaufgaben aus, etwa das automatische Formatieren von Code oder das Protokollieren von Aktivitäten. Sie konfigurieren sie über eine Datei a.agents/hooks.json in der Umgebung des Agenten.

F: Wie funktionieren Token-Budget-Limits bei Managed Agents?

A: Sie übergeben max_total_tokens innerhalb von agent_config, um den gesamten Token-Verbrauch (Input + Output + thinking zusammen) für eine einzelne Interaction zu begrenzen. Erreicht der Agent das Limit, pausiert die Ausführung sicher und gibt den Status "incomplete" zurück. Der Umgebungszustand bleibt erhalten, sodass Sie fortsetzen können, indem Sie previous_interaction_id mit einem neuen Budget übergeben. Dies verhindert ausufernde Kosten bei komplexen mehrstufigen Aufgaben.

F: Kann ich Managed Agents wiederkehrend planen?

A: Ja. Scheduled Triggers verbinden einen Agenten, eine Umgebung, einen Prompt und einen Cron-Zeitplan zu einer persistenten Ressource, die automatisch ausgelöst wird. Jeder Lauf nutzt dieselbe Sandbox erneut, sodass Dateien über Ausführungen hinweg bestehen bleiben. Der Agent baut auf seiner eigenen vorherigen Arbeit auf. Trigger pausieren automatisch nach fünf aufeinanderfolgenden Fehlern, um ein stilles Budget-Ausbrennen zu verhindern.

F: Welche Modelle kann ich mit Managed Agents verwenden?

A: Der Antigravity Agent unterstützt drei Modelle: Gemini 3.6 Flash ( gemini-3.6-flash, der Standard), Gemini 3.5 Flash ( gemini-3.5-flash ) und Gemini 3.5 Flash-Lite ( gemini-3.5-flash-lite ). Sie wählen ein Modell aus, indem Sie agent_config.model beim Erstellen einer Interaction oder eines Managed Agents übergeben. Gemini 3.6 Flash ist der ausgewogene Standard für reasoning, Coding und Tool-Nutzung; Flash-Lite ist die Option mit der geringsten Latenz und den geringsten Kosten.

F: Wie lange bleiben Sandbox-Umgebungen von Managed Agents erhalten?

A: Sandbox-Umgebungen haben standardmäßig eine TTL von 7 Tagen. Sie können die Environments API verwenden, um Sandbox-Sessions programmatisch aufzulisten, zu inspizieren und zu löschen, sodass Sie aufräumen können, sobald Ihre Pipeline fertig ist, statt auf das automatische Ablaufdatum zu warten. Sie können auch eine bestehende Environment-ID wiederverwenden, um den exakten Zustand einer vorherigen Session wiederherzustellen.

Recherchiert und verfasst mit KI-Agenten; geprüft und faktenkontrolliert unter menschlicher redaktioneller Aufsicht. How we work →

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

Posted on Oct 10 • Originally published at aitecharchive.com

Google AI Studio's managed agents got their biggest upgrade yet on July 28, 2026: the Antigravity agent now defaults to Gemini 3.6 Flash, runs on the free tier, and ships with environment hooks that let you block, audit, or lint every tool call inside the sandbox — plus token budget caps, cron-scheduled triggers, and a programmatic Environments API. For developers and small teams who have been watching agent frameworks from the sidelines, this is the first time you can build and test a production-grade autonomous agent with zero infrastructure and zero cost.

Verdict: If you're building AI agents in 2026, Google AI Studio's managed agents are now the fastest zero-cost path from idea to working autonomous workflow. The hooks system alone — which lets your custom script approve or deny every tool call the agent makes — solves the biggest real-world problem with autonomous agents: preventing them from running commands you didn't authorize. The free tier makes it accessible to anyone with a Google account, and the token caps + scheduled triggers make it production-ready rather than just a demo toy.

Managed agents are Google-hosted AI agents that run autonomously inside an isolated Linux sandbox. A single API call to the Gemini API provisions the sandbox, and the agent reasons, writes and executes code, installs packages, reads and writes files, and browses the web — all without you managing any infrastructure. The default managed agent is called the Antigravity agent ( antigravity-preview-05-2026 ), and it's the same agent harness that powers Google's own agent products.

Unlike a standard chat call where you ask one question and get one answer, a managed agent takes a single instruction and runs a multi-step loop: it plans, calls tools, observes results, and iterates until the task is done or it hits a budget cap. Google describes it as a "configurable agent harness" — you provide the instructions, tools, and environment configuration, and Google runs the whole execution loop in a secure cloud sandbox.

For a deeper comparison of how managed agents fit into the broader landscape of agent operating systems and frameworks, see our guide to setting up an AI agent operating system.

Google's second major update to managed agents (the first was the initial launch on May 19, 2026, followed by a July 7 update adding background execution and remote MCP) shipped five features that move managed agents from "interesting preview" to "worth building on." The official announcement on Google's blog covers the full breakdown.

The Antigravity agent now runs Gemini 3.6 Flash by default — no code changes required. Your next interaction picks it up automatically. Gemini 3.6 Flash was released on July 21, 2026 and is described by Google as the balanced model for reasoning, coding, and tool use, which is exactly what an agent does all day. It consumes 17% fewer output tokens than Gemini 3.5 Flash while taking fewer reasoning steps for multi-step workflows.

You can also explicitly select a model by passing agent_config.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 ", // explicit model selection }, }); console. log ( interaction. output_text ); Enter fullscreen mode Exit fullscreen mode 2. Free tier access Managed agents are now available on free tier projects.

You can experiment with agentic workflows using an API key from a project that has no billing enabled. Standard Flash free-tier rate limits apply — approximately 15 requests per minute and 1,500 requests per day, per the Gemini API rate limits documentation. Environment compute is not billed during the preview period.

One important catch: 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.

This is the part that solves the real-world problem. Agents are autonomous — that's the point — but it also means you're not watching every step. Environment hooks let you run your custom scripts before or after every single tool call the agent makes inside its sandbox. You add a.agents/hooks.json file to your environment, and the runtime executes your handlers on two events.

Per Google's hooks documentation, the five built-in tools you can intercept are: code_execution, read_file, write_file, list_files, and delete_file. The matcher field uses RE2 regular expressions, so you can target multiple tools with | or catch everything with *.

Agents run multi-turn loops, so a complex task can consume a lot of tokens. You pass max_total_tokens inside agent_config to cap total consumption — input, output, and thinking all counted together. When the agent hits the cap, execution pauses safely and the interaction returns status: "incomplete". The environment state is preserved, so you pass previous_interaction_id with a fresh cap and the agent continues from where it stopped.

A trigger binds an agent, an environment, a prompt, and a cron schedule into one persistent resource that fires without you touching it. Each run reuses the same sandbox, so files persist across runs — the agent builds on its own previous work instead of starting over. Per Google's agents overview, triggers pause automatically after five consecutive failures, which is the kind of production-safety detail that matters at 3 AM. A separate Environments API lets you list, inspect, and delete sandbox sessions from code, so you can clean up when your pipeline finishes instead of waiting for the 7-day TTL.

Environment hooks are the most practically useful feature in this update. Here's how to set them up from scratch.

Create a project directory with the following structure:

my-agent-project/.agents/ AGENTS.md # System instructions and persona hooks.json # Hook definitions hooks-scripts/ gate.py # Your pre-tool guardrail script auto_lint.py # Your post-tool cleanup script app.py # Your main application code Enter fullscreen mode Exit fullscreen mode Step 3: Write your hooks.json The hooks file groups event definitions under custom names. Each group can be enabled or disabled independently. Here's a working example that blocks destructive shell commands before they run and auto-formats Python files after they're written:

{ "security-gate": { "enabled": true, "pre_tool_execution": [ { "matcher": "code_execution", "hooks": [ { "type": "command", "command": "python3 /.agents/hooks-scripts/gate.py", "timeout": 10 } ] } ] }, "auto-format": { "post_tool_execution": [ { "matcher": "write_file", "hooks": [ { "type": "command", "command": "python3 /.agents/hooks-scripts/auto_lint.py", "timeout": 15 } ] } ] } } Enter fullscreen mode Exit fullscreen mode Step 4: Write your pre-tool guardrail script Your pre-tool script receives a JSON payload on stdin describing the tool call and must output a JSON decision on stdout. If it returns {"decision": "deny", "reason": "..."}, the tool call is skipped — and the reason gets passed into the model's context so the agent can adapt and try another approach.

#!/usr/bin/env python3 import json, sys, re payload = json. load ( sys. stdin ) tool_name = payload. get ( " tool_call ", {}). get ( " name ", "" ) args = payload. get ( " tool_call ", {}). get ( " args ", {}) # Block destructive shell commands if tool_name == " code_execution ": code = args. get ( " code ", "" ) destructive_patterns = [ r " rm\s+-rf\s+/ ", r " DROP\s+TABLE ", r " git\s+push\s+--force ", r " shutdown ", r " reboot ", ] for pattern in destructive_patterns: if re. search ( pattern, code, re. IGNORECASE ): print ( json. dumps ({ " decision ": " deny ", " reason ": f " Blocked destructive command matching pattern: { pattern } " })) sys. exit ( 0 ) # Allow everything else print ( json. dumps ({ " decision ": " allow " })) Enter fullscreen mode Exit fullscreen mode If your script outputs unrecognized JSON, plain text, or nothing, the runtime treats it as approval ( allow ) — so make sure your deny paths always output valid JSON.

Post-tool hooks run after a tool finishes. They cannot block or undo completed actions, but they can auto-format code, run tests, log activity, or trigger pipelines.

#!/usr/bin/env python3 import json, sys, subprocess payload = json. load ( sys. stdin ) tool_name = payload. get ( " tool_call ", {}). get ( " name ", "" ) args = payload. get ( " tool_call ", {}). get ( " args ", {}) if tool_name == " write_file " and args. get ( " path ", "" ). endswith ( ".py " ): filepath = args. get ( " path ", "" ) try: subprocess. run ([ " python3 ", " -m ", " black ", filepath ], timeout = 10 ) subprocess. run ([ " python3 ", " -m ", " flake8 ", filepath ], timeout = 10 ) except Exception: pass # Don't fail the hook on lint errors Enter fullscreen mode Exit fullscreen mode Step 6: Deploy and test Mount your project directory as the agent's environment and send a test prompt:

from google import genai client = genai. Client () interaction = client. interactions. create ( agent = " antigravity-preview-05-2026 ", input = " Create a Python script that lists all CSV files in the workspace and reports their row counts. ", environment = " remote ", agent_config = { " type ": " antigravity ", " max_total_tokens ": 10000, # cap the first run }, ) print ( interaction. output_text ) print ( f " Status: { interaction. status } " ) Enter fullscreen mode Exit fullscreen mode If the agent tries a destructive command, your gate script denies it, and the agent sees the rejection reason and adapts. If it writes a Python file, your auto-format hook runs Black and Flake8 automatically.

Token caps prevent runaway costs. Set one on your first run, not your fifth — the pause-and-resume behavior means you lose nothing by capping early.

When the agent hits the cap, it returns status: "incomplete". Resume it like this:

interaction = client. interactions. create ( agent = " antigravity-preview-05-2026 ", input = " Continue from where you stopped. ", environment = " remote ", previous_interaction_id = " your-previous-interaction-id ", agent_config = { " type ": " antigravity ", " max_total_tokens ": 50000, # fresh budget for the continuation }, ) Enter fullscreen mode Exit fullscreen mode According to Google's agents overview, a single interaction can trigger multiple reasoning loops, typically consuming 100K to 3M tokens. Environment compute is not billed during the preview, so the token cost is the primary cost driver.

Scheduled triggers let an agent run on a cron schedule without any external orchestrator — no Lambda function, no Airflow DAG, no HTTP call needed. Each run reuses the same sandbox, so files written by one execution are visible to the next.

This is powerful for recurring workflows:

Per the official announcement, triggers pause automatically after five consecutive failures — a production-safety mechanism that prevents a broken trigger from silently burning through your budget night after night.

Hooks aren't limited to scripts inside the sandbox. They also support HTTP handlers that POST the event JSON directly to your own endpoint. This lets you:

The HTTP handler type sends the event JSON as a POST request from inside the sandbox network. Your server returns the same decision JSON format ( {"decision": "allow"} or {"decision": "deny", "reason": "..."} ) in the response body.

Start on the free tier today. Spin up a sandboxed agent, mount a hooks.json file, and see what a compliance gate looks like in practice before committing to a paid tier. Set a token cap on your first run — 10,000 tokens is enough to see what the agent does, and the pause/resume behavior means you can always continue. Use Gemini 3.5 Flash-Lite for simple repetitive loops and Gemini 3.6 Flash for real reasoning tasks. This approach to plugging models into agent frameworks works beyond Google's ecosystem — see our guide on system over model: plugging new LLMs into agent frameworks.

Managed agents eliminate the infrastructure barrier. You don't need a Kubernetes cluster, a Docker setup, or a serverless function — one API call provisions the whole sandbox. Use scheduled triggers to automate recurring tasks: a weekly competitor analysis, a daily inventory check, a monthly report compiled from your latest data. The hooks system ensures the agent can't run destructive commands without your approval, which is the safety net most business owners need before trusting an autonomous agent with real tasks. For a broader framework on choosing the right agent architecture, see our agent operating system decision framework.

The Environments API is your friend. List, inspect, and delete sandbox sessions from code. Recover environment IDs after disconnects. Clean up when your pipeline finishes instead of waiting for the 7-day TTL. The trigger-with-same-sandbox design means you don't need to build a persistence layer — the sandbox IS your state. Pair this with hooks for compliance and max_total_tokens for cost control, and you have a production-ready autonomous agent with guardrails, budgets, and scheduling built into the platform.

Sources: Gemini API pricing, Gemini API rate limits

Managed agents are not the only way to build AI agents, but they're the only ones where the infrastructure is fully abstracted away. Here's how they compare:

If you want to explore the agent OS approach, our guide on building a free AI agent operating system covers a 5-layer stack with free tools, and our walkthrough on Google Antigravity 2.0 as an agent OS shows how to configure projects, memory, skills, and hooks in the broader Antigravity ecosystem.

Q: What is a managed agent in Google AI Studio?

A: A managed agent is an AI agent that Google hosts and runs for you. One API call provisions a Linux sandbox where the agent reasons, writes and executes code, manages files, and browses the web autonomously. The default managed agent is the Antigravity agent ( antigravity-preview-05-2026 ), powered by Gemini 3.6 Flash. You don't manage any servers, containers, or orchestration — Google handles the entire execution loop.

A: Yes, managed agents are now available on the Gemini API free tier. You can experiment with agentic workflows using an API key from a project without billing enabled. Standard Flash rate limits apply (approximately 15 RPM and 1,500 RPD). Environment compute is free during the preview period. If you enable billing on a project, the free tier disappears for that project.

Q: What are environment hooks in Gemini managed agents?

A: Environment hooks are custom scripts that run before ( pre_tool_execution ) or after ( post_tool_execution ) every tool call the agent makes inside its sandbox. Before-hooks can approve ( allow ) or block ( deny ) a tool call — when blocked, the agent sees the rejection reason and adapts. After-hooks run cleanup tasks like auto-formatting code or logging activity. You configure them via a.agents/hooks.json file in the agent's environment.

Q: How do token budget caps work in managed agents?

A: You pass max_total_tokens inside agent_config to cap the total token consumption (input + output + thinking combined) for a single interaction. When the agent hits the limit, execution pauses safely and returns status: "incomplete". The environment state is preserved, so you can resume by passing previous_interaction_id with a fresh budget. This prevents runaway costs on complex multi-step tasks.

Q: Can I schedule managed agents to run on a recurring basis?

A: Yes. Scheduled triggers bind an agent, an environment, a prompt, and a cron schedule into a persistent resource that fires automatically. Each run reuses the same sandbox, so files persist across executions — the agent builds on its own previous work. Triggers pause automatically after five consecutive failures to prevent silent budget burn.

Q: What models can I use with managed agents?

A: The Antigravity agent supports three models: Gemini 3.6 Flash ( gemini-3.6-flash, the default), Gemini 3.5 Flash ( gemini-3.5-flash ), and Gemini 3.5 Flash-Lite ( gemini-3.5-flash-lite ). You select a model by passing agent_config.model when creating an interaction or managed agent. Gemini 3.6 Flash is the balanced default for reasoning, coding, and tool use; Flash-Lite is the lowest-latency, lowest-cost option.

Q: How long do managed agent sandbox environments last?

A: Sandbox environments have a 7-day TTL by default. You can use the Environments API to list, inspect, and delete sandbox sessions programmatically, so you can clean up when your pipeline finishes instead of waiting for the automatic expiry. You can also reuse an existing environment ID to restore a previous session's exact state.

Researched and drafted with AI agents; reviewed and fact-checked under human editorial oversight. How we work →

Originaltitel: How to Use Google AI Studio Managed Agents in 2026: Hooks, Triggers, and Free-Tier Setup GuideQuelle: dev.to (dev.to). Original öffnen