agentskit.js

safeFetch

Auto-generated API reference for safeFetch.

Function: safeFetch()

safeFetch(input, init?, policy?): Promise<Response>

Defined in: safe-fetch.ts:122

fetch with default-deny egress (ADR-0010). Validates the URL and every redirect hop against checkEgress; redirects are followed manually so each target host is re-gated. Throws a ToolError (AK_TOOL_INVALID_INPUT) when the policy blocks the request. Use for any tool that fetches a URL the model can influence.

#Parameters

#input

string

#init?

RequestInit = \{\}

#policy?

EgressPolicy = \{\}

#Returns

Promise<Response>

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page