Let an agent use the web
This guide shows you how to give an agent the ability to search the public web and read pages, and how to keep that ability under control: which calls ask for approval, how many calls one run may make, and which domains the agent can reach.
Prerequisites
Section titled “Prerequisites”-
A flow with an Agent node.
-
A search provider. Searching works out of the box when your operator has configured a platform search key. To search on your workspace’s own account instead, point the Search API key on the Outbound access page at a secret holding your key. When the platform has no search key at all, set the credential field on the Web Search node itself. Reading pages needs no key.


Wire the web tools
Section titled “Wire the web tools”The agent gets exactly the web tools you wire. Both nodes sit under API & integrations in the node picker:
- Web Search gives the agent a
web_searchtool. It returns ranked results with each page’s title, URL, snippet, and scored passages, short extracts from the page itself that often carry the answer outright. - Web Fetch gives the agent a
web_fetchtool. It returns the readable text of one page, and can return the passages about a topic instead of the top of the page.
Connect each node’s output to the Agent node’s Tools handle (the wrench icon at the left of the Agent node’s bottom edge). Wire both for the full find-then-read loop. Wiring only Web Search is often enough: the passages frequently answer the question without a fetch.




For the full field lists and output shapes, see Web Search and Web Fetch.
Pin fields, or leave them to the model
Section titled “Pin fields, or leave them to the model”Every field you fill on the node, with a literal or an expression, is pinned: the tool never offers it to the model, and a value the model invents for it is ignored. Leaving a research field empty, Query or Max results on Web Search, URL, Find, Max chars or Fresh on Web Fetch, turns it into a parameter the model fills per call. Guardrail fields such as Allowed domains and Credential are never offered to the model.
So a Web Fetch node with URL set is a “read this page” tool for a page you chose, while one with URL empty lets the agent decide what to read. The same applies to Query on Web Search.
Know which calls ask for approval
Section titled “Know which calls ask for approval”Web calls are gated by one question: who chose the address?
- Searching never asks. The query goes only to the configured search endpoint, so
web_searchcounts as a read in every approval mode. - Fetching a page you chose never asks. A pinned URL is your decision, not the model’s.
- Fetching a page the run was given never asks. A URL the model copied exactly from a search result, or from the run’s own prompt, was chosen by the search index or by you, so it counts as a read too. This keeps the ordinary search-then-read loop running without interruptions.
- Fetching a URL the model constructed itself is the sensitive case. An assembled URL is the one shape that can carry workspace data out in a path or query string, so it counts as reaching an outside system. The match on known addresses is exact: a known URL with an added query string counts as constructed.
How that last case behaves depends on the agent’s approval mode:
| Mode | A model-constructed URL |
|---|---|
| Read-only | Refused. Searching and reading found pages still work. |
| Ask first | Pauses for your approval. |
| Auto-write | Pauses for your approval. |
| Autopilot | Runs without asking; the call is recorded. |
The Approval setting on either web node overrides the mode in both directions: always ask pauses the call even on Autopilot, and never ask releases it even in Ask first mode. Read-only ignores the setting either way: reads run, everything else is refused. See approvals for how modes and pins resolve.
Cap web calls per run
Section titled “Cap web calls per run”The Agent node’s Max web calls field, under More settings, sets how many web searches and page reads one run may make, combined. The agent’s Max steps bounds how many times it thinks, not how much of the web it reads, and a model that keeps not finding an answer keeps fetching, so the two limits are separate.
- Leave it empty to use the platform default (20 unless your operator changed it).
- Set it higher for an agent whose job is research.
- Set it to 0 for no limit.
When the budget runs out the agent is told so and answers from what it already gathered. Further web calls come back refused instead of running; the run does not fail.
Restrict which domains the agent reaches
Section titled “Restrict which domains the agent reaches”Domain rules from the Outbound access page apply to agent web calls the same way they apply to every other outbound call from your workspace. See outbound access for the page itself; for web calls specifically:
-
Your workspace’s Allowed domains list restricts which hosts a fetch may reach. A parent domain covers its subdomains, so
hubspot.comalso allowsdevelopers.hubspot.com. The list narrows any platform-wide allowlist; it can never widen it. -
A refused fetch fails with a message naming the host and which list refused it, and the host appears in the blocked list on the Outbound access page. A host your own list refused is one click from being allowed; one the platform list refused is shown too, but only your operator can widen that list.


-
When a platform allowlist is configured, search results the agent cannot fetch are flagged as not readable, so it picks another result instead of burning a call to find out.
-
The Allowed domains field on a Web Fetch node narrows further, for that node only.
-
The SSRF firewall applies regardless: private, loopback, and internal addresses are blocked whatever the lists say.
Freshness and caching
Section titled “Freshness and caching”A page read twice within about 15 minutes comes from a workspace-local cache rather than a second download, which suits an agent re-reading the same reference page across steps. Every fetch result says whether it was cached and when it was retrieved, and the model can request a fresh read when the point is whether the page changed, such as a status page or a changelog.
Worked example: a research agent
Section titled “Worked example: a research agent”A webhook-triggered agent that researches a question and reports back with sources:
- Add an Agent node. Set Instructions to something like: “You are a research assistant. Search the web, read the most relevant results, and answer with the URL of every source you used. If the web call budget runs out, say what is still unverified.” Set Message to the incoming question, for example
{!! $start->payload->question !!}. - Add a Web Search node and a Web Fetch node, both with their fields empty, and connect each output to the agent’s Tools handle.
- Under More settings, set Max web calls to 40: research is the case the default budget is too small for.
- Leave the approval mode at Ask first.
Run it with a question and open the run report. You see the agent search, read passages, and fetch two or three of the result pages. None of those calls asks for approval, because every URL came from a search result. If the model instead assembles a URL it never saw, say by guessing https://example.com/pricing, that one call pauses for your approval before it runs.
That distinction matters for unattended agents. On a schedule nobody is watching to approve, and a paused request eventually expires. Either instruct the agent to fetch only pages it found through search, which never pauses, or choose Autopilot deliberately, within whatever ceiling your workspace allows.
Related
Section titled “Related”- Web Search and Web Fetch: the node reference pages.
- Add human approval to an agent: modes, pins, batched cards, and grants.
- Outbound access: the workspace’s domain rules and blocked list.