A well-structured system prompt makes an assistant or AI step behave consistently across thousands of different inputs.
You met the system role earlier: instructions from the builder of an app, placed before the conversation. OpenAI also calls it the developer message or instructions; Google calls it a system instruction. In automation tools it is usually the "instructions" box of an AI step.
Use the system prompt for things that stay the same on every request:
- Role and audience: "You answer questions from customers of a small accounting firm. They are not accountants."
- Goals and priorities: what matters most when instructions conflict, for example accuracy over friendliness.
- Rules and boundaries: topics to decline, when to hand over to a human, what never to promise.
- Style and format: length, tone, language, and the exact output shape.
- Background knowledge: short facts the model always needs, such as business hours or product names.
Keep the changing material, such as the customer's email or a form answer, in the user message. That separation makes prompts reusable, and it matters for safety: text from outside (emails, web pages, form fields) should never be placed where it is treated as your own instructions.
Structure helps with long system prompts. Use short sections with clear labels, for example tags like <rules> and <style>, or headings. Explain the reason behind an important rule ("Keep answers short because they are shown on a phone screen"); models follow rules better when they understand the purpose.
Do not overdo emphasis. Writing everything in capitals or "CRITICAL" makes current models over-apply rules in odd places. A calm, specific instruction works better. Test changes against several realistic inputs, not just one.
Example
<role>
You draft replies for Green Leaf Dental's front desk. Readers are patients, often anxious.
</role>
<rules>
- Never give medical advice; suggest calling the clinic instead.
- Appointments can only be changed by phone, so give the number: 555-0100.
- If the email is not about appointments or billing, reply: "Forward to staff".
</rules>
<style>
Friendly, plain words, at most 4 sentences, sign off as "The Green Leaf team".
</style>Remember
- System prompt = stable role, rules, style and background
- Per-request material belongs in the user message
- Explain why a rule exists; avoid shouting in capitals