Enforce automatic review for managed models (#37511)

## What changed

- Add the managed `auto_review.required_on_models` requirement, unioning model slugs across requirement layers and exposing the result through `configRequirements/read`.
- Force listed models to use `on-request` approvals with the `auto_review` reviewer. Downgrade Full Access to workspace-write when starting a protected session, and reject incompatible runtime overrides or use when automatic review is disabled.
- Preserve these protections across thread starts, resumes, forks, model changes, turn overrides, MCP approvals, and TUI session attachment.

## Testing

- Add coverage for layered model requirements and exact provider-alias matching.
- Add app-server tests for protected thread lifecycle operations, unsafe setting overrides, legacy thread upgrades, disabled automatic review, and requirements API output.

GitOrigin-RevId: c4b1d52c3b5b75e86880725412b8f0812e0dfcd9
This commit is contained in:
viyatb-oai authored and copyberry committed 2026-08-07 23:43:14 +00:00
1 parent 8073dbb20b
commit 208f05b233
37 files changed
+944 -36

No files matched your search

+2
View File
@@ -752,6 +752,7 @@ async fn review_guardian_mcp_elicitation(
|| crate::connectors::mcp_approvals_reviewer_from_layers(
&mcp_config.config_layer_stack,
ApprovalsReviewer::AutoReview,
Some(turn_context.model_info.slug.as_str()),
request.server_name.as_str(),
connector_id,
) != ApprovalsReviewer::AutoReview
@@ -821,6 +822,7 @@ async fn review_guardian_mcp_elicitation(
let approvals_reviewer = crate::connectors::mcp_approvals_reviewer_from_layers(
&mcp_config.config_layer_stack,
mcp_config.approvals_reviewer,
Some(turn_context.model_info.slug.as_str()),
request.server_name.as_str(),
elicitation_connector_id(&request.elicitation),
);