Developer instructions: apply app rules to user requests
A developer instruction is an application developer’s rule or business logic for handling user requests. In OpenAI APIs, it is represented by a message with the `developer` role and takes priority over user messages. A well-designed instruction helps a service apply its scope and handling rules consistently, but it cannot guarantee that the model always follows them or replace application-side authorization.
A developer instruction is an application developer’s rule or business logic for handling user requests. In OpenAI APIs, it is represented by a message with the developer role and takes priority over user messages. A well-designed instruction helps a service apply its scope and handling rules consistently, but it cannot guarantee that the model always follows them or replace application-side authorization.
This article focuses on developer messages in OpenAI APIs. “System prompt” can refer to different system-level instructions across products; here, the focus is on separating application policy from user-specific data.
How do app rules differ from a user request?
App rules describe how a service should behave for all users. A user request supplies the particular problem and values to handle within those rules. OpenAI describes developer messages as the system’s rules and business logic, and user messages as the arguments to which those rules are applied. Because developer instructions take priority over user input, an app can preserve its defined scope even when a user asks the model to ignore it.
| Message or layer | What belongs there | Customer-support example |
|---|---|---|
developer | Service role, allowed sources and actions, missing-data behavior, output format | Use supplied inventory data and do not promise an unverified restock date. |
user | The request, search terms, and user-provided information for this turn | “Can I get the blue model by Friday?” |
| Application code/tools | Data lookup, authorization, external changes, and result validation | Query inventory, calculate shipping dates, check approval for an order change. |
This is more than arranging sentences. It gives the model separate roles for application rules and user data. Role separation alone does not prove that input data is true or that a tool action is authorized.
What should a developer instruction contain?
Focus on behavior that remains stable across users. Define the assistant’s task and limits, the evidence it may use, what to do when information is missing, when to request human review, and the expected output structure. Keep instructions easy to read and revise, and make the precedence of any conflicting rules explicit.
The following is a hypothetical developer message for an online store’s inventory assistant:
Role: Draft replies to questions about product stock and delivery.
Evidence: Use only current inventory and shipping results supplied by the application.
Rule: Do not guess or promise a restock or arrival date absent from those results.
Missing data: Ask only for the information needed to run a lookup.
Scope: Do not cancel orders, process payments, or change addresses.
Output: Separate availability, lookup evidence, and information still needed.The app rules go in the developer message. A specific question and lookup results belong in user input or application-provided data. If the assistant needs to look up inventory or calculate a delivery date, instructions alone are not enough: the application must connect an authorized tool and validate the inputs and results.
How do you separate them in an API request?
In OpenAI Chat Completions, the message array can use separate developer and user roles. This shortened example shows the documented request shape; it is not a complete integration:
messages: [
{
role: "developer",
content: "Answer only from inventory results; do not promise unverified restock dates."
},
{
role: "user",
content: "Can I get the blue model by Friday?"
}
]For the Responses API, OpenAI documents reusable guidance in the first developer message and instructions for high-level guidance for a single response. Request details can vary with the endpoint, SDK, and conversation flow. Check the current reference for the endpoint you deploy; do not assume role names or field behavior transfer unchanged to another API.
What if the instruction is not followed?
Make rules concrete and observable. “If the inventory lookup has no entry for this color, do not claim it is in stock; ask for the product identifier” is easier to test than “be accurate.” Create evaluation cases for routine questions, attempts to override policy, incomplete inputs, tool failures, and conflicting source data.
Enforce important controls outside the prompt. Keep API keys and authorization tokens on the server, not in conversation text. Expose only necessary tools, and have code check user permissions and input values before a tool runs. Require approval for consequential actions such as changing an order or issuing a refund. Validate model outputs against format and policy. OWASP notes that prompt instructions alone cannot guarantee protection against prompt injection; least privilege, output validation, human approval, and adversarial testing are also needed.
How should you version and evaluate instructions?
Manage developer instructions like application code. Version the text and record which model and tool configuration shipped with it. Keep representative questions and edge cases as a fixed evaluation set, and compare results when the instruction changes. OpenAI recommends testing prompt and model changes and rolling out changes in stages.
At minimum, evaluate these separately:
Does the answer follow the app’s rules and permitted evidence?
When information is absent or conflicting, does it avoid guessing and follow the specified fallback?
Does it preserve core constraints when a user asks it to ignore them?
Can downstream code validate the output structure?
Do tool calls and external changes pass application permission and approval checks?
A developer instruction is the policy layer that helps an app behave consistently. Reliable behavior also needs trusted data connections, code-side authorization, fixed evaluation cases, and monitoring after release.
References
[OpenAI API: Prompt engineering](https://developers.openai.com/api/docs/guides/prompt-engineering)
[OpenAI API reference: Create a conversation](https://developers.openai.com/api/reference/resources/conversations/methods/create)
[OpenAI Model Spec: Chain of command](https://model-spec.openai.com/2025-09-12.html)
[OWASP GenAI Security Project: LLM01:2025 Prompt Injection](https://genai.owasp.org/llmrisk/llm01-prompt-injection/)