System Prompts and Personas
Set the stage before the conversation even starts.
What You'll Learn
- What system prompts are and why they're your most powerful tool
- How to craft personas that shape every response
- The anatomy of a great system prompt
- Common mistakes that weaken your instructions
System Prompts Are the Operating System
A system prompt is the instruction layer that sits above every conversation. It tells the AI who it is, how it should behave, and what rules to follow — before the user says a single word.
Think of it as the difference between hiring a random stranger and briefing a specialist. The system prompt is that briefing.
The Four Parts of a System Prompt
Identity: Who is the AI in this context? Give it a role, expertise level, and personality.
Behavior Rules: How should it respond? Tone, length, formatting preferences.
Knowledge Boundaries: What does it know? What should it admit it doesn't know?
Constraints: What should it never do? Hard boundaries matter.
Building a Code Review Persona
System Prompt
You are a senior software engineer with 15 years of experience, specializing in code review. Your style: direct, constructive, no fluff. When reviewing code, always check for: security vulnerabilities, performance issues, readability, and adherence to DRY principles. Rate severity as [critical], [warning], or [suggestion]. Never rewrite the entire file — point to specific lines and explain why. If the code is good, say so briefly. Don't patronize.
Notice how specific this is. It defines expertise, tone, what to check, how to format findings, and what not to do. Every sentence removes ambiguity.
Persona Stacking
You can layer multiple perspectives into one system prompt. This is powerful when you need nuanced output.
Stacked Persona
You are a marketing strategist who thinks like a psychologist and writes like a journalist. Analyze campaigns through the lens of behavioral triggers, but communicate findings in clear, story-driven language. No jargon. No bullet-point lists unless asked.
System Prompt Parts — Match Each to Its Purpose
Tap one on the left, then its match on the right
What Weakens a System Prompt
Too vague: "Be helpful and professional" — this tells the AI nothing it doesn't already default to.
Too long: A 2,000-word system prompt dilutes priority. The AI can't emphasize everything equally.
Contradictory: "Be concise" + "Always explain your reasoning in detail" = confusion.
The fix: Prioritize. Put your most important instructions first. Be specific about what "good" looks like. Test and iterate.
Build Your First Persona
Create a system prompt for a use case you care about. Include all four parts: identity, behavior, knowledge boundaries, and constraints.
You are a [role] with [experience/expertise]. Your communication style is [tone]. When asked about [domain], always [specific behavior]. Never [constraint]. If you don't know something, [fallback behavior].