From 6d0d839f1a729908487121ab046057f7d6db552a Mon Sep 17 00:00:00 2001 From: felixxia-oai Date: Mon, 23 Nov 2026 23:31:55 +0000 Subject: [PATCH] Direct Guardian to read user instructions before its first verdict (#63513) ## Why The pending action omits the user's instructions, so even an apparently low-risk action can be reviewed without the context needed for a verdict. ## What changed The default Guardian board guidance now tells the reviewer to list channels, subscribe to the relevant channel if needed, and read the user's original instructions before its first verdict on each task. For later reviews, it directs the reviewer to use subscription updates and look up missing or potentially stale instructions. ## Testing Update assertions to check that blank retrieval instructions use the new default and that custom retrieval instructions override it. GitOrigin-RevId: e574ac72201c933c203d6ac48bb0b1019488584f --- codex-rs/ext/guardian-v3/src/lib.rs | 10 +++++++--- codex-rs/ext/guardian-v3/tests/housekeeping.rs | 2 +- codex-rs/ext/guardian-v3/tests/retrieval/guidance.rs | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/codex-rs/ext/guardian-v3/src/lib.rs b/codex-rs/ext/guardian-v3/src/lib.rs index f8cd5ea499..b7e6c2658f 100644 --- a/codex-rs/ext/guardian-v3/src/lib.rs +++ b/codex-rs/ext/guardian-v3/src/lib.rs @@ -40,9 +40,13 @@ pub fn board_retrieval(instructions: Option<&str>) -> codex_core::guardian_revie let strategy = instructions .map(str::trim) .filter(|text| !text.is_empty()) - .unwrap_or( - "Use the guardian_board tools when you need more evidence for the exact action.", - ); + .unwrap_or(concat!( + "Before your first verdict for each task, use the Guardian board even if the action appears low risk. ", + "The pending action does not include the user's instructions. ", + "Call guardian_board.get_channels, then call guardian_board.subscribe for the relevant channel ", + "if you do not already follow it. Read the user's original instructions there. ", + "On later reviews, use the subscribed updates and look up any missing or possibly stale instructions.", + )); let board_rules = concat!( "Search or read any live channel, including channels you do not follow. ", "Use subscribed_channels to see which channels you follow. Subscribe or unsubscribe to manage which channels feed new originals to this conversation. ", diff --git a/codex-rs/ext/guardian-v3/tests/housekeeping.rs b/codex-rs/ext/guardian-v3/tests/housekeeping.rs index 9039df564e..a0dc079796 100644 --- a/codex-rs/ext/guardian-v3/tests/housekeeping.rs +++ b/codex-rs/ext/guardian-v3/tests/housekeeping.rs @@ -1184,7 +1184,7 @@ async fn subscribed_evidence_reaches_the_retained_reviewer_when_it_becomes_idle( assert!(routing_request.instructions_text().contains(ROUTING)); let instructions = request.instructions_text(); assert!(instructions.contains(RETRIEVAL)); - assert!(!instructions.contains("Use the guardian_board tools when you need more evidence")); + assert!(!instructions.contains("call guardian_board.subscribe")); assert!(instructions.contains("Subscribing does not fetch a channel's earlier posts")); assert!(instructions.contains("carries the same authority as that message")); assert!(instructions.contains( diff --git a/codex-rs/ext/guardian-v3/tests/retrieval/guidance.rs b/codex-rs/ext/guardian-v3/tests/retrieval/guidance.rs index 961ae2213b..ec3bfeb5b6 100644 --- a/codex-rs/ext/guardian-v3/tests/retrieval/guidance.rs +++ b/codex-rs/ext/guardian-v3/tests/retrieval/guidance.rs @@ -72,7 +72,7 @@ async fn blank_retrieval_instructions_use_default_board_guidance() -> anyhow::Re }) .await; let instructions = response.single_request().instructions_text(); - assert!(instructions.contains("Use the guardian_board tools when you need more evidence")); + assert!(instructions.contains("call guardian_board.subscribe")); assert!(!instructions.contains(V2_HISTORY_PROMPT)); spawned.thread.shutdown_and_wait().await?;