A final answer that states facts without saying where they came from asks the reader to trust the agent. A cited answer lets the reader check: each claim carries the tool that produced it and the value it returned. The ReAct pattern already links every tool result back to its call by tool_call_id, so the raw material for citations is in the run itself. Make the final answer carry it: when the agent writes the answer, it names the tool and the returned value behind each number and each name. A claim with no tool behind it is marked as unconfirmed, not stated as fact.
What you need
- An agent whose tools return the facts its answers state
- A citation format: tool name plus the returned value
- Three test questions with answers that come from tool results
Step 1: Write the citation rule into the instructions
Add a sentence that every factual claim in the final answer must carry the tool name and the value it returned, and that a claim with no tool behind it must be marked unconfirmed.
Step 2: Ask the test questions and check the citations
Ask each test question and open the tool results behind the citations to confirm the values match. A citation that points to the wrong result is as bad as no citation.
Step 3: Send back any answer with uncited claims
If an answer states a fact with no tool behind it, return it to the agent with the missing citations listed. Do not send the uncited version.
Worked example: synthetic tool-output citation check
The table below is a synthetic example. It shows the expected result of citing tool outputs; no agent was run.
| Claim | Tool cited? | Value matches? |
|---|---|---|
| Order A123 ships on Friday | lookup_order | Yes |
| Price is $49 per month | get_price | Yes |
| Support is 24 hours | None – unconfirmed | n/a |
| All claims cited or marked | Yes | Pass |
Expected result (UNTESTED). every claim carries the tool that produced it, the values match, and the one unconfirmed claim is marked, not stated as fact. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- A citation proves a tool returned a value, not that the tool itself is right.
- Citations only help if someone opens them; unchecked citations rot.
- Forcing a citation for every claim can make short answers long, so keep the format tight.
- A value the tools never returned cannot be cited into existence.
