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?
  1. Missing facts, wrong assumptions, vague format, context overload, model mismatch — correct
  2. Only the wallpaper
  3. Only output length
  4. 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?
  1. It makes the answer legally binding
  2. It deletes context
  3. It starts a server
  4. 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?
  1. They replace all testing
  2. They hide mistakes
  3. They help reproduce success and diagnose regressions — correct
  4. 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.