Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Python agentaianthropicclaude-codecompressioncontext-engineeringcontext-windowcursorfastapilangchainllmmcpopenaiprompt-engineeringproxypythonragtoken-optimizationtokenstypescript
docs(security): describe the per-route outcome of an unsafe base-URL override (#4660)
HetCreepecbaf86d78cf
diff --git a/docs/content/docs/security-model.mdx b/docs/content/docs/security-model.mdxindex 2ece6dd33..481bce53c 100644--- a/docs/content/docs/security-model.mdx+++ b/docs/content/docs/security-model.mdx@@ -53,9 +53,15 @@ and two separate guards bound it.on a private, loopback, link-local, or otherwise non-public address: the confused-deputycase where the proxy is used to reach cloud metadata (`169.254.169.254`) or RFC1918hosts the caller cannot reach directly. NAT64-embedded IPv4 is unwrapped before the-check, so it cannot be smuggled through an IPv6 literal. A rejected override is-**ignored rather than fatal** — the request proceeds to the configured upstream and a-warning is logged. `HEADROOM_ALLOWED_BASE_URLS` (comma-separated hosts or URLs)+check, so it cannot be smuggled through an IPv6 literal. What happens to a rejected+override depends on the route. The OpenAI Chat Completions and Responses handlers+(`/v1/chat/completions`, `/v1/responses` and their unprefixed and Codex/ChatGPT-backend+aliases) **ignore** it: the request proceeds to the configured upstream and a warning+is logged. The other routes that read the header **reject** the request with HTTP 400+(`Rejected unsafe upstream base URL`) before contacting any upstream: Anthropic+Messages and token counting, the native Gemini routes, model listing, embeddings,+moderations, audio, and the generic passthrough. A client that sends an unsafe override+should be ready for either outcome. `HEADROOM_ALLOWED_BASE_URLS` (comma-separated hosts or URLs)re-permits specific internal endpoints as an explicit operator choice: a bare hostpermits every safe scheme and port on that host, a full URL permits only its exactnormalized origin. DNS resolution is bounded by `HEADROOM_UPSTREAM_RESOLVE_TIMEOUT_S`