← Blog

LLM API 425 Too Early: Keep Prompts Out of TLS 0-RTT

Parminder Singh
Parminder Singh··7 min read
Summarize with AI

HTTP 425 Too Early tells a client that the server refuses to risk processing a request that might be replayed through TLS early data. For authenticated LLM APIs, 0-RTT can duplicate a prompt, consume quota twice, create multiple runs, or repeat surrounding agent work. This guide explains Early-Data propagation, gateway duties, safe retry behavior, route policy, and distributed release tests.

Platform & Architectureai-securityllm-securityzero-trustpolicy-enforcementarchitecturecloud-security
LLM API 425 Too Early: Keep Prompts Out of TLS 0-RTT

The current TLS protocol lets a client send application data in its first flight when it resumes a version 1.3 session. The server can process those bytes before the handshake finishes. That saves round trips. It also creates a replay window. An attacker can copy the early data onto another connection, causing an authenticated LLM request to arrive more than once.

Picture two gateway pods with separate replay state. The same early prompt appears in both access traces, down to the byte count, while each pod believes it saw the first copy. That is the failure. A 425 response exists to stop it.

TL;DR

  • HTTP 425 means the server refuses to risk processing a request that might be replayed through TLS early data.
  • Disable 0-RTT by default on authenticated LLM prompt, run-creation, file, batch, and agent routes.
  • Preserve Early-Data across intermediaries. A gateway should delay forwarding or return 425 when origin support is uncertain.
  • Retry a 425 only after the relevant TLS handshake completes, with the same approved origin and a bounded operation identity.

TLS early data trades a round trip for replay exposure

RFC 8470 Section 2 explains that early data can contain a complete HTTP request or part of one. In multiplexed protocols, several requests can be partially delivered before the TLS handshake finishes. Completion of the handshake establishes the current connection. It cannot prove that the same early bytes were never replayed on another connection.

The attacker-driven replay differs from an ordinary client retry. The client may be unaware of the copied request. Protocol-level anti-replay mechanisms reduce the chance or bound the number of successful replays, yet application behavior still needs a replay decision.

An LLM request can have observable effects even when the endpoint looks like inference. It can consume account quota, create an audit event, open a streaming response, populate a cache, or start an agent run. Batch, file, fine-tuning, and run-creation routes create more obvious durable state. The route owner must classify those effects before enabling early data.

The safest default is direct. Keep authenticated LLM application data out of 0-RTT. A normal version 1.3 handshake and session resumption still reduce connection cost without authorizing request processing before handshake completion.

425 names one narrow refusal

RFC 8470 Section 5.2 defines 425 Too Early for a server unwilling to risk processing a request that might be replayed. Reserve it for replay exposure tied to early data. Overload, rate limiting, queue delay, clock skew, and business deadlines have their own response contracts.

A server should emit 425 only when the request arrived in early data or carries Early-Data: 1. That condition tells the server the client can understand the response and retry under the defined rules. A random 425 sent to an ordinary request can strand a client that lacks an early-data retry path.

The retry must leave early data. A user agent should repeat the request automatically, and every retry must wait for a completed handshake. RFC 8470 excludes 425 from default cacheability. Its payload represents no identified resource.

My view is blunt. Using 425 as a fashionable version of 429 is protocol vandalism. It destroys the only machine signal that says replay exposure, then sends operators toward the wrong control.

Early-Data carries replay state across HTTP hops

RFC 8470 Section 5.1 defines the Early-Data request field with one valid value, 1. An intermediary that forwards a request before its client-side handshake completes must add the field. It must preserve the field when present and must never nominate it through Connection for removal.

The field matters after the first TLS leg ends. A gateway can complete its own upstream handshake and still receive a request marked Early-Data: 1 because an earlier hop processed it under replay exposure. Waiting for the next provider-side handshake cannot make that request safe. The replay may already have reached another gateway instance.

A request containing the field that lacks a safe processing policy must receive 425. Multiple or invalid field instances are treated as one value of 1. This keeps malformed duplication from bypassing the conservative path. The field belongs only in requests, never responses or trailers.

The hop-by-hop header stripping guide explains why connection-specific processing needs exact field rules. Early-Data deliberately survives forwarding because it carries security context about a previous connection.

Gateways should delay, reject, or prove origin support

RFC 8470 says a gateway must avoid forwarding early data unless the origin server understands Early-Data and correctly generates 425. A gateway uncertain about origin support should delay forwarding until its client-side handshake completes or return 425 itself.

