HackBlue

Tools · LLM application security · 12 / 23

A citation in the reply is not a retrieved source

A document title in the model’s reply is text the model produced. The retrieval log’s document id is the source. Write the id from the log, and say when the title in the reply is not there.

11 min read · practice only with authorization

The reply can name a document it did not receive

An answer may say it is drawing on a policy, a ticket, or a page title. That name is part of the generated reply. The retrieval log lists the document ids that were actually placed in the prompt for that request. A title that is not among those ids was not a retrieved source for this turn.

People trust a citation because it looks like a footnote. The footnote is only as good as the log line that matches it.

Match titles to ids, do not smooth them

If the reply names three documents and the log has two ids, write the two ids and write that the third name is not in the log. Do not drop the third name, and do not add an id so the lists look equal. A missing id is the finding.

The log’s title field, when it has one, is the title stored for that id. Prefer the id. A title in the reply that only resembles the log’s title is not a match unless you say they differ.

What to file

File the request id, each retrieved document id, and any title the reply stated. Mark each reply title as matched to an id or as not in the log. Do not paste document text that may hold secrets. The id is enough to find the source in the store.

Worked case: a policy the log never fetched

The lab library bot answers a question and says it used “Room policy 2024.” The retrieval log for that request has one id, doc-18, titled “Room board legend.” A draft quotes the reply’s policy name as the source.

The note lists doc-18 and says “Room policy 2024” is not in the retrieval log. The answer is not cited to that policy. Anyone who needs the real source opens doc-18. The reply’s title stays labeled as reply text.

Snippet
request: req-510
retrieved id: doc-18  stored title: Room board legend
reply names: Room policy 2024
match: none
write: the named policy was not retrieved
source to open: doc-18

Diagram

A title in the reply versus an id in the log

Only the log says what was fetched.

Reply

Has. A document name the model wrote

Use. As text to check against the log

Does not. Prove that document was retrieved

Retrieval log

Has. Document ids placed in the prompt

Use. As the source list for this request

Does not. Include a name that appears only in the reply

Check yourself

1. The reply names a policy. Where do you confirm it was retrieved?

2. The log has two ids and the reply names three documents. What do you write?

3. Why prefer the document id over a title in the reply?