Skip to content

Agents and multimodal systemsGuide

Gemini Computer Use in production: step costs, bounds, sandboxing

A computer-use agent re-sends a growing pile of screenshots on every step, so its cost curve is not a tool-call curve. This guide works through the arithmetic, the loop bounds, and the approval and egress controls to put in place before launch.

By INFRO Editorial

Published

10 min read

A glowing autonomous agent core coordinating tools, memory, and multiple AI model routes

In short

Computer Use is billed as plain input and output tokens, with function declarations counted as input, so cost is driven by how much screenshot history each step re-sends 1. Bound steps, time, tokens and spend, gate state-changing actions behind approval, and run the browser in a disposable sandbox with deny-by-default egress.

Key takeaways

  • Google's pricing page says Computer Use is billed on total input tokens sent and output tokens generated, with function declarations counted as input, so there is no separate per-action fee to forecast 1.
  • Per-run cost grows roughly with the square of step count if every screenshot stays in context; trimming old screenshots is the biggest single lever, shown in the worked example below.
  • Bound every run on steps, wall-clock time, tokens and spend, and add a no-progress check that compares screenshots, because a stuck agent otherwise repeats the same paid step.
  • Approval belongs in your harness, outside the model: classify each action and hold anything that sends, buys, deletes or enters credentials.
  • Egress is the control that still works when the model has been talked into something: a disposable browser with a deny-by-default proxy limits what an injected page can reach.

What this guide can confirm, and what to check yourself

The premise of this article is that Google's Computer Use tool has reached general availability. I could not read the Gemini API changelog or the computer-use documentation page when writing, so I have not confirmed the GA date, which models support the tool, how many tokens a screenshot costs, whether the API caps steps for you, or what safety fields come back with an action. Those are left out on purpose. Verify them on Google's own pages, then plug the real numbers into the arithmetic below.

What I did read is Google Cloud's Agent Platform pricing page. For the Computer Use Tool it says pricing is based on the total number of input tokens sent to the model and the output tokens generated, at the token prices of the model used, and that function declarations are included in the input token count.1 That is enough to build a cost model, because it means a computer-use run is a sequence of ordinary model requests. The rest of this guide is engineering practice you apply around them: cost shape, loop bounds, approval gates, and sandbox and egress rules.

How a computer-use step is billed

A browser-driving agent works in a loop. The harness takes a screenshot, sends it with the goal, the tool declarations and the history to the model, receives an action such as click, type or scroll, executes it in the browser, and repeats. Each turn is one request, and each request carries everything the model needs to see.

Three things make this expensive in a way that ordinary tool calling is not:

  • Screenshots are input tokens. Every turn adds at least one image. How many tokens an image costs depends on the model and its settings; Google's page lists different per-image figures for different image models, and 258 tokens per image for the Live API, so do not borrow a number from another product.1 Measure it on your model.
  • History is re-sent. If you keep every screenshot, turn n carries n images. Input per turn grows linearly, so total input per run grows roughly with the square of the step count.
  • Function declarations count every time. Tool schemas are re-billed as input on each turn.1

There is also a threshold effect. The pricing page's Gemini 3 footnote says that when input context is longer than 200K tokens, all tokens, input and output, are charged at long-context rates.1 An agent that never discards screenshots can drift across that line in a long run and reprice the whole request, not only the excess. Check whether the model you pick has such a tier.

Worked example: trimming history

Two caveats apply before you copy the trimming idea. First, the model may do worse when it cannot see earlier screens, so run the same task set with both policies and compare success rate, not only price; cost per successful task is the figure to track. Second, the pricing page lists cached-input rates well below standard input for the models it covers (for Argon, $0.20 against $4.00 per 1M tokens from December 1).1 Whether a computer-use loop gets cached-input pricing on its repeated prefix is something to measure on your own usage records, not to assume.

Also keep an eye on the time-limited rates. The page lists Gemini 4 Argon at $2.00 and $10.00 through November 30, 2026, with the $4.00 and $20.00 rates starting December 1, and notes the earlier rates are promotional.1 A forecast built this week will be wrong in a month if it uses the current rate.

Bound the loop on four axes

