14. Prompt Debugging
Diagnose why an AI answer was weak and improve the prompt deliberately.
By Jacques Botte, founder of Toptronic®. Last updated 19 September 2026.
The lesson
When an AI answer is poor, debug the prompt like firmware: identify missing input, wrong assumptions, vague output format, excessive context, or a model mismatch.
Ask the AI to list assumptions before answering, or ask for a short plan before the final answer. These two checks reveal many hidden failures.
Keep versions of good prompts. A prompt that works repeatedly is a business asset.
A junior web developer debugs a vague AI answer by asking it to list its assumptions, then finds the prompt never named the framework version.
A laboratory supervisor traces a weak method summary back to a missing output format and adds a table structure to the prompt.
A warehouse systems lead uses a plan-first prompt to discover the model ignored the packing rules because they sat at the end of a long context block.
A nurse unit manager debugs a handover prompt by adding the exact ward terminology the model had been guessing.
A plumber debugs a quoting prompt that produced wrong material lists, discovering the prompt never stated the job type.
A financial controller asks the model to list assumptions before answering, revealing that the prompt had not supplied the reporting period.
A robotics technician debugs an unhelpful fault-diagnosis answer by adding the exact controller error text to the prompt.
A content editor fixes a poor blog draft by naming the audience and the length in the prompt, then keeps the corrected version for reuse.
A support team lead traces repeated wrong answers to a stale context block and rebuilds the prompt around current product notes.
A municipal rostering officer debugs a staffing prompt by feeding the exact shift rules that the first version had only summarised.
Check yourself
Question 1: What should you inspect when an AI answer is weak?
- Missing facts, wrong assumptions, vague format, context overload, model mismatch — correct
- Only the wallpaper
- Only output length
- Nothing
Answer: Missing facts, wrong assumptions, vague format, context overload, model mismatch
Weak outputs usually trace back to prompt, context, or model selection issues.
Question 2: Why ask for assumptions before the answer?
- It makes the answer legally binding
- It deletes context
- It starts a server
- It reveals what the model is guessing — correct
Answer: It reveals what the model is guessing
Visible assumptions are easier to correct.
Question 3: Why keep versions of good prompts?
- They replace all testing
- They hide mistakes
- They help reproduce success and diagnose regressions — correct
- They slow the app
Answer: They help reproduce success and diagnose regressions
Prompt versioning turns learning into a repeatable process.
← Previous lesson · All 91 lessons · Next lesson →
The full course — 91 lessons and 273 quiz questions — ships inside the app. Get TPEE to study it offline.