A RAG answer with citations looks trustworthy. Grounding tests check that the trust is earned:
- Every cited document exists and opens.
- The facts in the answer, such as its numbers, appear in the cited document.
- Every factual sentence is supported by the cited text. The sneakiest failure is an extra claim placed beside a correct citation.
The third check needs a rule you can apply without a judge. A simple one works well: most of a sentence's content words must appear in the cited document.
Your task
Write grounding tests for PolicyPal. On submit they run against correct builds and builds with wrong citations, invented sources and unsupported claims.