System Prompts
The system prompt is a special message at the top of the conversation that defines the assistant's persona, capabilities and rules.
Introduction
The system prompt is a special message at the top of the conversation that defines the assistant's persona, capabilities and rules. It's the highest-leverage place to shape behaviour because the model treats it with extra weight throughout the chat.
Beginner analogy: Like a job description plus dress code given to a new hire on day one — it shapes everything they do for the rest of their employment.
Understanding the topic
Core concepts to understand:
- Sent once at the start of the conversation.
- Defines role, tone, response format, refusal rules.
- Higher priority than user messages in most APIs.
- Often versioned and stored separately from app code.
Syntax reference
Visual workflow / architecture:
┌──────────── system ── ─────────────────────┐│ You are an empathetic mental health ││ assistant. Never give medical diagnosis. ││ Always recommend a professional in ││ crises. Respond in the user's language. │└─────────────┬─────────────────────────────┘│┌──────────▼──────────┐│ user → assistant │ (multi-turn)└─────────────────────┘
Real-world use
ChatGPT, Claude.ai, Cursor and Perplexity all rely on detailed system prompts (some leaked online have 1500+ words). System prompts also enforce safety policies (no medical advice, no copyrighted text).
Best practices
- Keep the system prompt under 500 words if possible.
- Always include refusal rules and tone guidance.
- Version-control system prompts like code.
Hands-on exercise
Interview preparation — practice these questions:
- Q1. What is a system prompt?
- Q2. How does it differ from a user message?
- Q3. Why version-control system prompts?