CoachnestCoachnest
Sign InGet Started
Back to course

Prompt Engineering Mastery: From Fundamentals to Production

…
—
Contents
1

What Is Prompt Engineering?

ReadingFree
2

How Large Language Models Actually Work

ReadingFree
3

Tokens, Context Windows, Temperature & Sampling

Reading11m
4

The Anatomy of a Great Prompt

Reading13m
5

Module 1 Knowledge Check

Quiz8m
6

Zero-Shot, One-Shot & Few-Shot Prompting

Reading12m

Role & Persona Prompting

Reading9m
8

Instruction Clarity, Delimiters & Decomposition

Reading11m
9

Controlling the Output Format

Reading10m
10

Module 2 Knowledge Check

Quiz8m
11

Chain-of-Thought Prompting

Reading12m
12

Self-Consistency & Tree-of-Thought

Reading11m
13

ReAct — Reasoning + Acting with Tools

Reading12m
14

Structured Output with JSON Schemas

Reading11m
15

Module 3 Knowledge Check

Quiz8m
16

Retrieval-Augmented Generation (RAG)

Reading13m
17

Prompt Templates, Variables & Chaining

Reading11m
18

Tool / Function Calling Patterns

Reading12m
19

Project — Build a Customer Support Assistant

Reading14m
20

Module 4 Knowledge Check

Quiz8m
21

Evaluating Prompt Quality

Reading12m
22

Prompt Injection & Security

Reading12m
23

Reducing Hallucinations

Reading10m
24

Cost, Latency & Optimization

Reading10m
25

Final Assessment — Prompt Engineering Mastery

Quiz15m
←→navigate lessons
Chapter 2 of 5·Module 2 · Core Prompting Techniques
Lesson 7 of 25Reading9 min

Role & Persona Prompting

#Role & Persona Prompting¶

Assigning the model a role conditions which part of its vast training distribution it draws from.

The Mechanism¶

"You are a senior security engineer" doesn't give the model new knowledge — it biases sampling toward text written by/for security engineers: precise, risk-aware, jargon-appropriate.

Examples¶

text
2 lines
1You are a patient kindergarten teacher.
2Explain how the internet works.

vs.

text
2 lines
1You are a distributed-systems architect.
2Explain how the internet works.

Same question, radically different register, depth, and vocabulary — without changing the task.

Effective Role Prompts Specify¶

  1. 1Expertise — "a senior tax accountant specialising in small businesses"
  2. 2Audience — "explaining to a first-time founder"
  3. 3Tone/values — "concise, no hedging, flags risks explicitly"
text
4 lines
1You are a senior tax accountant for small businesses.
2You explain things to non-experts in plain language,
3always flag deadlines, and never give advice you're unsure of —
4instead you say what a professional should be consulted about.

Where to Put It¶

Use the system message for stable role/behaviour, and the user message for the specific task. The system prompt persists across the whole conversation and is the right home for persona, guardrails, and output conventions.

Limits & Pitfalls¶

  • A role does not add facts. "You are a doctor" does not make medical claims accurate.
  • Over-flattering personas ("You are the world's greatest genius") add no measurable benefit and waste tokens.
  • Roles can conflict with safety training; they are not a jailbreak and shouldn't be used to bypass guardrails.

Takeaway: Use roles to set style, depth, and perspective — not to manufacture expertise the model lacks.

Previous

Zero-Shot, One-Shot & Few-Shot Prompting

Next

Instruction Clarity, Delimiters & Decomposition

Use ← → arrow keys to navigate between lessons