Prompt Engineering Fundamentals
Last reviewed
Correct answer: A. State explicitly what to emit when a field is missing, and show that case in an example
Explanation
The principle — A prompt that only describes the normal case has delegated every abnormal case to the model's judgement. Extraction tasks make this visible fast, because real inputs are frequently incomplete and a plausible invention is indistinguishable from a real value downstream.
Why the key is correct — Google's checklist names this fault directly as an underspecified task: ensure the prompt's instructions provide a clear path for handling edge cases and unexpected inputs, and provide instructions for handling missing data rather than assuming inserted data will always be present and well-formed. The remedy has two halves and both matter. The instruction has to state the required behaviour positively — emit null for an absent field — because Anthropic's guidance is to say what to do rather than what not to do, and "do not guess" leaves the representation of a missing value undefined. And the missing-field case has to appear in an example, because Google says one of the primary objectives of examples is to show the response format, and Anthropic asks that examples cover edge cases. An instruction with no matching demonstration is the weaker half of the fix.
Why the others are wrong — "Accurate" and "avoid guessing" combine a subjective qualifier with a prohibition, leaving the absent-field output shape unspecified. More well-formed examples actively teach that both fields are always present. And self-reported uncertainty is unreliable and reintroduces a manual step, while still not defining what the output should look like when a field is absent.
Remember this — Specify the empty case as carefully as the normal one, and show it.
Sources — Google Cloud, Overview of prompting strategies; Anthropic, Prompting best practices.
Sources
“Ensure that the prompt's instructions provide a clear path for handling edge cases and unexpected inputs.”
“Diverse: Cover edge cases and vary enough that Claude doesn't pick up unintended patterns.”
Practise 10 questions on this topic
Take Prompt Engineering Fundamentals — Timed Test 1 (10 questions) — scored instantly, explanation for every question, no login.