Module 3 Lesson 3: System Prompts
Defining Persona and Role. How to create an 'Invisible' layer of instructions that controls the AI's personality and safety.
The System Prompt: Setting the Persona
Behind every professional AI chatbot (like a custom GPT or a customer service bot) is a System Prompt. This is an instruction that the user never sees, but that defines the AI's "Entity."
1. Defining the Persona
If you don't define a persona, the AI is a generic assistant. If you do define one, you unlock specialized knowledge and tone.
- "You are a senior JavaScript developer with 20 years of experience. You focus on clean, readable code and always explain 'why' a specific pattern is used."
2. Setting Boundaries (Guardrails)
System prompts are where you tell the AI what NOT to do.
- "You are a nutrition coach. Never prescribe specific calorie counts. If the user asks for medical advice, tell them to see a doctor."
3. The Structure of a Great System Prompt
A professional system prompt usually has 4 sections:
- Role: Who are you? (Lawyer, Chef, Coder)
- Task: What is your goal? (Drafting emails, Debugging)
- Tone: How do you talk? (Funny, Academic, Short)
- Constraint: What are the "No-go" zones?
Visualizing the Prompt Stack
graph TD
S[System Prompt: 'I am a Poet'] --> AI[AI Engine]
U[User Question: 'Explain a car'] --> AI
AI --> Out[Response in iambic pentameter]
💡 Guidance for Learners
When using ChatGPT or Claude, start your prompt with: "Act as a [Specific Role]. Your goal is [Specific Task]." This instantly "Narrow-tunes" the statistical engine to give you higher quality data.
Summary
- System Prompts are the foundational instructions for the AI.
- Personas improve the relevance of advice.
- Guardrails ensure safety and prevent medical/legal liability.
- A well-structured system prompt makes an AI feel like a specialized tool.