Module 04

Prompting

Task, context, constraints, format, examples — and the iteration that makes them work.

You leave with the system prompt for your capstone assistant.

Same question, two promptswatch what changes
Prompt
Write about our new product.
Response
In today's fast-paced world, businesses are constantly seeking innovative solutions that…
Prompt
You are writing to existing customers. In 80 words, explain one thing that is now easier. No adjectives.
AI Foundations · BSAI-1APrompting2 / 17
Watch for

One question. Four prompts.

python demos/01_prompt_compare.py
  • The question is identical every time. Only the framing changes.
  • Watch the third one — it is the only prompt that says who the reader is.
  • Note how long each response is. Nobody asked for a length.

The model is not guessing what you meant. It is completing what you wrote.

The whole of Module 04, in one sentence

01

Anatomy of a prompt

Four parts. Most failed prompts are missing three of them.

AI Foundations · BSAI-1APrompting5 / 17

What a working prompt contains

  • 01TaskThe actual thing to do, stated as an instruction — not a topic.
  • 02ContextWho it is for, what they already know, what situation this sits in.
  • 03ConstraintsLength, tone, what to avoid, what must be included.
  • 04FormatThe shape you want back — a list, a table, an email, JSON.
AI Foundations · BSAI-1APrompting6 / 17

The same request, twice

Missing three of four
"Summarise this report."
  • No audience — so it writes for nobody
  • No length — so it writes as much as it likes
  • No format — so you get prose you have to reshape
  • No purpose — so it keeps the wrong things
All four present
"For our operations lead, in 150 words, three bullets: what changed, what it costs, what we decide this week."
  • Audience sets the vocabulary
  • Length forces prioritisation
  • Format is ready to paste
  • Purpose decides what survives the cut
02

Role and standing instructions

Say it once, not in every message.

AI Foundations · BSAI-1APrompting8 / 17

A system prompt sets the standard for the whole conversation

System promptapplies to every turn that follows
System
You are a careful analyst. You never state a figure without saying where it came from. If a source is missing, you say so instead of estimating.
User
What was our churn last quarter?
Response
I don't have the churn figure — it isn't in the material you've given me. If you paste the retention export I'll calculate it.

Showing beats describing.

Few-shot prompting, entire concept

AI Foundations · BSAI-1APrompting10 / 17
Watch for

Two examples do what a paragraph of instruction cannot

python demos/03_few_shot.py
  • First run — describe the format you want in words. Watch it drift.
  • Second run — show two examples instead. Watch it lock on.
  • The examples are shorter than the instruction they replace.
AI Foundations · BSAI-1APrompting11 / 17

Ask for a shape your next step can actually use

Structured outputthis is what makes prompts composable
Prompt
Extract every action item. Return JSON only: a list of objects with owner, task, due.
Response
[{"owner":"Priya","task":"Send revised quote","due":"Friday"}, {"owner":"Sam","task":"Confirm venue","due":"Tuesday"}]
03

Context engineering

The right information, in the right shape, at the right time.

AI Foundations · BSAI-1APrompting13 / 17

Everything in the window competes for attention

  • 01More context is not better contextIrrelevant material dilutes the relevant material. Cut before you add.
  • 02Position mattersWhat sits at the very start and the very end gets used most reliably.
  • 03Shape it before you send itA clean table beats a raw transcript containing the same facts.
  • 04Say what to ignoreExplicitly excluding a section is cheaper than hoping it gets skipped.
AI Foundations · BSAI-1APrompting14 / 17
What just happened

What just happened

  • Round one failed because the prompt was vague, not because the model is weak.
  • Round two added an audience. Round three added a format. Nothing else changed.
  • The final prompt is longer than the first — but only by one sentence.

Iteration is the skill. The first prompt is a draft, not a verdict.

AI Foundations · BSAI-1APrompting16 / 17
Your turn

Prompt lab

Take one prompt you already use — or one you need for your capstone. Diagnose what is missing, rewrite it, run both, and note in one line what the rewrite fixed.

You leave withThe system prompt for your capstone assistant
AI Foundations · BSAI-1APrompting17 / 17

You can now make a model do what you actually meant.

Prompt Practitioner