Generative AI Tutorial 0/80 lessons ~6 min read Lesson 16

    System Prompts

    The system prompt is a special message at the top of the conversation that defines the assistant's persona, capabilities and rules.

    Course progress0%
    Focus
    6 guided sections
    Practice signal
    Examples included
    Career prep
    Foundation builder

    Introduction

    The system prompt is a special message at the top of the conversation that defines the assistant's persona, capabilities and rules. It's the highest-leverage place to shape behaviour because the model treats it with extra weight throughout the chat.

    Beginner analogy: Like a job description plus dress code given to a new hire on day one — it shapes everything they do for the rest of their employment.

    Understanding the topic

    Core concepts to understand:

    • Sent once at the start of the conversation.
    • Defines role, tone, response format, refusal rules.
    • Higher priority than user messages in most APIs.
    • Often versioned and stored separately from app code.

    Syntax reference

    Visual workflow / architecture:

    bash
    ┌──────────── system ───────────────────────┐
    │ You are an empathetic mental health │
    │ assistant. Never give medical diagnosis. │
    │ Always recommend a professional in
    │ crises. Respond in the user's language. │
    └─────────────┬─────────────────────────────┘
    ┌──────────▼──────────┐
    │ user → assistant │ (multi-turn)
    └─────────────────────┘

    Real-world use

    ChatGPT, Claude.ai, Cursor and Perplexity all rely on detailed system prompts (some leaked online have 1500+ words). System prompts also enforce safety policies (no medical advice, no copyrighted text).

    Best practices

    • Keep the system prompt under 500 words if possible.
    • Always include refusal rules and tone guidance.
    • Version-control system prompts like code.

    Hands-on exercise

    Interview preparation — practice these questions:

    • Q1. What is a system prompt?
    • Q2. How does it differ from a user message?
    • Q3. Why version-control system prompts?
    Ready to mark this lesson complete?Track your journey across the entire course.