Foundations domain 4 · Prompt engineering and structured output
- Explicit criteria beat vague instructions. "Only report high-confidence findings" doesn't define anything. Say what to report and what to skip. Temporarily switching off a noisy category can restore trust while its criteria are fixed.
- Few-shot examples make ambiguous judgments consistent, and should cover the real range of inputs, including the hard ones.
- Guaranteed structure: use structured outputs or strict tool use with a JSON schema, not "reply only with JSON".
- Schema design: make a field optional or nullable when the information can genuinely be absent (otherwise the model invents it); use enums with an "other" plus detail field; use arrays for variable counts.
- Validation and retry: retry with the specific validation error. If the information isn't in the source, retrying won't help. Schema validation checks shape, not meaning, so add semantic checks, such as totals adding up and dates within range.
- Independent review: the session that wrote something is a poor reviewer of it. Use a separate instance, and separate passes for separate concerns (per file, then cross-file).
- Message Batches API: lower cost, up to 24 hours, for work nobody is waiting on. Each request is independent, so there's no multi-step loop inside a batch, and results are matched by
custom_id, not by order. - Long documents: put them at the top and the question at the end.
See also: Professional domain 2 · Prompts, templates and guardrails.
See also: Exam guide vs today · Foundations (CCAR-F).
Docs: Structured outputsStrict tool useBatch processingPrompting best practices
Practise Domain 4