Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apologies for the confusion and delay on this one — re-opening as a clean PR against
mainper the note on #1961.This is the same fix from #1961, rebased onto current
mainwith just the two files it actually touches (the original PR targeted the now-retiredmasterbranch, which had diverged enough that the diff picked up hundreds of unrelated files).Problem
generate_report_prompt(used bydeep_research's defaultwrite_report()call when nocustom_promptis 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_promptasking 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 ongenerate_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
tests/test_report_prompt_grounding.py(2 tests) — passing locally on currentmain.Closes the same underlying issue as #1961.