Whoever sends an email, a support ticket or a news feed picks the links in it. An AI agent that follows such a link blindly can open an internal admin page or a cloud credentials endpoint and hand what it finds to the model. So when a link resolves to an address inside the agent's own network, the agent should refuse it. It has to check where the name really resolves on every redirect, because a hostname that looks public can still land on the agent's own machine. Any company putting AI agents on customer email, tickets or feeds carries that risk until something in the agent refuses those addresses.
We found the hole in our own two content agents, the writer behind this blog and the agent that keeps our Databricks Field Guide current. On 12 October we closed it once, in TechFabric Harness, the framework we build agents on. A new agent starts with the fix instead of needing its own before it reaches production. One narrower gap, DNS rebinding, stayed open on our agents.
What we deleted
When Cloudflare shipped web_fetch on 11 October we wired it into both agents the next day, as a direct call from each. It worked, and it left the same reading code in two places, a workaround for running it outside a Worker, and a version pin to stop a dependency from breaking our model gateway. In each agent, those three things went away:
- The direct
fetchWeb()call. Each agent called Cloudflare's reader itself, with its own options and its own error handling. - A REST shim.
fetchWeb()expects a Workers AI binding. Our agents run in GitHub Actions, not in a Worker, so each carried a hand-written object that impersonated the binding by calling Cloudflare's/ai/tomarkdownendpoint. The blog writer also carried a test for it. - An
.npmrcpin. Adding Cloudflare'sagentspackage would have upgraded the model library under our framework, so both agents pinned it back.
Each agent now asks the framework for a page instead:
const fetchPage = cloudflareWebPageFetcher({
accountId: account,
apiToken: token,
userAgent: READER_UA,
timeoutMs: 30_000,
});
const page = await fetchPage({ url });
An agent that wants the model to search and read for itself can register both tools in one line:
const tools = cloudflareWebTools(cloudflareWebToolsFromEnv(process.env));
Ours don't, deliberately. Both agents read pages in their own code and hand the text to the model, so the model never decides on its own which URL to open. That's a choice we'd make again for any agent that publishes.
The line counts don't shrink much, about +190 and −102 in each agent, because most of what we added is security tests.
What it caught
Before the move we ran a simple probe. We gave each agent a public hostname that resolves to its own machine, 127.0.0.1.nip.io, pointing at a local page that said "INTERNAL SECRET".
The old direct call read it. The framework's reader refused it with POLICY_DENIED.
That's a server-side request forgery hole: the agent reads a URL somebody else chose and lands inside its own network. TechFabric Harness now checks where a name actually resolves before it reads, applies the agent's network policy on every redirect, and holds the page request and its Markdown conversion to one 30-second deadline. It took fourteen review rounds to get the policy applied everywhere a request can leave, and every gap found along the way has a test that fails on the old code.
One gap was left when we shipped. In a DNS rebinding trick a name resolves one way when it's checked and another way when it's read, so it could still reach a private address through the framework's reader and through the plain fallback our agents keep for outages. TechFabric Harness merged a fix for Node.js the next day: each request now resolves once, checks every answer and connects only to the addresses it checked. It was released on 16 October, in @fabric-harness/sdk 6.7.0 and @fabric-harness/cloudflare 2.7.1. A Cloudflare Worker can't pin its connection to a checked address, so the issue stays open in the Harness tracker for Workers. Both our agents still run 6.6.0 and 2.7.0, and our own fallback still checks DNS and then lets the connection resolve again. On our side, the gap closes when we move them up and give the fallback the same pinning.
The upgrade we'd been avoiding
Both agents had been pinned to TechFabric Harness 6.2.0 since a fresh install broke their connection to Cloudflare's AI Gateway earlier this month. Taking the web tools meant leaving that pin, so we went looking for the cause.
It wasn't where we expected. Version 6.5 pulled in a newer Anthropic SDK that, when a call carries no API key, goes looking for credentials in the developer's home directory. Our calls carry no key on purpose, because the gateway holds it. On a laptop the call failed before it sent anything, with "Credentials file not found". On a machine with a profile, it would have attached that developer's Anthropic token to a request bound for Cloudflare. CI has no profile, so CI never showed it.
We fixed it by moving forward rather than back, because the next version of the model library never does that lookup. We released the framework with it, confirmed real gateway calls with the bad profile still in place, and moved both agents up.
| Before | After | |
|---|---|---|
@fabric-harness/sdk |
6.2.0 | 6.6.0 |
@fabric-harness/cloudflare |
not used | 2.7.0 |
| Model library (pi-ai) | 0.83.0 | 1.2.0 |
| Anthropic SDK | 0.91.1 | 0.129.0 |
.npmrc pin |
needed | deleted |
| Packages in each agent's lockfile | 383 and 384 | 461 and 462 |
The extra 78 packages come with the Cloudflare integration's own dependencies. That's a real cost, and a lockfile diff is the first thing we'd read before taking any SDK into an agent that publishes.
What it didn't change
Speed. We read five real sources twice, before and after, and the medians landed within network noise of each other. The text the agents receive is identical. Keeping people in charge of what an agent may reach is the same work we do when we govern agents already in production.
Both agents passed their canaries after the merge. The Field Guide's took 2 minutes 26 seconds and the blog writer's 4 minutes 44 seconds, each reading real pages and producing a real decision.
Why the reader lives in the framework
The AI agents we build act on other people's data, and every one of them reads something it didn't write. A reader that refuses private addresses, honours a network policy on every hop and holds one deadline belongs under all of them, so we keep it in TechFabric Harness and the next agent we build starts with it.
Frequently asked questions
Does the shared reader protect an agent that has a different network policy?
Yes, because the reader applies the agent's own network policy on every redirect, so each agent keeps the rules it was given. It took fourteen review rounds to get the policy applied everywhere a request can leave, which is why we'd rather have it in one place than in each agent.
Is the DNS rebinding gap a reason to hold an agent back from production?
We didn't hold ours back, because neither agent checked DNS at all before the move, so the move made nothing worse. Harness SDK 6.7.0 closes the gap for agents running in Node.js, and it stays open for agents in a Cloudflare Worker, where the connection can't be pinned to the checked address. Our two agents still run 6.6.0, so for them it closes with the upgrade and a matching change to our own fallback.
What should I read before taking a shared SDK into an agent that publishes?
Read the lockfile diff first. Ours went from 383 and 384 packages to 461 and 462, and that growth came from the Cloudflare integration's own dependencies. The version table also showed the model library and the Anthropic SDK moving, and the model library's move to 1.2.0 is what removed the credentials lookup that had broken the gateway calls.