URL parse gate
Reject missing schemes, userinfo surprises, encoded host tricks, non-HTTP schemes, overlong inputs, and ambiguous normalization before DNS resolution.
Fetch SSRF checklist
A URL tool can reach whatever the MCP server can reach. If that server runs in a cloud, CI, laptop, VPC, or cluster, open fetch becomes a credential and internal-network boundary. The safe default is to deny dangerous targets before the request leaves the runtime.
Fast answer
The production checklist
Reject missing schemes, userinfo surprises, encoded host tricks, non-HTTP schemes, overlong inputs, and ambiguous normalization before DNS resolution.
Resolve the hostname at request time, classify every A/AAAA result, and deny link-local, loopback, private, carrier-grade NAT, multicast, IPv6 ULA, and service-network addresses by default.
Apply the same host and IP policy after every redirect. A safe first URL cannot redirect into metadata, loopback, or private infrastructure.
Record which server, cloud role, proxy, token, cookie jar, or provider credential would be exposed if the request were allowed.
If internal access is intentional, require a named route card with target host/CIDR, caller, tenant, purpose, review owner, credential lane, and quota owner.
Return a policy denial with raw URL, normalized host, resolved IP class, rule id, blocked credential lane, and recovery hint instead of a generic network failure.
Denied neighbors
Examples: 169.254.169.254, metadata.google.internal, instance-data, IMDS-style aliases
Expected: Deny before request; receipt names metadata/link-local policy and credential lane protected.
Examples: 127.0.0.1, ::1, localhost, decimal/hex/octal host encodings
Expected: Deny before request; receipt shows normalized host and loopback classification.
Examples: 10.0.0.0/8, 172.16/12, 192.168/16, fd00::/8, Kubernetes service ranges
Expected: Deny unless a specific internal route card authorizes that target for the caller and tenant.
Examples: Public URL returning 30x to metadata, loopback, or RFC1918 address
Expected: Re-run DNS/IP policy on redirect and deny with redirect hop preserved in trace.
Trace evidence
Fetch SSRF protection is only operator-grade if the denial is reconstructable. Store enough evidence to show the target was classified and blocked before any credential, proxy, cookie, or cloud role was exposed.
Internal exception card
Some agents legitimately need to reach internal services. That should never be granted by weakening public fetch policy. Give the internal lane its own route card, review owner, target scope, credential lane, and expiration.
Internal target / CIDR:
Caller / tenant / workspace allowed:
Business purpose:
Credential lane exposed:
Quota owner / retry ceiling:
Review owner:
Allowed methods and response size:
Forbidden neighboring targets:
Receipt fields:
Expiration / re-review date: Common misreads
Related operator guides
Use the same denied-neighbor discipline for filesystem, repo, workspace, and local-resource tools.
Use a route card to bind caller, authority surface, credential lane, denied neighbor, and receipt before a fetch route repeats.
Scope, principals, and evidence are the security model when fetch becomes network authority.
Run fetch SSRF as a readiness gate beside tenant isolation, tool scope, quota, and recovery checks.