← Blog

OpenAI Response Truncation Needs a Route Policy

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

The OpenAI Responses API supports truncation modes of auto and disabled, with disabled as the documented default. Auto can drop items from the beginning of a conversation when input exceeds the context window. Production clients should choose the mode by route, protect required instructions and evidence, reject silent policy changes, and record the mode sent on every routed request.

Platform & Architectureai-securityllm-securitypolicy-enforcementzero-trustarchitectureaudit
OpenAI Response Truncation Needs a Route Policy

The OpenAI Responses API gives a request two documented truncation modes: auto and disabled; with auto, an oversized input can fit by dropping items from the beginning of the conversation. With disabled, the documented default, a request that exceeds the model context window fails with HTTP 400. That switch changes evidence available to the model. I want it treated as route policy, because a support chat can tolerate a bounded history window while an approval workflow may depend on an instruction or attachment introduced 12 turns earlier.

TL;DR

  • Keep disabled for routes where every supplied item is required for authorization, evidence, or a structured decision.
  • Permit auto only when the route defines which early conversation items can be lost.
  • Treat truncation as input-context handling; output ceilings belong to max_output_tokens.
  • Record the requested mode, enforced mode, model, route, policy version, and outcome.

The modes make different failure choices

OpenAI's Create a response reference defines truncation as auto or disabled, with disabled as the default. In auto, the API can drop items from the beginning of the conversation when input exceeds the model's context window. In disabled, the request fails with a 400 error when the input would exceed that window.

The same reference adds a detail that belongs in every test plan. On some models, trimming can begin earlier because the API subtracts the model's maximum output allowance from the input limit, even when the request sets a lower max_output_tokens.

That makes auto more than an availability toggle. It authorizes a provider-side change to the context presented to the model. The application sends a sequence. The model may receive a shortened sequence. A route owner should approve that behavior with the same care given to model and tool access.

Auto needs an explicit context contract

A route can permit auto when older items are genuinely disposable and the product can explain the result. A long-running support conversation is one example. The application may preserve the full transcript in its own store while the model receives a bounded working history.

The route contract should identify context that must survive outside the drop zone. Current system instructions, authenticated identity context, policy-relevant facts, user consent state, and tool results required by the active task need explicit handling. Provider truncation offers no application-specific guarantee that a semantically important early item will survive merely because engineers consider it important.

My blunt opinion is that auto should fail security review on any route whose authorization story lives inside conversational prose. Authorization belongs in structured application context and inline policy, not in a sentence the provider may remove.

A permitted route also needs a user-facing rule. If missing history can alter the answer, label the working context or ask the user to restate the relevant fact. Quietly presenting a shortened-context answer as a full-history answer creates false confidence.

Disabled gives a visible failure boundary

disabled preserves a clear contract: the provider accepts the supplied context or returns HTTP 400 when it exceeds the window. The application then owns the recovery path. It can summarize under a reviewed process, remove optional material, start a fresh thread, or ask a human to choose what remains.

This mode fits routes that produce approvals, regulated explanations, structured extractions, and tool proposals. A failed request is operationally inconvenient, but an answer generated after the loss of a policy instruction is harder to diagnose. I would rather see a red 400 marker in the trace than a green response assembled from context nobody can reconstruct.

The recovery request must be a new, reviewable action. Record which items were removed or replaced by a summary, who or what authorized the transformation, and the new request identifier. The OpenAI API gateway pattern should preserve the original request decision before the provider call and link any successor generated by application recovery.

Route owners should set input budgets below the model limit so ordinary traffic rarely reaches this branch.

Input truncation and output limits stay separate

Truncation governs input context. max_output_tokens governs the upper bound on generated tokens, including reasoning tokens. Folding both controls into a generic token_limit field hides two separate decisions and produces weak audit evidence.

OpenAI's current model pages show why the distinction needs concrete capability data. The Sol model page lists a context window of 1,050,000 tokens as of November 22, 2026. It sets maximum input at 922,000 tokens and maximum output at 128,000 tokens for GPT-5.6 Sol. The route policy should bind to the resolved model or snapshot rather than copying those values into an eternal OpenAI-wide rule.

Keep four values in the request record: estimated input tokens, selected truncation mode, output ceiling, and resolved model. The provider remains the final authority on tokenization and acceptance. Local estimation exists to reject obviously oversized requests sooner and to produce a predictable application experience.

A route can permit auto and still enforce a small output cap. It can also use disabled with a large output cap because the two controls govern independent limits.

The gateway should reject mode drift

Allowlist the truncation field after authentication and route resolution. If a caller sends auto to a route approved only for disabled, reject the request before provider dispatch. If the caller omits the field, forward the route's explicit default rather than relying on an SDK or provider default that may be obscured in logs.

Record the caller's requested value, the enforced value, policy route, policy version, model, and decision. Store an omission as its own state. That lets an investigator distinguish a caller that selected disabled from a gateway that supplied it.

This is the same decision shape used by per-route AI policies. The policy should be testable at the HTTP boundary. Fixtures need auto, disabled, an unknown string, a missing field, and an oversized request for each permitted mode. Confirm that the provider request carries the canonical value after SDK serialization.

When auto succeeds, the response alone may be insufficient to reconstruct exactly what the model received. Retain the application-side input manifest and protected digests under the route's evidence policy.

Audit records need context lineage

A useful truncation record starts before the provider response. Capture the authenticated caller supplied by the application, route, conversation or workflow ID, input-item manifest, truncation mode, model, output cap, and policy version. Add the provider response ID or provider error when available.

For an application-managed summary, create a lineage edge between the source items and replacement summary. Record the summarization request separately because it is another model decision with its own inputs and output. A generic event saying context_compacted=true leaves an auditor staring at a black rectangle where the missing turns should be.

Use protected digests when full content retention would exceed the route's purpose. The AI audit log schema can carry identity, route, policy, outcome, and correlation fields while the application controls transcript storage and retention.

Review mode changes like other policy changes. A pull request that flips a claims route from disabled to auto should name the context-loss acceptance test and the accountable owner.

DeepInspect

DeepInspect can enforce an OpenAI response truncation mode policy when authenticated user or agent traffic is deliberately routed through its HTTP proxy. The application supplies identity and route context. DeepInspect allowlists the mode, blocks an unapproved auto request before provider dispatch, and writes a per-decision record containing the requested and enforced values.

The application retains the full conversation, chooses summary logic, manages retries, and decides how to explain shortened context to the user. Direct OpenAI calls, local model execution, and traffic that bypasses the proxy remain outside this boundary.

Book a demo today.

Frequently asked questions

Does auto truncate the generated answer?

The documented truncation field handles oversized input context by dropping conversation items from the beginning. Generated output has a separate max_output_tokens ceiling. Separate audit outcomes identify input-history loss and output-length stops as different events.

Is disabled always the safer mode?

disabled gives routes a visible failure when supplied context exceeds the window, which suits workflows that require complete evidence. A support conversation can permit auto under an explicit contract. The safety property comes from matching the mode to route requirements and keeping authorization outside disposable prose.

Can the application know exactly what auto removed?

The referenced field description states that items can be dropped from the beginning of the conversation. Build application evidence around the sequence submitted and the mode authorized. If exact retained-context reconstruction is required, use application-managed context selection with disabled and record the selected item manifest.

Should a 400 response trigger automatic summarization?

Only when the route has a reviewed summarization policy, bounded attempts, and context lineage. Summarization changes the evidence supplied to the next model call. High-impact routes may require a human choice or a fresh workflow instead of an automatic rewrite of prior context.