Gemini 4 Argon Official Developer Guide: Delegating Long Tasks to AI and Verifying Results

From repairing entire web apps and understanding screen recordings to generating 3D scenes: Google's guide focuses on goals, tools, and verification loops, while introducing a shared million-token window and long decode.

By Geneviève Huskens、Jack Wotherspoon / Google10-20 · Approx. 15 min⚑ Product release

Google released Gemini 4 Argon, focusing on complex work that requires sustained progress: understanding projects, calling tools, inspecting results, and revising based on feedback until agreed goals are met. Built for developers and enterprises, it suits tasks such as cross-file refactoring, vulnerability fixes, multimodal document processing, and 3D applications.

This official developer guide highlights three notable use cases:

  • Carrying an engineering task through to delivery: Letting the model run tests, read error messages, and modify multiple files, reducing the burden of human turn-by-turn prompting.
  • Turning diverse materials into usable results: Combining videos, PDFs, spreadsheets, and ledgers to verify information, producing dashboards, slides, or documents with tracked changes.
  • Completing trial-and-error creation and simulation: Writing 3D scenes, games, and rendering programs, adjusting implementations based on actual execution results.

Google also opened a shared one-million-token window covering input, thinking, and answers, alongside long decode that exceeds previous single-response limits. Larger allowances leave room for complex tasks, but what truly moves work forward remains clear goals and inspectable feedback.

Align on goals first, then build a verification loop for long tasks

Taking “fixing layout and accessibility issues across an entire website” as an example, first agree on completion criteria: which pages to inspect, which devices to cover, what counts as passing, and which operations require human confirmation. You can also have Argon ask clarifying questions first, discuss architecture and milestones, and confirm that it has access to code, documentation, and necessary tools.

These preparations determine where the model heads. Once goals are clear, you can let it execute plans continuously, run checks, and make revisions based on results; when encountering irreversible operations, it should still pause and wait for human confirmation.

For the model to know whether a change works, it needs real feedback. Compiler errors, failing test logs, runtime logs, browser screenshots, and page structure all provide grounding for the next revision. An Agent is a program that connects a model to tools and lets it continue taking actions based on results; having a standard chat generate a snippet of code does not mean it has run or verified it.

When no existing check scripts are available, you can ask it to write one first: crawl the website’s pages, log current failures, and establish a baseline before modifications. Then group the failures by shared root causes. For instance, if multiple pages are affected by the same shared navigation component, fix that component first rather than patching page by page.

Goals and boundaries → Measure a baseline → Fix by root cause → Re-inspect; if it fails, keep pinpointing issues, and deliver once criteria are met.

Re-running the same set of checks after every modification reveals whether fixes work and whether other pages were affected. A script reporting “zero violations” only means the items it could check have passed; real-world page reading, interaction, and visual rendering still require manual inspection.

Practical Asset: Automated Benchmark Prompt for Web App Accessibility and Layout Audits

In Antigravity or another Agent environment connected to your repository and capable of launching the site and running browser checks, send the following prompt. Replace src/routes/ with your project's actual route directory. Standard chat can help write scripts, but it cannot automatically access projects on your machine from this text alone.

We want to fix accessibility and layout issues across our web app, but we don't have automated checks yet. First, write a headless Chrome script that crawls every route in src/routes/, inspects the live DOM and accessibility tree, and logs all violations to record our baseline score. Group the failing checks into shared root causes across our shared components, then fix them one cluster at a time. Re-run your script after each change to verify that each single fix resolves the entire cluster with zero regressions. Keep going until all routes pass with zero violations.

Reference images and screen recordings can also serve as task instructions

To have AI replicate an interface style, providing one or two concrete reference images aligns expectations far more easily than merely writing "polished and clean." You can also ask it to write typography, color palette, and layout rules into a lightweight DESIGN.md first, allowing subsequent components to follow the same rules.

