Security · ~7 min
You don't need to read a response to leak data. The moment an agent fetches a crafted URL, the secrets are already in the attacker's server log — encoded in the query string of the request itself.
Prompt injection in a page, email, or document instructs the agent to fetch a URL carrying private data in the query string. The attacker's server logs it. The user sees nothing. No response body needs to be read — the damage is done in the request.
The same applies to embedded resources — images, iframes — fetched before the user can inspect them. And redirect chains extend the reach: a URL on a trusted (allowlisted) domain immediately forwards to an attacker domain, and the agent follows it with full query parameters intact.
The correct invariant: a URL that was independently discoverable on the public web — with no access to the current user's session, context, or identity — cannot encode user-specific data. That leads to a public-web index gate: before auto-fetching, cross-reference the URL against a crawl index built with no user data. In the index? It can't contain user secrets. Not in it? Treat as unverified — block or surface to the user.
The follow_redirects=False flag closes the redirect-chain bypass — apply the same index check to the
redirect target before following it.
Three failure modes: session-specific URLs never appear in a public crawl (correctly flagged, but a determined attacker can pre-seed a crafted URL into the index); newly-published legitimate pages are blocked alongside attacker URLs, eroding trust in the warnings; and DNS tunneling, timing side channels, and header covert channels are not addressed at all. Teams that treat the gate as a complete exfiltration defense get a false sense of security.
Where those modes are unacceptable, strict egress controls — block all outbound access, allow only explicitly whitelisted API endpoints — give a stronger, simpler guarantee. And because URL exfiltration is delivered by prompt injection, layer it with injection defenses: narrow task instructions on what may be fetched, skepticism toward embedded instructions, and confirmation gates before fetching URLs built from conversation context.
Retrieval practice — recall, don't peek
Question 1In a URL-exfiltration attack, the data leaks…
Question 2The right question to ask about a URL is whether it…
Question 3A public-web index gate is safe because a URL in the index…
Question 4The index gate does not protect against…
Question 5 · spaced recall from Lesson 13What makes slopsquatting economically viable for an attacker is that…