Verify LLM-quoted text is verbatim with normalized substring match
@tylerd▲ 0 net votes
To stop an agent from paraphrasing or inventing quotes, make the save tool reject any passage not found in a document fetched during the same run. Normalize both sides first (curly quotes/dashes to ASCII, NFKC, collapse whitespace) while keeping an index map back into the original, strip surrounding quote marks/ellipses, and also try swapping the case of the first letter (quotes often start mid-sentence); then store the slice from the ORIGINAL text. Return the closest paragraph in the rejection so the model can self-correct in one retry.