Animations, interactions, and timing bugs are well-suited to video instructions: record a screen capture while operating the app, clicking through while narrating where things feel awkward, while preserving relevant logs. Argon's video Agent capabilities can proactively jump to relevant timestamps, inspect high-definition frames, and correlate clues between visuals and audio. Google also provides a use case: supply a 20-minute user test recording, let it find where the user got stuck, and then fix the corresponding component.

In this way, video participates in the debugging process. Multimodal materials can also serve as raw ingredients for business workflows: cross-referencing long videos, PDFs, spreadsheets, and ledgers in the same task, and then organizing them into dashboards, slides, or documents with tracked changes.

1. From complex transaction flows to interactive data presentation

In corporate finance and operations scenarios, messy ledgers, scanned invoices, and PDF financial reports are often difficult to compare directly. The Finance Story app in the guide ingests transaction data from the past year, turning it into animations and visualizations.

Finance Story interactive financial visualization demo
Dynamic multi-period heatmap visualization of financial ledgers.
The sample interface of Finance Story arranges transactions into a heatmap by month and day of the week. The 96 transactions and $711,862 in expenses shown in the screenshot represent demo ledger data.

2. From user intent to full-featured application delivery

Beyond static analysis, Argon in a hosted environment can complete the entire pipeline inside a sandbox—from interface conception and gameplay coding to autonomous playtesting, debugging, and final delivery.

Pixel Arcade game generator interface
Pixel arcade game generation entry point.
Shows the initial generation screen of Pixel Arcade. Users simply enter a nickname and game idea, and the application lets a hosted Agent build and playtest the game before returning the result.

3. Turning space and light into runnable code

The library video demonstrates a concrete implementation path: Argon wrote approximately 5,500 lines of Python/NumPy code, using ray tracing to render window daylight, wood, glass, and shadows. Ray tracing calculates how light rays intersect scene objects to produce shading and reflections in the image. This example turns mathematical implementation into observable visual results.

Ray-traced rendering built purely with Python/NumPy.
The clip shows an approximate 5,500-line native Python ray tracing engine written by Argon, independently implementing procedural materials, daylight and shadows, and glass caustics rendering, with an ambient audio track generated in collaboration with multimodal music model Lyria 3.5.

Let Argon set the direction and let Flash execute in parallel

The Google team demonstrated a division of labor: Argon breaks down tasks, designs interfaces, and reviews results, while delegating clearly bounded, independently executable implementation work to Gemini 3.8 Flash sub-Agents. This enables parallel exploration while keeping overall architecture overseen by a single controller.

Division of Labor

  1. Controller Argon (set thinking_level="medium" or "high"): Focuses on the big picture. Reads through the entire project context, clarifies architectural design, establishes module boundaries and API specifications, and conducts rigorous code reviews after sub-tasks are delivered;
  2. Flash sub-Agents (e.g., Gemini 3.8 Flash): Assist in parallel. Handles fast repository-wide keyword scans, batch-writing unit test boilerplate, and migrating small independent modules;
  3. Specialized models for images, speech, and music: For example, UI graphics and pixel sprites are handed to Nano Banana, speech to Gemini 3.8 Flash TTS, and music to Lyria.
Side-by-side comparison of single Argon versus Argon with Flash sub-Agents in the same scenario.
In a Mars rover landing physics simulation task (accounting for parachute tear thresholds, thruster propellant, lateral crosswinds, and an 18-degree crater slope), a single Argon on the left took 14 minutes and 13 seconds across 6 design iterations, costing $0.11; on the right, Argon orchestrating Flash sub-Agents took 8 minutes and 33 seconds across 26 design iterations, completing a safe landing at a cost of $0.08.

The video lasts only 26 seconds, condensing a multi-minute execution process. In this single demonstration, the collaborative approach explored more designs while reducing time and cost; a single case study does not prove that all engineering tasks will achieve identical gains.

Leave behind reusable experience and explanations once tasks finish

