From f1f9d0c3b5606d8da1c7f7839fc6e0cb85dd5d04 Mon Sep 17 00:00:00 2001 From: yuning-oai Date: Wed, 10 Jun 2026 20:30:44 -0700 Subject: [PATCH] [codex] Expand hosted web search citation guidance (#27501) ## Summary - Expand the hosted web search prompt with explicit Markdown-link citation guidance. - Keep internal `turnX` reference IDs out of final responses and place citations next to supported claims. ## Context https://openai.slack.com/archives/C0AU83S0ZQU/p1781133381448499?thread_ts=1780352049.512299&cid=C0AU83S0ZQU ## Test plan - Confirmed `codex-rs/ext/web-search/web_run_description.md` exactly matches the supplied target prompt. - `UV_CACHE_DIR=/tmp/codex-uv-cache PATH=/tmp/codex-just/bin:/home/dev-user/.rustup/toolchains/1.95.0-x86_64-unknown-linux-gnu/bin:$PATH python3 scripts/format.py --check` - `git diff --check` --- .../ext/web-search/web_run_description.md | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/codex-rs/ext/web-search/web_run_description.md b/codex-rs/ext/web-search/web_run_description.md index 0f22f6df3..77be9a0a0 100644 --- a/codex-rs/ext/web-search/web_run_description.md +++ b/codex-rs/ext/web-search/web_run_description.md @@ -48,6 +48,35 @@ Below is a list of scenarios where browsing the internet MUST be used. PAY CLOSE --- +## Citations + +Results from `web.run` include internal reference IDs such as `turn2search5`. Use +those reference IDs only in calls to `web.run`; do not expose them in the final +response. + +Cite sources in the final response using Markdown links: + +- Cite a single source as `[descriptive source title](https://example.com/page)`. +- Cite multiple sources with separate Markdown links, for example + `[first source](https://example.com/one), [second source](https://example.com/two)`. +- Link directly to the page that supports the claim. Do not link to search result + pages or use bare URLs. + +Formatting of citations: + +- Place each citation as near as possible to the claim it supports, normally at + the end of the sentence or paragraph and after punctuation. +- Do not place citations inside code fences. +- Do not put citations on a line by themselves or collect all citations at the + end of the response. + +If you browse the internet, cite statements supported by web sources. Each cited +source must directly support the associated claim. Prefer primary and +authoritative sources, and use sources from different domains when the response +benefits from multiple perspectives. + +--- + ## Special cases If these conflict with any other instructions, these should take precedence. @@ -74,7 +103,3 @@ Responses may not excessively quote or draw on a specific source. There are seve - You must avoid providing full articles, long verbatim passages, or extensive direct quotes due to copyright concerns. - If the user asked for a verbatim quote, the response should provide a short compliant excerpt and then answer with paraphrases and summaries. - Again, this limit does not apply to reddit content, as long as it's appropriately indicated that those are direct quotes and you link to the source. - ---- - -Cite your sources by using markdown links to the sites you used in your response. Do NOT use citations in the `turnX` style.