What Makes a Good Prompt?
What a good prompt contains, how to test it on real cases, and where prompts stop working, explained simply for your AI interview.
In short
A good prompt says the job, gives the background the model lacks, sets the rules and the output shape, and shows a few examples. Then you test it on real cases, because a prompt is good only when its answers hold up.
13 min readBeginnerVery common · estimateFacts checked 26 November 2026
Say it out loud
Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.
A good prompt tells the model the job, the background it can't know, the rules, and the shape of the answer. I add a few realistic examples, and I wrap each part in its own tag so the model can tell rules from customer data. The step people skip is the test. I run the prompt on real past cases with known answers, check each reply against the rules, and fix what breaks. A prompt that reads well but fails on real cases isn't finished.
Think of a good prompt as a handover note. Anthropic's guide describes the model as "a brilliant but new employee who lacks context on your norms and workflows." A new hire does a good job only with the note in front of them, so the prompt must say the job, the background, the rules and the output shape. In a bank's complaints assistant, that means the fee rules, plus one rule it must never break: no promised refunds, because only a team lead can approve one.
The parts usually go in a rough order: role, instructions, examples, then context and the message to answer. OpenAI's guide lists sections such as identity, instructions and context, notes that the best order can vary by model, and says context is usually best near the end. Anthropic's guide asks for long documents near the top, above the query. The two guides place documents differently, so I test the order on the model I use. Each part gets its own tag, such as policy or complaint, so the model keeps customer words apart from rules.
The part people skip is the test. Anthropic's guide says that "Building a successful LLM-based application starts with clearly defining your success criteria and then designing evaluations to measure performance against them." So I keep a set of past complaints with known right answers, run the prompt on all of them, and count what breaks. Each fix goes back through the whole set, so a new rule is less likely to quietly break an old case.
Two honest limits. Advice on prompts is model-specific, so I re-check it on each model. And a prompt can't enforce what code must enforce. A refund limit belongs in the payment tool's code, because a prompt can only ask the model to respect it.
What is a good prompt, in plain words?
A prompt is everything you send a model in one go: the job, the background, the rules, the examples and the message to answer. The model here is a large language model (LLM), the AI that writes the reply. Google Cloud's guide puts the craft this way: "Prompt engineering is the art and science of designing and optimizing prompts to guide AI models, particularly LLMs, towards generating the desired responses."
Picture a handover note on a hospital ward. A nurse covering a shift who has never worked the ward can do a safe shift only if the note says which patients to watch, which drugs are on hold and what counts as urgent. The model is that nurse. It can only work from what it is given, so a good prompt is a good note.
A bank's complaints assistant needs the same note: the fee rules, the tone to use and the one thing it must never do, plus the customer's message. Without the fee rules it will guess, and a guess can sound confident.
Key words
- Prompt
- Everything sent to the model for one answer: instructions, background and the message.
- Context
- Background the model can't know, like a policy text or a customer's history.
- Output format
- The shape you want back, such as a short reply, a list or a JSON object (a structured record with named fields).
- Few-shot example
- A worked case the model copies in style and shape.
- Eval
- Short for evaluation: a test set of past cases with known answers.
What parts should a good prompt have?
Five parts cover most prompts: a role, the instructions, the context, a few examples and the output format. The role is one line that sets the job and the tone. Anthropic's guide says that "Setting a role in the system prompt focuses Claude's behavior and tone for your use case."
Here is a small case. The vague version of the prompt was "Reply to this complaint." The model had no fee rules, so it promised a refund the bank cannot give and quoted a fee from an old price list. The clear version adds a role, the rules and one example reply.
What one good prompt holds
Inputs for this case
Customer's message
the one case to answer
Policy text
the fee and refund rules
The prompt
Role
a complaints assistant at a bank
Instructions
what to do, and never promise refunds
Example reply
one real case, answered well
Model
writes from all of it at once
Reply in the format
short, cites the policy line
- 1The customer's message goes in as its own part.
- 2The policy text goes in its own tag, so the model reads the fees from it.
- 3The prompt adds the role, the rules and one example reply.
- 4The model writes the reply from all three, in the agreed shape.
- Vague
One line, no context
The reply promises a refund the bank cannot give, and quotes a fee from an old price list.
- Clear
Role, rules, policy and one example
The reply says a team lead reviews any refund, and quotes the fee from the policy tag.
The clear version is longer, so it takes more time to write and sends more text on every call. Add a rule only when a real case needs it, and cut the rest.
Tip
Anthropic's guide makes a habit of this: tell the model what to do, not only what to avoid. Ask for a plain English reply of under 80 words, rather than a bare ban on long replies.
How do you test a prompt before you trust it?
Reading a prompt shows what you hoped it does. A test shows what it really does. Anthropic's guide suggests a quick first check: "Show your prompt to a colleague with minimal context on the task and ask them to follow it." If the colleague is confused, the model probably will be too.
The real test is a set of past cases with known right answers, including the awkward ones: a fee waiver, a customer in distress, a question the policy does not cover. Run each case, check every reply against the rules and count the failures. Fix one failure at a time, then run the whole set again, because that second run catches the old case your new rule broke.
Test a prompt before you trust it
Write the prompt
role, rules, examples and context
Run on past cases
real complaints with known answers
Check each reply
Breaks a rule?
a promised refund, a wrong fee
Wrong shape?
no case number, too long
Ship it
every past case passes
- 1The prompt goes through every past case with a known right answer.
- 2Each reply is checked for a broken rule or a wrong shape.
- 3If every case passes, the prompt can ship.
- 4Any failure sends the prompt back for one fix, then the full set runs again.
Both big vendors say the same thing in their own words:
“Building a successful LLM-based application starts with clearly defining your success criteria and then designing evaluations to measure performance against them.”
Anthropic
“Add representative fixtures, tests, and evaluation checks before changing production prompts.”
OpenAI
Worked example. A bank's fee assistant runs on 200 past complaints, each with the right reply written by a team lead. The first version passes 150 and fails 50. Fourteen of the failures quote last year's fee table. The fix is to put this year's table in a tag and rerun all 200. The cost is that someone now owns that table, and it must be updated whenever fees change.
Prompts also differ by model. Google Cloud's guide notes that "Different models may respond better to specific formats, such as natural language questions, direct commands, or structured inputs with specific fields." Anthropic's guide makes the same point: "Where a technique names a specific model, treat it as measured on that model and re-check it against your own evals before applying it to another."
How would you fix a prompt that fails in production?
Start with the failures, not the prompt. Sort each failed case by its cause, because each cause needs a different fix.
- 1
Find the pattern
Group the failed cases. Replies that promise refunds are one group, and wrong fees are another.
- 2
Match each cause to a fix
A missing rule gets a rule. A wrong shape gets an example. A missing fact gets a tag with the fact in it.
- 3
Move hard limits into code
A refund cap belongs in the payment tool, so a confused or fooled reply can't pay out more than the cap.
- 4
Rerun the full set
Every change goes through all past cases, so a fix for one group can't quietly break another.
What does the interviewer want to hear?
A strong answer covers
- A plain definition: the parts that tell the model the job and its limits.
- The usual parts: role, instructions, context, examples and output format.
- Why tags help: they keep customer words apart from your rules.
- Testing on real past cases, rerun after every change.
- Honest limits: prompts differ by model, and hard limits belong in code.
- A worked fix and what it costs.
Common traps
Trap"Make it longer and it will be better."
BetterLength helps only when each line gives the model something it needs. Cut the padding.
Trap"It reads well, so it works."
BetterRun it on real past cases. Reading a prompt won't show you how it performs.
Trap"Tell it never to make mistakes."
BetterName the exact rule and what to do instead, then test that the rule holds.
Can you spot the weak prompt line?
Spot the weak line
Your claims assistant sends too many simple claims to a person. Which line gives the model the least to work with?
Quick check
A bank's fee assistant quotes last year's fees. Which fix is most likely to work?
Can you answer these from memory?
Flash cards · tap a card to flip it
What will they ask next?
Learn it in depth
Last updated on 26 November 2026
Writing prompts for a team's real workflow?
I design and build AI products and agents, including the prompts, tests and guardrails behind them. Book a short call and tell me what your team needs to get right.