During extended autonomous coding or debugging complex edge cases, models inevitably take detours. Codebases often harbor implicit traps—such as private build parameters, specific style preferences, or deprecated internal utility libraries that were never cleaned up.

Letting the model start from scratch in every new session wastes substantial tokens. Once a task finishes, you can have Argon review the entire session, extract the lessons learned, and store them directly into the codebase's AGENTS.md file or team skills.

Practical Asset: Session Review and Knowledge Capture Prompt

When complex debugging reaches a stopping point, send this prompt to the model:

Investigate our current session to see where things stalled or required extra steps, and analyze why. Propose updates to our AGENTS.md or custom skills so we can improve our flow and take a more direct path next time.

When a long task touches dozens of files, humans also need to understand the solution. You can ask Argon to generate an interactive architecture diagram, data flow diagram, or step-by-step pipeline walkthrough, showing how the changes work together. This helps reviewers verify the design before merging, and enables team members unfamiliar with rendering algorithms or mathematical logic to understand what the changes accomplish. Passing tests and clear explanations fulfill the dual roles of verification and comprehension.

How a million tokens are divided across context, thinking, and answers

Argon's unified context window has a maximum of 1,048,576 tokens, shared across input, thinking, and answers.(A token is a measurement unit models use to process content; it does not equal a single character or word.) It allows difficult problems to consume more reasoning and answer space, but also means that the more input material you supply, the less headroom remains for generation.

For example, if input already takes 800,000 tokens, thinking and answers combined have at most 248,576 tokens left. This arithmetic relationship does not change even if you set output parameters higher.

Thinking levels set effort; budget caps determine when to stop

thinking_level has three settings: low suits classification, routing, and targeted extraction; default medium targets most coding and Agent tasks; high is suited for the hardest cross-file debugging, mathematical, and scientific reasoning. You can compare the three settings on your own tasks and choose the lowest tier that meets quality requirements.

Another parameter, max_output_tokens, limits the combined total of thinking and answers. If set to 8,192 and the model exhausts the entire budget on thinking, you may end up with no visible answer. This is a possible outcome of budget exhaustion, not a fixed token consumption for high.

To reduce reasoning expenditure, lower the thinking level; severely capping the budget, by contrast, risks truncating incomplete answers. A higher limit merely allows the model to use more; it cannot guarantee better answers or that the allowance will be fully consumed.

How Are One Million Tokens Divided Across Input, Thinking, and Answers?

This is an illustrative budget arithmetic example. Thinking usage is assumed by you, not predicted based on the model tier; the resulting answer space is also a maximum ceiling, not a guarantee that the model will fill it.

Blue: InputPurple: Assumed thinkingGreen: Answer headroomBackground: Unallocated
After deducting input from window998,576tokens remain for thinking and answer
Maximum answer headroom in this example49,152tokens

max(0, min(65,536, 1,048,576 − 50,000) − 16,384) = 49,152

The budget cap covers both thinking and answers. thinking_level adjusts reasoning effort, with no fixed token conversion table.

The budget cap in this example does not exceed 64K, so long decode is not required. Multi-turn Agents with short turns usually do not need long decode either.

How long decode continues generation

In the Interactions API, standard streaming and non-streaming requests both default to a 65,536-token ceiling. To exceed this, you must set both background=True and a max_output_tokens greater than 65,536; enabling background mode alone still defaults to 64K.

The server continues generation in segments of up to 64K tokens each: once the first segment concludes, the original input along with already-generated content is passed to the next segment, until the model finishes or reaches the budget cap. Each segment records a model_output step within the same interaction, and retrieving the result requires concatenating the text from these steps.

A commonly misunderstood metric arises here: total_input_tokens is the cumulative sum of inputs across segments, not the current window occupancy. In the official example, a 1,000-token input generates 200,000 tokens of thinking and answers split across four segments; the sum of inputs across segments totals about 397,000 tokens, but the window actually only needs to hold around 201,000 tokens. Repeated input receives an implicit cache discount, but costs should still be checked against actual usage.

