Skip to content

fix: license per-claim grounding refusal in the default report prompt - #2166

Open
MrSampson wants to merge 1 commit into
assafelovic:mainfrom
MrSampson:fix/report-grounding-instruction-main
Open

MrSampson wants to merge 1 commit into
assafelovic:mainfrom
MrSampson:fix/report-grounding-instruction-main

Conversation

@MrSampson

Copy link
Copy Markdown

Apologies for the confusion and delay on this one — re-opening as a clean PR against main per the note on #1961.

This is the same fix from #1961, rebased onto current main with just the two files it actually touches (the original PR targeted the now-retired master branch, which had diverged enough that the diff picked up hundreds of unrelated files).

Problem

generate_report_prompt (used by deep_research's default write_report() call when no custom_prompt is given) repeatedly demands maximal comprehensiveness and has exactly one anti-fabrication guard — "do not cite sources absent from context" — which says nothing about a present source that doesn't actually support the specific claim next to its citation.

Real-world evidence showed the model is capable of the correct behavior: an ad hoc custom_prompt asking it to flag unreadable/unsupported content produced a grounded, partially-refusing report on the same context that the default prompt fabricated a confidently-cited section from. The default path just never told it refusal/hedging was an acceptable output.

Fix

Adds an explicit per-claim grounding guard to generate_report_prompt, modeled on generate_quick_summary_prompt's existing "if the results are insufficient to answer the query, state that clearly" — the same pattern already proven out for a different tool (quick_search), now applied at the granularity report synthesis actually needs (per-claim, not whole-report).

Testing

  • Added tests/test_report_prompt_grounding.py (2 tests) — passing locally on current main.

Closes the same underlying issue as #1961.

generate_report_prompt (used by deep_research's default write_report()
call, no custom_prompt) repeatedly demands maximal comprehensiveness
and has exactly one anti-fabrication guard -- 'do not cite sources
absent from context' -- which says nothing about a present source
that doesn't actually support the specific claim next to its
citation. Real-world evidence demonstrated the model is capable of the
correct behavior (an ad hoc custom_prompt asking it to flag
unreadable/unsupported content produced a grounded, partially-
refusing report on the same context that the default prompt
fabricated a confidently cited section from) -- the default path
just never told it refusal/hedging was an acceptable output.

Adds an explicit per-claim grounding guard, modeled on
generate_quick_summary_prompt's existing 'if the results are
insufficient to answer the query, state that clearly' -- the same
pattern already proven out for a different tool (quick_search),
now applied at the granularity report synthesis actually needs
(per-claim, not whole-report).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant