Build reviewable context and output rules without mistaking citations for correctness.
Understand the method
Inspect prompt(): system instructions define boundaries; the user message contains a JSON-encoded question and evidence. Each source has an ID and version with its original wording. Candidates remain evidence to inspect, not guaranteed answers.
Output uses answer, citations and abstain. IDs enable programmatic membership checks; inline versioned markers aid human review; abstain indicates incomplete support. Schema conformance alone does not establish correct reasoning.
Compare assigning the staff cap to interns with explaining that P2 requires approval but gives no cap. A citation can accompany a false claim. Abstention can state supported facts and the missing information together.
Source text may contain hostile instructions. Treat it as data, not higher-priority instructions. The lab performs no tools or external actions, but a prompt alone is not a complete injection defense. Production needs layered controls and adversarial testing.
validate_answer() checks non-empty text, types, citation membership and citations for non-abstained answers. It cannot verify the meaning of a claim or its audience. Record structural validity and factual review separately.
Write references for Q1, Q2 and Q4 before model use. The no-invoice question does not justify inventing an exception or replacement process. Preserve what the source actually states.
- 1Identify
- 2Constrain
- 3Validate
- 4Review
Included material
Illustrative human reference format, not an observed model response:
{"answer":"The cap is unspecified; prior approval is required [P2 v1].", "citations":["P2"], "abstain":true}Work through the steps
- Locate prompt() and validate_answer() and describe their separate roles.
- Write all three fields for Q1, Q2 and Q4 by hand.
- Construct an unknown P99 citation and an audience-mismatched answer; identify which is automatically detectable.
Worked example
Defect A: P99 is rejected by membership validation. Defect B: an intern claim citing P1 may pass structure if P1 was retrieved, but is factually wrong. Repair applicability filtering and review the claim.
Your exercise
Add a hostile instruction to your own corpus copy. Explain why it is data and define one review check. Use no private information.
Check before delivery
- State the exact evidence gap without inventing rules.
- Separate schema validation from factual review.
Finish the exercise, then view the reference
Unknown IDs can be blocked automatically; citation meaning needs source review. Record observed attack responses rather than claiming prompt wording guarantees safety.
An original course with teaching exercises. Reading records, practice outcomes and independent certification are distinct.