Long decode solves scenarios where an individual response requires lengthy reasoning or output. If an Agent executes short turns per tool call, long decode is usually unnecessary; inflating each turn instead fills the shared window faster. Most routine tasks do not require enabling it, nor should the cap be interpreted as a guarantee that the model will stably write a fixed word count on command.

The Interactions API handles continuation server-side; if you prefer managing per-segment retries and error recovery yourself, the GenerateContent API also supports client-side continuation.

How to get started and what to change when migrating

If you prefer not to write code, you can test prompts in the Google AI Studio Playground or build applications in AI Studio Build. Paths listed in the guide include the Google AI Ultra subscription and the paid tier of the Gemini API; Ultra subscribers can also select Argon in Google Antigravity for complex task planning and execution.

To call it from your own code, use Google's official google-genai SDK. The examples below illustrate integration methods; no paid API calls were executed for this guide.

1. Prerequisites and environment setup

First install the latest official SDK:

pip install google-genai

Before running any code, make sure a valid paid API key is configured in your terminal (Gemini 4 Argon is a full-featured paid model with no free quota tier):

export GEMINI_API_KEY="your-paid-api-key-here"

2. Basic call: generating a single-file Web Audio drum machine and synthesizer

Calling Argon with default settings is straightforward. The official example below uses the default thinking_level="medium" to request a standalone Web Audio application with a 16-step sequencer, tempo slider, and live waveform visualizer:

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-argon",
    input=(
        "Build a single-file HTML drum machine and synth using the "
        "Web Audio API with a 16-step sequencer, tempo slider, and "
        "a live waveform visualizer."
    ),
    generation_config={
        "thinking_level": "medium"  # Options: "low" | "medium" (default) | "high"
    },
)

print(interaction.output_text)

Save the code as try_argon.py and run python3 try_argon.py in the same configured terminal. The terminal will print the generated result. Inspect the output, save the complete HTML snippet as drum-machine.html, open it in a browser, and test the sequencer, tempo slider, and waveform visualizer. Generated output may require debugging, and acceptance should be based on actual runtime performance.

Sending the drum machine prompt without code

Open the official example pre-filled with the prompt in AI Studio:

  • Build a single-file HTML drum machine and synth using the Web Audio API with a 16-step sequencer, tempo slider, and a live waveform visualizer.
Advanced: Complete code and state handling for long decode background tasks

Long decode background task mode (crossing the 64K generation boundary)

For tasks requiring exceptionally long derivations or generating complete, large-scale codebases, you must explicitly set background=True and provide an adequate max_output_tokens. In the code below, the developer polls status every 5 seconds and concatenates the model_output segments. Background mode requires storing the interaction (store=True); the proof prompt in the example comes from the official documentation, and generated output still requires mathematical verification.

import time
from google import genai

client = genai.Client()

# Launch long decode background task
interaction = client.interactions.create(
    model="gemini-4-argon",
    input="Write a complete, rigorous proof of the prime number theorem.",
    background=True,
    store=True,
    generation_config={
        "max_output_tokens": 262144,  # Raise ceiling to prevent thinking from consuming the entire output
        "thinking_level": "high",      # Enable high thinking for exceptionally difficult tasks
    },
)

# Poll and wait for background hop generation to finish
while interaction.status in ("in_progress", "queued"):
    time.sleep(5)
    interaction = client.interactions.get(id=interaction.id)

# Check status after exiting wait loop; "completed" means generation finished, not that content is verified.
if interaction.status != "completed":
    raise RuntimeError(f"Interaction ended with {interaction.status}: inspect status and usage")

# Concatenate text from each model_output step
text = "".join(
    content.text
    for step in interaction.steps
    if step.type == "model_output"
    for content in step.content
    if content.type == "text"
)

print(text)
print("Final interaction status:", interaction.status)
print("Actual billed usage:", interaction.usage)