An agent that does not know it is stuck will keep paying for screenshots. Bound every run, and make the bound a hard stop in your harness rather than an instruction in the prompt. The general method is in bounding AI agent loops; the computer-use specifics are these.

BoundWhat it stopsTypical failure it catches
Max stepsUnbounded turnsA popup the agent cannot dismiss
Wall-clock deadlineSlow pages, waitsA page that never finishes loading
Token budget per runContext growthUntrimmed screenshots crossing a price tier
Spend ceiling per run and per dayRunaway cost across many runsA bug that starts 10,000 runs
No-progress checkRepeating the same actionClicking a disabled button forever

The no-progress check is the one teams miss. Hash each screenshot after downscaling, and keep the last few action and hash pairs. If the same action produces the same hash three times, stop and hand the run to a person or fail it.

run_agent.py
import time, hashlib
from collections import deque

MAX_STEPS = 40
DEADLINE_S = 300
MAX_INPUT_TOKENS = 600_000   # per run, measured from usage metadata

def run(goal, browser, model):
    start, used = time.monotonic(), 0
    recent = deque(maxlen=3)
    for step in range(MAX_STEPS):
        if time.monotonic() - start > DEADLINE_S:
            return stop("deadline", step)
        shot = browser.screenshot()
        resp = model.next_action(goal, shot, history=trim(browser.history))
        used += resp.usage.input_tokens
        if used > MAX_INPUT_TOKENS:
            return stop("token_budget", step)
        action = resp.action
        if action.kind == "done":
            return finish(action)
        key = (action.signature(), hashlib.sha1(shot.small()).hexdigest())
        recent.append(key)
        if len(recent) == 3 and len(set(recent)) == 1:
            return stop("no_progress", step)
        decision = gate(action, browser.current_url)   # see next section
        if decision != "allow":
            return pause_for_approval(action, decision)
        browser.execute(action)
    return stop("max_steps", MAX_STEPS)

Retries need the same discipline. A step that fails and is retried re-sends the full context, so count retries against the step and token budgets. The pricing page says non-200 responses are not charged,1 which helps with errors but not with your own re-sends after a timeout that did produce a billable response. If a provider failure forces a change of model mid-run, read failover mid agent run first: browser state lives in your sandbox, not in the model, so a resumed run must re-observe the page rather than trust old coordinates.

Put approvals outside the model

A model that can click can also click "Confirm purchase". Do not rely on the prompt to prevent that. Put a gate in the harness that classifies each proposed action before it executes, using what you know and the model does not: the current URL, the element under the cursor, and the account in use.

A workable first policy has three outcomes:

  1. Allow reads and navigation inside approved domains: scrolling, clicking links, filling search boxes.
  2. Hold for a person anything that changes state outside the sandbox: submitting a form that sends or pays, deleting, changing permissions, uploading or downloading files, and typing into a field that looks like a password or card number.
  3. Deny actions that leave the allowed domain list, open a new window to an unlisted host, or run a downloaded file.

Show the approver the screenshot, the proposed action and the target element, and record who approved it. If the vendor returns a safety signal with an action, treat it as one more input to the gate, not a replacement. I could not read what Google returns here, so check its documentation, and design the gate so it works if no such signal exists.

Keep approval cheap to wait on. A paused run holds a browser container, so store the state, release the container, and resume by re-observing the page after approval, with a time limit on how long an approval can sit.

Sandbox the browser and deny egress by default

The screenshot is an input channel an attacker controls. Any page the agent visits can show text meant to redirect it, which is the prompt injection problem in a visual form; defense in depth covers the general case. You cannot filter what a screenshot says, so assume that a hostile page will sometimes steer the model, and limit what a steered model can reach.

Run each task in a disposable environment:

  • One browser per run, in a container or microVM with a fresh profile, destroyed at the end. No shared cookies, no saved logins from real users.
  • No host mounts, non-root user, read-only root filesystem where the browser allows it, and CPU, memory and process limits.
  • Scoped credentials: if the agent must sign in somewhere, give it a dedicated account with the least rights that complete the task, injected at run time and short-lived where the target supports it. Never put your provider API key inside the sandbox; the harness outside it calls the model.
  • Deny-by-default egress through a proxy: allow only the domains the task needs, resolve DNS through the same proxy, and block private ranges and the cloud metadata address so a steered browser cannot reach internal services or instance credentials.
  • Downloads and uploads off unless the task requires them, and scanned when it does.

