Module 04 Knowledge Check
5 questions. Pass mark 4 out of 5. Answer every question before checking the answer key below, then retry after reading the feedback.
1. An f-string prompt with a missing variable produces…
- A. a KeyError
- B. a prompt containing 'None' and a confident answer about it
- C. an empty prompt
- D. a warning
2. Input validation belongs…
- A. after the model call
- B. before the prompt is built
- C. in the model's instructions
- D. in the response parser
3. Untrusted user text must never be…
- A. summarised
- B. interpolated into the system message
- C. logged
- D. passed to a tool
4. The reliable defence against prompt injection is…
- A. filtering attack phrases
- B. structure: delimited user turn, declared as data, no model-triggered actions
- C. asking the model to be careful
- D. a longer system prompt
5. Prompts should be…
- A. edited in a dashboard for speed
- B. versioned like code, with old versions readable
- C. stored in the database
- D. regenerated each release
---
Answer Key and Explanations
Check these only after attempting every question.
1. B - a prompt containing 'None' and a confident answer about it
Nothing raises, nothing logs, and the answer looks exactly like every other answer.
2. B - before the prompt is built
Content rejected there never reaches the provider, your logs, or your trace store.
3. B - interpolated into the system message
It then competes with your instructions on equal footing, which is what makes injection work.
4. B - structure: delimited user turn, declared as data, no model-triggered actions
A rephrased instruction defeats any pattern you write; the structure holds regardless.
5. B - versioned like code, with old versions readable
A prompt edit is a behaviour change, and without the version recorded you cannot explain earlier runs.
Practical Check
Apply this module to your own work: complete the module activity for *Prompt Templates and Input Validation*, then write one sentence naming what your result shows and one naming what it does not.
Strong Answer Pattern
A strong answer names the task, the evidence used, the check performed, and the remaining limitation. It avoids "proved", "guaranteed", or "always" unless the evidence genuinely supports it.
