LLM API 421 Misdirected Request: Authority Before Retry
HTTP 421 Misdirected Request tells a client that an origin server, or a gateway acting for it, rejects the target URI because the server lacks authority for that origin or the connection context is wrong. For LLM APIs, the status often exposes unsafe HTTP/2 connection reuse, TLS SNI and authority disagreement, or a route sent to the wrong regional backend. This guide defines detection, retry, proxy limits, evidence, and release tests.

A client can open one HTTP/2 connection and reuse it for several origins when DNS and certificate authority rules permit that reuse and the server has authority for each origin. The optimization fails when a TLS terminator routes the connection by Server Name Indication while a later request carries another :authority. The receiving LLM endpoint can answer 421 because the connection reached the wrong origin context.
The useful artifact is a packet trace showing the TLS server name and certificate names beside the HTTP :authority. If the route manifest names a fourth destination, stop the request and reconcile all four.
TL;DR
- Use 421 when an origin server, or a gateway acting for it, rejects a request whose target URI conflicts with configured authority or connection context.
- A forward proxy must never generate 421. Component role determines the valid response contract.
- Retry a 421 on a fresh connection dedicated to the intended origin, without changing the approved provider, region, account, or model.
- Test HTTP/2 connection reuse, shared certificates, SNI routing, :authority, DNS, redirects, and provider-side request counts.
421 is an authority failure tied to connection context
RFC 9110 Section 15.5.20 defines 421 Misdirected Request for a request sent to a server that is unwilling or unable to produce an authoritative response for the target URI. An origin server, or a gateway acting on its behalf, can use 421 when the target origin conflicts with server configuration or the connection context.
The response describes the destination relationship. It says nothing about the caller's authentication status, prompt content, quota, model availability, or request syntax. Mapping all routing failures to 421 weakens the contract. A denied model route belongs in an authorization response. A malformed authority can produce a client error. A temporary provider outage belongs in the 5xx family.
RFC 9110 Section 7.4 tells a server to compare the target URI with its configuration, then check the connection context. A mismatch between Host and the connection's host or port can indicate accidental routing, filter bypass, private-content access, or cache poisoning. For HTTPS, the connection also needs a certificate valid for the target origin unless a trusted gateway arrangement applies.
An LLM route should perform this check before processing sensitive prompt content. The server can parse enough of the request to establish the target. After authority fails, it should avoid model invocation and provider forwarding. It should also avoid content logging.
HTTP/2 reuse creates the common failure path
RFC 9113 Section 9.1.1 permits one connection to carry requests with different URI authority components when the origin server is authoritative. For HTTPS, the certificate must satisfy the checks a new connection would require for each host.
A single certificate can cover several provider hostnames. Those hosts can also resolve to one IP address. The client may coalesce traffic onto one HTTP/2 connection. A middlebox can still route that connection according to the original TLS server name, sending a later request to a backend that serves only the first origin. The certificate is cryptographically acceptable while backend routing is wrong.
The server uses 421 to decline that later request. A client can then create a fresh connection for the requested origin, presenting the correct server name and authority. Connection pools need an origin-specific suppression entry so the client avoids immediately coalescing the retry onto the same unsuitable connection.
The LLM API authority validation guide covers the normalized scheme and port decision together with the host decision. The 421 path is the runtime correction when an otherwise eligible connection reaches a server that declines authority for that target.
My blunt view is that connection coalescing has no right to override an enterprise LLM route manifest. A saved handshake is a poor trade for sending a prompt into the wrong regional backend.
Proxy role sets a hard boundary
RFC 9110 states that a proxy must never generate a 421 response. The rule prevents a generic intermediary from claiming origin authority it lacks. An origin server can generate 421. A gateway acting on behalf of an origin can also generate it. Deployment diagrams need to identify which role a component performs for the request.
An LLM policy gateway may expose its own origin to applications and originate a separate request to a provider. On the client-facing leg, it can act as the origin service for its configured API. On the provider-facing leg, it acts as a client. A separate enterprise forward proxy remains a proxy and must forward a received 421 rather than inventing one.
Document the response source in protected telemetry. Record the component role, target origin, connection ID, TLS server name, certificate identity result, HTTP authority, and upstream response. A public problem body can remain terse. Internal evidence needs enough context to distinguish an origin-generated 421 from an invalid proxy-generated response.
The AI egress control implementation guide adds the enterprise destination allowlist. Origin authority establishes which server can answer. Egress policy establishes which approved origin may receive the prompt. Both decisions need to pass before provider forwarding.
A retry changes the connection rather than the destination
RFC 9110 permits a client receiving 421 to retry the request on a different connection even when the method lacks idempotence. A fresh connection specific to the target origin is the normal repair. The target URI and approved origin stay fixed.
For an LLM POST, keep one logical operation identifier across the attempt pair. Record the first connection and 421, then the fresh connection and final response. A correct 421 means the rejecting server declined to produce an authoritative response, yet production evidence should still reconcile provider-side invocation counts. That check catches a broken server that performs work before returning 421.
Set a strict retry bound for each routed request. One fresh origin-specific connection is usually enough to test the correction. A second 421 should end with a typed routing failure and operator evidence. Repeatedly opening connections can amplify a configuration incident.
Never treat 421 as permission to choose another provider, region, account, or model. Alternative services still need route approval. If a client changes destination during retry, it has performed fallback rather than corrected misdirection. The AI gateway fail-closed guide describes the safer outcome when destination certainty collapses.
Credential handling also restarts at the origin boundary. Re-evaluate the protection space before attaching Authorization. Provider credentials scoped to the intended host can be sent on the fresh connection after certificate and authority validation. Caller credentials should never follow an unapproved redirect or alternate origin.
Authority and identity remain separate decisions
A 421 can occur after the edge authenticates the caller because the destination connection is wrong. It can also occur before application authentication when the receiving server rejects the target URI immediately. Keep the authority result separate from identity and policy outcomes.
At an authenticated LLM gateway, validate the inbound authority against the listener configuration. Then resolve the caller identity and request policy. Before forwarding, validate the provider origin and establish a connection whose TLS identity and HTTP authority match that origin. Every stage should produce a named result.
Avoid a single generic route_error field. Use stable reasons such as inbound_authority_mismatch, connection_origin_declined, provider_sni_mismatch, and fresh_connection_retry_exhausted. Those reasons identify the owner: ingress configuration, connection pool, TLS setup, provider adapter, or upstream service.
A 421 response itself cannot prove an attack. Shared certificates, stale DNS, regional load balancer changes, and connection-pool defects can all produce it. Preserve the facts and investigate the mismatch without overstating intent.
Release tests need the deployed connection pool
Unit tests against host strings miss connection coalescing. Run the fixture through the production TLS client, DNS resolver, load balancer, service mesh, provider adapter, and connection pool.
- Serve two test origins on one IP with a certificate valid for both names.
- Route TLS connections by Server Name Indication to separate backends.
- Reuse one HTTP/2 connection for the second authority and have the backend return 421.
- Confirm that the client retries once on a fresh connection with the intended server name and authority.
- Verify that the logical operation ID remains stable and the provider-side invocation counter increments once.
- Send conflicting
Hostor:authorityinput and prove that prompt content never reaches a model backend. - Put a forward proxy in the path and prove it forwards an origin 421 without generating its own.
- Change DNS, regional routing, and certificate coverage independently so each failure has a distinct reason.
Retain the connection IDs and normalized origins with the route-manifest version. Include the TLS identity result, first 421, retry decision, final status, and provider-call count. Redact credentials and prompt content. Any retry that lands on an unapproved origin blocks the release.
DeepInspect
DeepInspect can validate and enforce destination policy for authenticated user or agent traffic deliberately routed through its HTTP path to an LLM endpoint. It can bind the approved route and model destination to identity, tenant, data classification, policy version, and a per-decision record before provider forwarding.
DNS operation, certificate issuance, HTTP/2 pool behavior, and provider-side authority remain separate control owners. DeepInspect's evidence covers requests traversing the configured path. Direct provider calls, local runtimes, and bypass HTTP connections retain their own controls. A 421 received on the routed provider leg should remain visible as an authority event, followed by a bounded fresh-connection outcome.
Book a demo today.