Require automatic review for high-risk Guardian v2 actions (#38569)

## What changed

- Add a thread-scoped extension API for requesting automatic review, resolving
  multiple contributors to the strongest requirement.
- Have Guardian v2 request automatic review when it is enabled and the latest
  `action_risk` score is at least `0.8`.
- Honor extension review requirements across tool approvals, MCP elicitation,
  and remote execution while preserving host configuration and managed-policy
  constraints.

## Testing

- Cover contributor registration and requirement resolution.
- Verify Guardian v2 requests review at the threshold, returns to the default
  below it, and does not affect threads where the extension is disabled.
- Exercise extension-requested strict review with a remote model override.

GitOrigin-RevId: 6329fc23585d5cc7173c39bb9952c3109ec3884b
This commit is contained in:
jif authored and copyberry committed 2026-08-14 12:37:13 +00:00
1 parent d40dfcc3c7
commit 1c4f42863c
11 files changed
+187 -15

No files matched your search

+1 -1
View File
@@ -1306,7 +1306,7 @@ async fn maybe_request_mcp_tool_approval(
let strict_auto_review = match turn_state {
Some(turn_state) => turn_state.lock().await.strict_auto_review_enabled(),
None => false,
};
} || sess.extension_strict_auto_review_enabled().await;
let approvals_reviewer = connectors::mcp_approvals_reviewer_from_layers(
&config.config_layer_stack,
config.approvals_reviewer,