Prompt Engineering
Write prompts that work reliably: structure, examples, reasoning, structured output, context limits, safety and evaluation, with small runnable harnesses to test your prompts.
Syllabus
Foundations of Prompting
- What Prompt Engineering Is
- How Models Read Your Prompt
- The Anatomy of a Good Prompt
- System, User and Assistant Messages
Core Techniques
- Be Clear and Specific
- Few-Shot Examples
- Role, Audience and Tone
- Controlling the Output Format
- Delimiters and Separating Data from Instructions
Reasoning and Multi-Step Tasks
- Step-by-Step Reasoning (Chain of Thought)
- Self-Consistency: Sample Several, Take the Majority
- Prompt Chaining and Decomposition
- Self-Critique and Verification
Structured Output and Validation
Context: Budgets, Memory and Retrieval
- Context Windows and Token Budgets
- Long Prompts: Order and Placement
- Grounding With Retrieved Documents
- Conversation Memory and Summarisation
Safety and Robustness
- Prompt Injection and Defences
- Privacy, Secrets and Responsible Use
- Handling Refusals, Uncertainty and Off-Topic Requests
Evaluating and Operating Prompts
- Building a Test Set and Harness
- Versioning and Change Control for Prompts
- Cost, Latency and Prompt Length
- Monitoring and Continuous Improvement