Agentic AI Tutorial 0/80 lessons ~6 min read Lesson 17

    System Prompts

    The system prompt sets the agent's persona, rules, constraints and tool contract.

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

    Introduction

    The system prompt sets the agent's persona, rules, constraints and tool contract. It's the most important prompt you'll write — it runs on every call.

    Beginner analogy: the employee handbook every staffer reads on day one and keeps in their pocket.

    Understanding the topic

    Core concepts:

    • Always sent — counts against context for every turn.
    • Place identity, rules, formatting and tool docs here.
    • Avoid putting user data in the system prompt unless intentional.
    • Use prompt caching to make system prompts effectively free.
    • Keep it stable; A/B test changes carefully.

    Syntax reference

    Visual workflow / architecture:

    bash
    ┌────────────────────────────┐
    │ System Prompt │
    │ • Role │
    │ • Tools (JSON schema)
    │ • Output format │
    │ • Safety rules │
    └──────┬─────────────────────┘
    User turn 1, 2, 3

    Real-world use

    ChatGPT custom GPTs, Claude projects, Cursor's hidden system prompt — all rely on long, careful system messages.

    Best practices

    • Version the system prompt and link it to commits.
    • Use prompt caching to slash cost.

    Common mistakes

    • Stuffing the system prompt with everything — context bloat.

    Hands-on exercise

    Interview preparation — practice these questions:

    • Q1. Why does the system prompt run on every call?
    • Q2. How does prompt caching save money?
    • Q3. Scenario: your agent ignores its safety rules. What do you check first?
    Ready to mark this lesson complete?Track your journey across the entire course.