What Are System Prompts?
You'll learn: How system prompts establish foundational context and behavior rules for language models before any user interaction begins.
Core Concept
A system prompt is a special instruction block sent to an LLM that sets persistent context, defines the model's persona, and establishes behavioral constraints—all before the user's actual question or task arrives.
Think of it like briefing an actor before they step on stage. The system prompt tells the model "who you are," "how you should behave," and "what rules you must follow" throughout the entire conversation. Unlike user prompts that change with each request, the system prompt remains constant across multiple turns.
How System Prompts Work
In most LLM APIs, you provide three components:
- System prompt: Sets the stage (persistent context)
- User prompt: The actual question or task
- Assistant response: The model's reply
The system prompt might specify:
- Role/persona: "You are a helpful Python tutor"
- Behavioral rules: "Always explain concepts before showing code"
- Constraints: "Never provide financial advice"
- Output format: "Respond in JSON format"
- Tone: "Be concise and professional"
Why They Matter
System prompts provide global scope for your application. Instead of repeating constraints in every user prompt, you define them once. This makes your prompts cleaner, reduces token usage, and ensures consistent behavior across all interactions.
For example, a customer service chatbot's system prompt might enforce politeness, forbid policy violations, and maintain brand voice—automatically applying these rules to every customer query without repetition.
Key Takeaway: System prompts are the "constitution" of your LLM application—they set immutable context, behavior, and constraints that govern all subsequent user interactions, ensuring consistency and control.