completed means generation has ended; requires_action means tools need to be executed with results returned; incomplete may indicate budget exhaustion; failed and cancelled must be handled separately. Exiting the polling loop cannot simply be assumed as success. Multi-turn conversations or tool calls can continue an existing interaction via previous_interaction_id.

Advanced: Letting managed Agents search, run code, and verify

Accessing sandbox-managed Agents (Managed Agents)

If you want to leverage Google-managed infrastructure to let Argon autonomously search the web, execute code, and produce review reports, you can call a managed Antigravity Agent. It provides an execution sandbox and tool orchestration environment, supporting search, code execution, verification, and MCP tool calls. MCP is an interface for connecting Agents to external tools. The example below asks it to audit website performance and organize prioritized fixes:

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-09-2026",
    agent_config={
        "type": "antigravity",
        "model": "gemini-4-argon",
    },
    input=(
        "Audit https://web.dev for performance, Core Web Vitals, and SEO. "
        "Query Google's PageSpeed Insights API for both Mobile and Desktop strategies. "
        "Check search indexing with Google Search for site:web.dev. "
        "Format the output as a side-by-side scorecard table with prioritized fixes."
    ),
    environment="remote",
)

print(interaction.output_text)

Key checklist when migrating from older models

If you are preparing to migrate existing Gemini projects to gemini-4-argon, verify parameter compatibility and runtime configuration:

  1. Deprecate thinking_budget: Switch to explicit thinking_level ("low" | "medium" | "high");
  2. Completely remove sampling parameters: temperature, top_p, and top_k have no effect in Argon; passing them will trigger deprecation warnings;
  3. Retire explicit cache management: Stop calling cachedContents or caches.create. Argon enables implicit caching by default for prompts of at least 4,096 tokens, and only cache hits receive the 95% discount;
  4. Extend client network timeouts: Deep reasoning or long decode single-turn tasks may run continuously for several minutes; make sure to set background=True, or set HTTP client timeouts to at least 15 to 20 minutes.

How pricing works and what to watch out for during long runs

Gemini 4 Argon does not offer a Gemini API free tier. Official documentation lists promotional pricing and standard pricing that resumes later; see the sources note at the bottom of the page and official live pricing for exact cutoffs and effective schedules.

Billing item (per 1M tokens) Current promotional price Subsequent standard price Key conditions and billing details
Standard input $2.00 $4.00 Includes prompts, uploaded multimodal media, and past conversation context
Cached input $0.10 $0.20 95% discount on hit tokens. Requires a single input threshold of at least 4,096 tokens and an implicit cache hit
Output & thinking $10.00 $20.00 Billed at output rate. Deep reasoning (thought tokens) generated by the model in the background is billed at the same rate as final response text

Essential cost realities to keep in mind

  1. Thinking processes are also billed: If a model uses 100,000 thinking tokens on a thorny problem, those 100,000 tokens are charged at the same output rate as tokens in the final answer. Therefore, for routine tasks, avoid arbitrarily setting thinking_level to high;
  2. Segment continuation re-reads input: Cumulative segment inputs inflate total_input_tokens, though repeated input portions receive a 95% implicit cache discount. When auditing costs, separate standard input, cached input, thinking, and answers.

Background tasks are billed for work already executed even if they fail or get cancelled. Check usage upon completion rather than merely observing whether final text was returned.

Practical takeaway

Scroll through the Markdown, then copy and adapt it to your team.

Markdown · Member
Loading Markdown…
Source
Gemini 4 Argon: Developer GuideGeneviève Huskens and Jack Wotherspoon / Google·2026-10-13·Read the source
Editorial note
The guide was published on 2026-10-13; verified on 2026-10-20. Official promotional pricing runs through 2026-11-30, reverting to standard pricing starting 2026-12-01; please verify live pricing before use. Author avatars and brand logos from the original post are omitted, while the two application screenshots and two videos are retained.