Let Guardian V2 satisfy required model reviews (#39658)

## What changed

- Allow the Guardian V2 approval monitor to handle reviews for models that require automatic review.
- Preserve full Guardian review when Guardian V2 is disabled by configuration or managed requirements.
- Cover required-model routing for low- and high-risk actions, plus both Guardian V2 disable paths.

GitOrigin-RevId: d1201cc3dbd7c4a07de633388b14f17ada9feb39
This commit is contained in:
Ankush Gupta authored and copyberry committed 2026-08-20 08:07:06 +00:00
1 parent 5e3a6fe4ee
commit 4e1a772a7d
3 files changed
+233 -12

No files matched your search

+3 -1
View File
@@ -313,11 +313,13 @@ async fn run_guardian_review(
options: GuardianReviewOptions,
) -> ReviewDecision {
let turn = Arc::clone(context.turn());
if !turn
// Required models must use Guardian, but an enabled V2 monitor can satisfy the review.
if (!turn
.config
.config_layer_stack
.requirements()
.auto_review_required_for_model(&turn.model_info.slug)
|| turn.config.features.enabled(Feature::GuardianV2))
&& reasons.retry.is_none()
&& options
.external_cancel