Egress control also protects your model spend. If the sandbox can only talk to the proxy, the only path to a provider is the harness, which is where your budgets live; blocking direct AI provider calls describes the network rules.

Record each run so cost and behavior can be audited

Give every run an id and log, per step: the action, the target URL, the gate decision, the input and output token counts from the response, and the model that answered. Then a bill that rose can be traced to a run, and a run to a step. Tracing an agent run covers joining these across model calls.

If your model calls go through a gateway, the gateway can contribute the cost side. INFRO records each request's model, latency, token counts and estimated provider cost, queryable by project and key, and can refuse requests once a budget cap on a key, project or organization is reached, using your own provider connections and with 0% markup on model spend.2 Per-request traces and a model allowlist per project are also available. Two limits matter here: INFRO does not run your browser or enforce your sandbox's network rules, and I have not confirmed that Gemini's Computer Use tool is carried through any particular endpoint, so check the INFRO docs (opens in a new tab) for the request shape you plan to use before you route an agent through it. The step, time and approval bounds above stay in your harness regardless.

Pre-launch checklist

  • GA status, supported models and screenshot token cost confirmed on Google's own pages for the model you will use.
  • Token cost per step measured from response usage metadata on 20 or more real tasks, with and without history trimming.
  • Max steps, wall-clock deadline, per-run token budget and no-progress check enforced in the harness.
  • Per-run and per-day spend ceilings set outside the harness, so a bug that starts many runs still stops.
  • Action gate in place with allow, hold and deny outcomes; approvals logged with approver and screenshot.
  • One disposable browser per run, no host mounts, scoped credentials, no provider keys inside.
  • Egress proxy with a domain allowlist, DNS through the proxy, private ranges and metadata address blocked.
  • Screenshot retention and access decided and documented.
  • Cost forecast uses the rates that apply on the day the traffic runs, including the dated changes on the pricing page.1

Questions readers ask

Is a computer-use step billed per action or per token?
Google's Agent Platform pricing page describes the Computer Use Tool as priced on the total input tokens sent to the model and the output tokens it generates, at the rates of the model used. It adds that function declarations count as input 1. Treat each step as an ordinary model request whose input is large.
Does a failed step cost money?
The same pricing page says you are charged only for requests that return a 200 response code, and that 4xx and 5xx responses are not charged for input or output. It also notes that from November 13, 2026, Gemini 4 completions over 32K tokens are charged for retrievable token usage even if the request fails on a timeout 1. Your own retries still re-send the whole context.

From the team that builds it

Where this shows up in INFRO

INFRO is a control plane in front of the provider accounts you already hold. The capabilities below are the parts of it this article touches, each with the documentation that defines its behaviour.

INFRO accounts are self-serve. Provider usage is billed to you by your providers; INFRO charges a software subscription and takes 0% of model spend. See plans.

Sources

Numbered in order of first citation. Each was opened and checked against the claim on the date shown.

  1. 1.Agent Platform pricing (Generative AI, Gemini 4 and Gemini 3, Computer Use Tool) (opens in a new tab) — Google Cloud. Accessed Nov 7, 2026.
  2. 2.INFRO documentation overview (opens in a new tab) — INFRO. Accessed Nov 7, 2026.

About this article

Read on 2026-11-07: Google Cloud's Agent Platform pricing page (Computer Use Tool section, Gemini 4 and Gemini 3 rates) and INFRO's docs overview. The ai.google.dev changelog, computer-use and pricing pages could not be read, and the Google Cloud computer-use page returned only navigation, so General Availability status, supported models, per-screenshot token counts, built-in step limits and safety fields are not confirmed here; check them against Google's pages before relying on them.

Last checked against its sources on . The next review is due by . No separate named reviewer is recorded for this article.

How articles are written, sourced and corrected is set out in the editorial standards.