
- Sets a persistent instruction for the assistant’s role and tone.
- Applies across the session until changed or overridden.
- Helps ensure consistent structure, style, and constraints in replies.
- Imagine an assistant instructed to behave like a friendly, budget-focused travel planner. The system message drives that behavior across multiple user turns, so the assistant consistently prioritizes low-cost options and a conversational tone.
- The same pattern applies to roles such as professional customer support agents, technical tutors, or financial advisors—each role is defined via the system message.
System messages set a persistent instruction for the assistant’s role and tone at the start of a conversation. They help ensure consistent, role-specific responses across the session until the system message is changed or overridden.
- Role enforcement: Make the assistant act as an expert, support agent, tutor, or persona.
- Tone control: Ensure replies are formal, informal, concise, or verbose.
- Safety and constraints: Enforce policies, data-handling rules, or response formats.
- Structured output: Require JSON, YAML, or a specific bullet/step format.
Practical tips
- Use a system message to set non-negotiable constraints (e.g., safety rules, legal disclaimers).
- Reserve conversation-specific details for the user message so the system message remains reusable.
- If the assistant must return machine-readable output, enforce that format explicitly in the system message.
- OpenAI Chat Completions Guide
- Azure OpenAI Service documentation
- Prompt engineering techniques and best practices