OpenAI Responses API previous_response_id Instructions: Repeat Policy on Every Turn
OpenAI Responses API previous_response_id instructions have a counterintuitive boundary: the response ID carries conversation state forward, but it does not carry the prior top-level instructions . If my application uses that field for output format, tool rules, or safety constraints, turn two can quietly run without the policy I expected. I prefer to make that boundary visible in request…
The OpenAI Responses API's previous_response_id feature enables conversation state continuity without retransmitting the entire dialogue. However, this convenience comes with an important caveat: earlier instructions are not carried forward when using this ID. This can lead to unexpected behavior if an application relies on these instructions for formatting, tool rules, or safety constraints.
To address this, the source code builds a guard mechanism that requires explicit policy to be included in every turn of a conversation. This ensures that essential instructions are not inadvertently omitted. The builder enforces mandatory instructions, preventing blanks or empty requests. It also prevents mixing previous_response_id with conversation IDs, as these are distinct state strategies.
While this guard improves policy visibility and consistency, it's not a replacement for using official OpenAI SDKs or complete HTTP clients. It's tailored to a specific application that requires policy to be present in every turn. The offline fixture test validates the approach without any external calls, making it a deterministic build failure detector.
However, there are limitations. For applications that don't use store: true, this guard isn't applicable. Durable Conversation objects also can't be mixed with previous_response_id. Additionally, model instructions aren't security boundaries, so application-level checks for permissions, validation, and destructive actions are still necessary.
In summary, the recommended invariant before sending a chained request is to explicitly include the policy in the instructions field of the request builder. This ensures the policy is carried forward correctly and avoids accidental omissions.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.