By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
Most people write prompts like they write text messages. Then they test the output. But a prompt has a structure, and each part of that structure fails in its own way. Once you can see the four parts, you can point at the part that broke.
Here is a realistic Nova prompt. Read it as four labelled layers:
SYSTEM (instructions)
You are Nova, the support assistant for Acme Outfitters.
Rules:
- Answer only from the CONTEXT below. If the context does not
contain the answer, say: 'I do not have that information.'
- Never promise a refund. You may say a return can be started.
- Keep answers under 80 words and end with the source article title.
CONTEXT (retrieval + tool output)
[1] Returns Policy (updated 2026-03): Sale items may be returned within
14 days of delivery for store credit. Worn items are excluded.
[2] Shipping FAQ: Standard delivery is 3-5 working days.
Order #4521: delivered 2026-11-02, status DELIVERED.
USER (the question)
I bought a jacket on sale last week. Can I send it back?
FORMAT (implied by the rules)
Plain prose, under 80 words, ends with the source title.| Part | Typical failure | The test that catches it |
|---|---|---|
| Instructions | Model drifts from a rule after a few turns, or prioritises the user's insistence over the system rule | Adversarial prompts: 'ignore your rules and…' — assert the rule still holds |
| Context | Right answer is in a chunk that fell outside the window, or the wrong chunk ranks first | Groundedness scoring: is every claim supported by the returned chunks? |
| Examples | Examples leak into the answer, or teach the model the wrong tone | Check that example text never appears verbatim in real answers |
| Format | JSON missing a key, prose instead of JSON, answer cut mid-sentence | Schema validation plus 'ends with punctuation' assertion |
A prompt change is a code change. Treat it with the same ceremony: a diff, a review, a test run, and a way to roll back.
Key takeaways
Prompts have four parts: instructions, context, examples, format.
Wrong facts usually means a context problem; wrong behaviour usually means an instruction problem.
Each prompt part maps to a different kind of test.
Any prompt change — even a 'small wording tweak' — needs a regression run.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.