OptionalmaxMaximum response body size (in octets) the SDK will read before aborting
with ResponseTooLargeError. When unset, the SDK does not impose a cap —
matches the underlying MCP / A2A transport defaults.
Set this when crawling untrusted agents (registries, federated
discovery layers, monitoring tools) to prevent a hostile vendor from
buffering a large reply before any application-layer schema validation
runs. Counted across response chunks; pre-cancels when Content-Length
exceeds the cap. Applies to A2A agent-card discovery
(/.well-known/agent.json) on the same call as well.
Per-call override (TaskOptions.transport.maxResponseBytes) beats the
value set on the client constructor (SingleAgentClientConfig.transport).
Safe to set on all calls. SSE responses (text/event-stream) are
passed through unchanged — a single tool call legitimately emits N status
frames + a final result, bounded by protocol-level framing rather than
cumulative byte counts. The cap applies to one-shot JSON responses
(get_adcp_capabilities, agent-card lookup, tool result payloads on
non-streaming transports) where the body is bounded by definition.
OptionaltrustedScoped fetch implementation for all outbound HTTP performed on behalf of this client or call, including endpoint/card discovery, tool listing, OAuth discovery and token refresh, and MCP/A2A tool requests.
The function is runtime-only configuration and is never serialized into
agent records, storyboard artifacts, or compliance output. When unset,
the SDK uses the global fetch implementation.
Supplying this function makes it the trusted network boundary: the SDK still validates URL schemes, redirect behavior, timeouts, body limits, and literal IP addresses, but delegates hostname DNS resolution and resolved address policy to the implementation. It must prevent DNS rebinding and unsafe private-address access itself (for example with an egress proxy or its own DNS pinning).
Optionalinit: RequestInitOptionalinit: RequestInitOptionalfetchOptionalinit: RequestInitOptionalinit: RequestInitOptionalallowPermit this client to connect to private DNS answers. Localhost and an initial private IP literal are allowed automatically only on their exact origin; use this for private-DNS enterprise agents.
OptionalrequestTimeout in milliseconds for bounded one-shot transport requests such as
A2A agent-card discovery and MCP read-path probes. Defaults to 60 seconds
for A2A discovery so an unresponsive card endpoint cannot hang forever.
Set to 0 to disable the SDK-imposed discovery timeout.
Transport-level safeguards applied to a call.
Wired into the SDK's internal fetch chain via AsyncLocalStorage, so the cap takes effect even when the underlying transport's connection cache reuses a fetch that was created on an earlier call with different limits.