What makes an extraction prompt reliable?
Extraction is the task of pulling specific, named values out of unstructured text — an invoice total, a person's title, a list of skills — and returning them in a fixed shape. The failure modes are predictable: the model invents fields you didn't ask for, guesses a value that isn't actually in the source, changes the JSON key names between runs, or wraps the output in prose that breaks your parser.
Every one of those failures has the same root cause: ambiguity about what "done" looks like. A reliable extraction prompt removes that ambiguity by being explicit on four axes — **which fields**, **what type** each field is, **what shape** the overall output takes, and **what to do when a value is missing**. Nail those four and the model has nothing left to improvise.
Where the platform supports it, prefer a real structured-output mode over asking for JSON in plain text. OpenAI's structured outputs / JSON mode and the equivalent constrained-decoding features described in the Anthropic prompt engineering overview enforce the schema at decode time, so the model literally cannot return malformed JSON. Prompt wording is your second line of defense, not your only one.