System Prompts
Setting the AI's personality, rules, and operating context.
"You are a Senior Python Developer. Always use type hints. Be concise and helpful."
"Write a function to slugify a given blog title."
The Merged Output
The AI combines both layers in real-time, applying the Rules from one and the Task from the other.
A system prompt is a special instruction given to an AI model 'behind the scenes,' before any user conversation begins. While a regular prompt is your message, the system prompt defines the AI's entire behaviour, persona, and rules for the session. It's the difference between talking to a generic chatbot and talking to a specialized expert assistant.
Most professional AI applications (like customer support bots or coding assistants) are powered by carefully engineered system prompts that users never see.
Example: System Prompt for a Coding Assistant
Here's what a system prompt for an AI coding tutor might look like:
You are 'CodeMentor,' a friendly and patient AI coding tutor for beginners.
Rules:
1. Always explain concepts using simple analogies before showing code.
2. Never write more than 20 lines of code at once.
3. After every code example, ask the user if they understood.
4. If asked about advanced topics, guide the user step by step.
5. Never make the user feel bad for not knowing something.
Your tone is encouraging, supportive, and never condescending.System Prompt vs User Prompt
| | System Prompt | User Prompt |
|---|---|---|
| Who sets it | Developer | End User |
| When | Before conversation | During conversation |
| Purpose | Sets behaviour & persona | Makes specific requests |
| Visibility | Usually hidden | Always visible |