For an authenticated LLM route, delay is often the cleanest option. That applies when the bytes arrived directly as early data and no prior hop marked them. Once Early-Data: 1 arrives, the gateway needs route-specific replay safety. Rejecting with 425 preserves the signal and asks the client to return after a completed handshake.

Avoid forwarding the prompt first and deciding later. Parsing headers to identify route and early-data state can be safe when it creates no application effect. Model invocation, quota reservation, prompt logging, cache mutation, and agent scheduling count as processing. Hold those actions until replay handling passes.

The AI gateway TLS termination guide maps the separate client-facing and provider-facing TLS legs. Each leg can use session resumption. Each needs an explicit 0-RTT setting. A provider adapter should never introduce early data on its outbound connection merely because the inbound request arrived after a completed handshake.

Retry policy needs one logical operation

A 425 retry changes handshake state. It should preserve the intended method, target URI, approved origin, authenticated principal, and logical operation identity. The client opens or uses a connection whose handshake has completed. It then repeats the request outside early data.

Bound the retry to one correction unless the API contract says otherwise. A second 425 after a full-handshake request signals a broken intermediary or server. End with a typed failure and retain the connection evidence. Repeated automatic attempts can consume resources even when every origin refuses processing.

For POST-based LLM operations, use an operation identifier where the server supports one. Keep it stable across the early attempt and full-handshake retry. Reconcile provider-side effects because a faulty upstream might process the first request before returning 425. The LLM API Retry-After policy guide covers bounded attempts and duplicate work under other response classes. A 425 needs its own early-data rule rather than a time delay.

Never follow a 425 by changing provider or region. The correction is transport timing on the same approved route. A destination change reopens authority, credential scope, data residency, and model authorization.

Distributed replay controls remain application work

RFC 8446 Section 8 states that TLS lacks inherent replay protection for 0-RTT. It describes single-use tickets and ClientHello recording, while acknowledging the state-sharing difficulty across distributed servers. It also says the application must handle replay threats created by client retry behavior that the TLS layer cannot prevent.

Single-use tickets require consistent storage across gateway replicas. ClientHello recording needs a bounded time window and a duplicate lookup shared across the relevant serving infrastructure. A per-process cache can accept the same early data once on every pod.

Even strong anti-replay state leaves an application-policy question: which requests tolerate duplication. Safe HTTP methods provide a starting signal. Yet RFC 8470 warns that some resources produce side effects under safe methods. Classify the actual route behavior. For LLM APIs, prompt submission and run creation belong outside early data by default.

The LLM JWT replay-cache guide addresses token-level replay identifiers. TLS early-data replay is a separate layer. A valid JWT can appear in two copied 0-RTT requests, so token verification alone leaves the transport replay intact.

Release tests must cross replica boundaries

Run the acceptance fixture against at least two deployed gateway instances behind the production load balancer. Use controlled TLS tickets and observable provider-side counters.

  • Send an authenticated prompt in 0-RTT and verify that the listener rejects or defers it according to route policy.
  • Copy the early-data flight toward two replicas and prove that the model receives zero calls under the default-deny policy.
  • Forward Early-Data: 1 after a completed local handshake and confirm that waiting locally never clears the marker.
  • Receive 425, retry once after handshake completion, and verify one provider call tied to one logical operation ID.
  • Send 425 for an ordinary request without early-data state and ensure the server-side test fails.
  • Exercise multiple and invalid Early-Data fields; both follow the conservative marked-request path.
  • Confirm that every intermediary preserves the field and that no outbound adapter introduces 0-RTT without route approval.

Capture the ticket mode, early-data acceptance state, field value, gateway instance, operation ID, 425 response, retry connection, and provider-call count. Redact credentials and prompt content. The release fails when copied early data produces more than zero model calls on a route configured to reject 0-RTT.

DeepInspect

DeepInspect can enforce replay-aware route policy for authenticated user or agent traffic deliberately routed through its HTTP path to an LLM endpoint. At that boundary, it can reject or defer early requests before model forwarding, preserve the relevant transport context, and bind the final allow or deny decision to identity, route, model, policy version, and operation evidence.

TLS ticket issuance, client retry implementation, shared anti-replay storage, and provider-side 0-RTT behavior retain separate owners. Direct provider calls, local model runtimes, and bypass HTTP traffic remain outside DeepInspect's evidence. The deployed path needs an explicit early-data decision on every TLS leg.

Book a demo today.