School/Prompt Engineering/Advanced Prompting
2/5
Wave 210 minintermediate

System Prompts & Personas

Create persistent AI behaviors with system-level instructions.

System Prompts & Personas

System prompts are instructions that shape the AI's entire behavior for a conversation. Think of them as the "operating manual" you hand the AI before it starts working. Every message in the conversation is then filtered through these instructions.

Key Concept

A system prompt is a set of persistent instructions that govern how the AI behaves throughout an entire conversation. It is the most powerful way to customize AI behavior without writing code.

What Is a System Prompt?

A system prompt is a special instruction given before the conversation starts. It sets rules the AI follows throughout -- not just for one response, but for every response in the session. In the ChatGPT API, it is the "system" message. In Claude, it is the system prompt. In custom GPTs, it is the "Instructions" field. Most chat interfaces also let you set custom instructions that act as a system prompt.

The key difference from a regular prompt: a system prompt shapes the AI's personality and rules, while regular prompts give it specific tasks to perform.

Creating Effective Personas

A well-crafted persona transforms a generic AI into a specialized assistant. Here are three examples that demonstrate different approaches:

The Expert Consultant

"You are a senior financial advisor with 20 years of experience helping small business owners. You explain complex financial concepts in simple terms. You always consider tax implications. When you don't know something, you say so and recommend consulting a CPA."

This persona works because it sets expertise level, communication style, a specific behavior rule (always consider taxes), and an honesty constraint (admit when unsure).

The Strict Editor

"You are a ruthless editor. Your job is to make writing shorter and clearer. Cut all fluff, jargon, and passive voice. Be direct in your feedback. If something is good, say so briefly. If something is bad, explain why and show the fix. Never add length -- only remove it."

The Socratic Teacher

"You are a patient teacher who uses the Socratic method. Never give direct answers. Instead, ask guiding questions that lead the student to discover the answer themselves. Start with what they already know and build from there."

Example

Here is a persona for everyday use that many people find valuable:

"You are my executive assistant. You are organized, concise, and proactive. When I describe a problem, suggest concrete next steps rather than abstract advice. Format action items as a numbered checklist. If I give you a vague request, ask one clarifying question before proceeding -- never more than one. Keep all responses under 200 words unless I ask for detail."

Notice how specific the behavior rules are: concrete next steps, numbered checklists, exactly one clarifying question, 200-word limit. The more precise your rules, the more consistent the AI's behavior.

System Prompt Components

  1. 1Identity: Who the AI is
  2. 2Expertise: What they know
  3. 3Behavior rules: How they should act
  4. 4Constraints: What they should NOT do
  5. 5Output preferences: Format, tone, length
  6. 6Edge cases: What to do in unusual situations
Pro Tip

The most overlooked component is constraints -- telling the AI what NOT to do. Without constraints, the AI will default to being helpful in ways you might not want. "Never suggest I hire a consultant" or "Do not use bullet points" or "Never provide legal advice -- recommend a lawyer instead" are all powerful constraints that prevent frustrating outputs.

Pro Tips

  • Keep system prompts focused -- do not try to cover every scenario
  • Test your system prompts with adversarial inputs (try to break them)
  • Include negative instructions ("Do not use jargon" or "Never apologize for your limitations")
  • Specify the audience ("Explain to a non-technical audience")
  • Iterate -- refine based on the outputs you get over multiple conversations
Watch Out

A common pitfall: writing system prompts that contradict themselves. "Be concise" and "provide thorough explanations with examples" pull in opposite directions. If the AI seems confused or inconsistent, check your system prompt for conflicting instructions.

Exercises

0/3
Prompt Challenge+20 XP

Create a system prompt for an AI persona that acts as a tough but fair code reviewer. It should: point out bugs, suggest improvements, praise good patterns, and refuse to just rewrite code for the user. Test it by asking it to review a simple function.

Hint: Include identity, expertise area, behavior rules, and at least one constraint.

Quiz+5 XP

What is the purpose of including "negative instructions" in a system prompt?

Reflection+15 XP

Design a system prompt for a persona that would be useful in your work or daily life. Include all 6 components listed in the lesson.

Hint: Think about: a writing assistant for your industry, a study buddy, a meal planner, a project manager, etc.