-
Notifications
You must be signed in to change notification settings - Fork 4.6k
writing tasks for an ai browser agent
Name the exact starting URL instead of asking it to search, say what "done" looks like, and state the output shape you want. Tell it what to do when data is missing, describe any interaction the page demands, keep one task to one goal, and cap how many pages or how long it runs. That is the whole skill.
A browser agent does not see your intent, it sees a snapshot of a page and whatever you typed as the instruction. It has no memory of what you meant beyond the words used, and it fills any gap with a guess, because most agent loops never get a chance to ask a follow-up mid-task.
If a well-written task still misfires, the next question is not a better prompt, it is whether the browser or the model broke, which is a different test.
Asking an agent to "find" something sends it through a search engine first, and results are themselves a page full of ambiguity: which result, sponsored or not, which of three similarly-named sites. Naming the URL skips that decision.
Before:
Find me some interesting tech news from today.
After:
Go to news.ycombinator.com and give me the top five titles.
The "after" version is close to verbatim from AIHawk's own README: one URL, one bounded ask. The "before" version leaves the agent to pick a search engine, a query, and which result counts as news, three extra decisions before it reaches the content you wanted.
Without a stated finish line, "finished" can mean anything from one page read to the model declaring victory early. Pair that with the exact shape you want the answer in, or you get prose where you wanted a table.
Before:
Get me the prices of the laptops on this page.
After:
Go to
<paste the URL>. List every laptop under $1000 shown on the first two pages of results, one row per laptop, with columns Name and Price. Stop after two pages even if more remain.
The "before" prompt never says when to stop reading, so the agent might read one laptop or forty. The "after" prompt fixes the shape (a row per laptop, two named columns) and the stopping point, so the result is predictable before the run starts. The forms page makes the same point from the filling side: a stated checkpoint beats an open-ended "finish the whole thing."
A model under pressure to answer will often guess rather than admit it does not know. Say explicitly what counts as missing and what to do about it.
Before:
Give me the shipping cost to Canada for this product.
After:
Give me the shipping cost to Canada as listed on the product page. If it is not shown before checkout, say "not listed" rather than estimating from other countries' rates.
Without that second sentence, a model that cannot find a number sometimes reasons its way to one anyway and hands it to you as fact. "Say so, never guess" is a short instruction that closes an entire failure mode.
Typing and clicking are not interchangeable to a page. An agent that assumes text input works everywhere will fight a calendar widget for several turns before landing on the wrong day.
Before:
Find me a cheap flight from Milan to Lisbon next month.
After (adapted from AIHawk's own README):
Go to
<paste the URL>. One way, Milan to Lisbon, economy, one checked bag, one adult. Check every date from the 12th to the 16th of next month, one at a time, and read the cheapest fare for each day. The date field is a calendar widget, so click the days rather than typing them. If a date has no availability, say so. Do not guess a number.
That one sentence, "the date field is a calendar widget, click the days rather than typing them," tells the agent which of its two ways of entering a date will actually work here, before it burns turns discovering that alone.
A prompt asking for three unrelated things gives the model three chances to drop one silently, with no way to tell which from the transcript alone. One instruction, one goal, and a fresh instruction for the next, is more reliable than it looks.
An unbounded task ("check every listing") can run until a turn budget stops it mid-thought, on a page the agent had no way to know was this large. Stating a cap, "the first three pages," "stop after ten minutes," turns an open-ended risk into a bounded one with a clean stopping point.
AI agents for web research bounds a walk the same way, one page range at a time, for exactly this reason.
What is the most important thing to get right in an AI agent prompt? Removing ambiguity about the starting point, the finish line, and the output shape. Those three alone fix most of the failures people blame on the model.
How do I stop an AI agent from making up an answer? Tell it explicitly what to do when a value is missing: "say not listed, do not estimate." Naming the failure case in the instruction is what stops the model from quietly filling the gap with a guess.
Can an AI agent handle a calendar or date picker? Better if the instruction says the field is click-only. Agents that assume typing works everywhere waste turns on the widgets that demand clicks instead.
How long or how many pages should I let an agent run? Whatever you can state as a number: a page count, a time limit, an item count. An unbounded task risks stopping mid-thought at a turn limit instead of at a point you chose.
See also: getting an AI agent to fill out forms, browser problem or model problem?, and AI agents for web research.
All retrieved 2026-09-05.
- feder-cr/AIHawk, this repository's README, for the Hacker News and flight-fare example prompts, both read in the working tree 2026-09-05.
From the AIHawk wiki. Every before/after pair above follows the same shape the project's own README uses in its worked example: name the page, name the finish line, name the shape of the answer.
- OpenAI Operator alternatives
- Open-source Operator-style agents
- Is OpenAI Operator still available?
- OpenAI Operator vs Claude computer use
- browser-use alternatives
- Choosing an AI browser agent
- Open-source AI browser agents
- Open-source computer-use agents
- What is an AI web agent?
- AI browser agents vs traditional scraping
- Cloud browser infrastructure for AI agents, explained
- Browserbase alternatives
- Firecrawl vs an AI browser agent
- Skyvern alternatives
- Stagehand vs browser-use
- Project Mariner is gone: what replaced it
- Manus alternatives
- Gemini computer use vs Claude computer use
- AIHawk, reviewed honestly by its own wiki
- AI browser vs AI browser agent: which one do you want?
- AI browser agent vs RPA: which one fits the job
- AI browser agent vs n8n, Zapier and Make
- Vercel agent-browser alternatives, compared honestly
- Why does my AI agent get blocked?
- The timing signal AI agents give off
- Agent retry loops trip rate limits, not fingerprints
- Claude computer use detected as a bot
- browser-use getting blocked: what you can and cannot change
- Getting an AI agent to fill out forms
- Which model to use with AIHawk
- Browser problem or model problem?
- Running AIHawk's browser from Claude Code
- Extracting data to a CSV with an AI agent
- Monitoring a page for changes with an AI agent
- Running AIHawk's browser from Claude Desktop
- Running AIHawk's browser from Cursor
- Using an AI agent to hunt for apartments
- Getting website data into Google Sheets with an AI agent
- Using an AI agent to download invoices from portals
- AI agents for web research
- Using an AI agent to test your own website
- Running AIHawk's browser from Cline
- Posting to social media with an AI agent
- Posting to Facebook with an AI agent
- Posting to Instagram with an AI agent
- Posting to X with an AI agent
- Automating LinkedIn posts: read this first
- Appointment bots: what they are and what an agent can legitimately do
- Track prices across sites with an AI agent
- Build a lead list with an AI browser agent
- Run an AI browser agent on a schedule
- AI browser agent with a local LLM: what changes
- Should you log your AI agent into your accounts?
- How to write a task an AI browser agent can follow
- Move data between two web apps with an AI agent
- The MCP server
- How the tools are shaped, and why