Skip to article

Credentials and trust

Separate server secrets, external source material, and application authority.

On this page

Keep credentials server-side

Provider factories receive keys explicitly and never load environment variables. Built-in normalized adapters use fixed provider endpoints and reject redirects. Supply credentials from server-owned configuration. Do not expose them through browser bundles, query logs, or example output.

Treat retrieval as untrusted input

Provider text may contain markup, misleading claims, or instructions. Escape it in user interfaces and keep it out of trusted system instructions. A valid source URL does not establish source credibility, ownership, or safe server-side fetch behavior.

Review custom transports

An injected transport is trusted server code. Preserve request authentication boundaries, AbortSignal, and redirect policy. If you add telemetry or retries, consider that headers may contain keys, query strings can contain search text, and repeated calls can incur extra work.