LevelUpWith

Explore / Browser & Desktop Agents: Computer Use in Production / Lesson 1

Lesson 1: When a Computer-Use Agent Is the Right Tool

Learn a decision ladder for automating a task: an official API first, then an MCP server, then a scraper or a fixed script, and a computer-use agent only when the interface is the only way in, with the cost, latency and reliability each choice brings.

Free to read, no account needed. Part of Browser & Desktop Agents: Computer Use in Production.

By the end of this level you'll be able to

  • Sort five real automation requests into API, MCP server, scraper, scripted browser or computer-use agent, and give a one-line reason for each
  • Estimate how cost, latency and failure rate differ between an API call and a screenshot-driven agent doing the same task
  • Write a short decision record that rejects a computer-use agent for at least one task where a cheaper option works

Start with the question nobody asks

You've built a tool-calling agent. When it calls create_invoice(customer_id, amount), it gets back typed JSON in a few hundred milliseconds. A computer-use agent works a different way. It takes a screenshot, decides where to click, clicks, waits for the page, takes another screenshot, and keeps going until the job is done. It's like phoning the kitchen with your order versus sending a robot to stand at the counter and read the menu board.

The robot can handle almost any interface, which makes it the most general tool you have. It's also the slowest, the most expensive and the most likely to fail. So the most useful skill in this course comes first: knowing when not to build one.

The decision ladder

Work down this ladder and only step down a rung when you have a written reason.

  1. Official API. It's typed, documented, versioned, and you're allowed to use it. If one exists, use it.
  2. MCP server. Someone has already wrapped the API or the app as tools your agent can call. GitHub, for example, ships an official MCP server for issues, pull requests and workflows. You get tool calls instead of pixels, without writing the integration yourself.
  3. Scraper or scripted browser. For public, read-only pages, fetch the HTML and parse it. For a stable UI flow with no API, write a fixed Playwright script. Both are deterministic and cheap to run. They break loudly when the page changes, and loud failures are easy to spot.
  4. Computer-use agent. Use one only when the interface is the only way in and the path changes from run to run: different layouts on every vendor portal, a legacy desktop app, or a flow too varied to script.

Gotcha: rung 2 can hide a browser. Microsoft's Playwright MCP drives a real browser. By default, though, it gives the model accessibility snapshots: a text tree of page elements, each with a reference the model can act on, so no screenshots are needed. The ladder is about what the model has to perceive, not whether a browser is involved somewhere.

The labs themselves point the same way. OpenAI's computer-use guide says that if you already expose UI operations as function calls or MCP tools, you should keep that interface.

Worked example: sorting five requests

Request Rung One-line reason
"Email me last night's Stripe payout total" API Stripe has a documented payouts endpoint, so it's one call.
"Let our support agent open GitHub issues" MCP server GitHub's official MCP server already exposes issue tools.
"Track a competitor's public price page daily" Scraper The page is static HTML and the task is read-only. Check the site's terms first.
"Submit the weekly timesheet in our HR portal" Scripted browser The form never changes and there's no API, so a Playwright script will do.
"Download invoices from 40 supplier portals, each laid out differently" Computer-use agent No APIs, and 40 different layouts make fixed scripts too costly to maintain.

Only one of the five needs a model looking at screens.

Putting numbers on it

Gut feel is easy to argue with. A small estimator is harder to argue with. Claude's vision docs say an image costs one visual token per 28×28-pixel patch. Other vendors count differently, so swap in your own vendor's rule.

import math

# Visual tokens: one per 28x28 patch (Claude's documented rule)
def visual_tokens(w, h):
    return math.ceil(w / 28) * math.ceil(h / 28)

shot = visual_tokens(1920, 1080)   # 69 * 39 = 2,691 on a high-res-tier model

STEPS = 15                  # actions needed to finish the task
KEEP_SHOTS = 3              # screenshots kept in context each turn
FIXED = 3_000               # system prompt + tool definitions, resent every turn
TEXT_PER_STEP = 150         # model reasoning + action per step
PRICE_IN = 4 / 1_000_000    # illustrative $/input token
PRICE_OUT = 20 / 1_000_000  # illustrative $/output token
SECONDS_PER_STEP = 5        # model call + action + waiting for the page

input_tokens = 0
for step in range(1, STEPS + 1):
    shots = min(step, KEEP_SHOTS) * shot   # recent screenshots ride along
    history = step * TEXT_PER_STEP         # text history grows each turn
    input_tokens += FIXED + shots + history

cost = input_tokens * PRICE_IN + STEPS * TEXT_PER_STEP * PRICE_OUT
print(f"screenshot tokens: {shot}")
print(f"input tokens/run:  {input_tokens}")
print(f"cost/run:          ${cost:.2f}")
print(f"latency/run:       ~{STEPS * SECONDS_PER_STEP} s   (API call: ~0.3 s)")
for p in (0.97, 0.99):  # per-step success; failures compound
    print(f"P(success) @{p:.0%}/step: {p ** STEPS:.0%}")
screenshot tokens: 2691
input tokens/run:  176022
cost/run:          $0.75
latency/run:       ~75 s   (API call: ~0.3 s)
P(success) @97%/step: 63%
P(success) @99%/step: 86%

Three lessons are packed into that output:

  • Cost grows with every turn, because each request resends the system prompt, the tools, the text history and recent screenshots. One run costs 75 cents. At 1,000 runs a day that's $750, against almost nothing for the API call.
  • Latency is minutes, not milliseconds. That makes it a poor fit for anything a user waits on.
  • Reliability compounds. A 97%-per-step agent finishes a 15-step task only about two times in three. This assumes each step fails independently, which is a simplification, but the direction is right. Later levels cover recovery, which improves this.

Trade-off: the prices and seconds-per-step above are placeholders. Plug in your vendor's current pricing and your own measured timings. Keep the structure of the calculation and replace the numbers.

Writing the decision record

When you reject a computer-use agent, write down why, so the next engineer doesn't rebuild it.

# DR-007: Stripe payout report
Status: Accepted
Request: Daily email of last night's payout total.
Options considered:
  - Computer-use agent on Stripe dashboard: ~$0.75/run, ~75 s, ~63-86% success
  - Stripe REST API: ~0.3 s, near-zero cost, deterministic
Decision: Stripe API.
Why not computer use: an official API covers the task fully.
Revisit if: the data we need is visible only in the dashboard UI.

The Revisit if line matters. It names the condition that would move the task down the ladder.

Exercise

  1. List five automation requests from your own work or backlog.
  2. Sort each one onto a rung and give a one-line reason.
  3. For the request you were most tempted to give a computer-use agent, run the estimator with your real step count and your vendor's pricing.
  4. Write a decision record that rejects the agent for at least one task where a cheaper rung works. Include a Revisit if line.

Key takeaways

  • Go down the ladder in order: API, then MCP server, then scraper or scripted browser, then computer-use agent.
  • Choose a computer-use agent only when the interface is the only way in and the path varies from run to run.
  • Screenshot agents cost tokens on every turn, take minutes, and lose reliability with every step.
  • An MCP server may drive a browser underneath while still giving the model structured text instead of pixels.
  • Record every rejection with numbers and a condition for revisiting it.

A 6-question knowledge check follows this lesson in the app, free and without an account.

More like this