OptionalallowedDirectories a path may live in (real paths are compared, so symlinks cannot escape).
OptionalallowedHostnames a URL may point to: exact (api.example.com), with port (host:8443) or wildcard (*.example.com).
OptionalallowedDefault ['http:', 'https:']. file:// URLs are filesystem reads and follow allowedDirs instead.
OptionaldenyReject loopback / RFC 1918 / link-local / ULA / cloud-metadata hosts. The name is checked first (literal
IPs, localhost, *.internal, …); then, on Node, the hostname is resolved (dns.lookup, every
address) before each request and every hop of a redirect, and a public name that resolves to a private
address is refused too. What this does not do is pin the connection to the checked address — a server
that answers with a public address first and a private one on the next lookup (DNS rebinding TOCTOU)
needs fetch built on a pinned dispatcher (see SECURITY.md) or an egress proxy. Browsers cannot resolve
names; there only the name check applies.
OptionalfetchCustom fetch (proxy, DNS pinning, auth); receives (url, { redirect: 'manual', signal }).
OptionalmaxMaximum payload size in bytes; responses are read incrementally and cut off past the cap.
OptionalmaxMaximum redirect hops for URL loads (default 5); every hop is checked against the policy.
OptionalresolveResolver used by denyPrivateHosts (default on Node: dns.promises.lookup(host, { all: true })).
Return every address the connection may use; null skips the address check for that host.
OptionalsignalCaller-owned cancellation.
OptionaltimeoutAbort the load after this many milliseconds.
Boundaries for network / filesystem loads. Set once for the process with
setIoPolicy()and / or per call; a load must satisfy both (per-call options narrow, never widen).