mirror of
https://github.com/openai/codex.git
synced 2026-10-29 19:08:43 +00:00
Add opt-in synchronous Guardian review for native tool calls (#57433)
## What changed - Add `CoreToolRuntime::requires_guardian_review` to review opted-in function calls before dispatch and stop execution when review rejects the call. - Deliver proposed calls as native review evidence, preserving encrypted argument metadata. When hooks rewrite arguments, review the updated arguments and discard the original encrypted replay content. - Deduplicate native call evidence against reviewer history and include paired evidence outputs in input budgets. - Keep review accounting and metrics for native calls without emitting action-specific client assessment events, and omit approval payloads from debug output. ## Testing Extend regression coverage for rewritten native calls across review retries, denied calls that never execute their handlers, oversized native evidence, and review metrics without client events. GitOrigin-RevId: c3b22c0220344581c2b38f233001abaed49cba34
This commit is contained in:
@@ -73,6 +73,7 @@ impl GuardianModelPolicy {
|
||||
GuardianScope::Mcp => self.mcp,
|
||||
GuardianScope::Network => self.network,
|
||||
GuardianScope::Permissions => self.permissions,
|
||||
GuardianScope::NativeTool => Some(GuardianReviewMode::Synchronous),
|
||||
}
|
||||
.unwrap_or(GuardianReviewMode::Disabled)
|
||||
}
|
||||
@@ -120,6 +121,7 @@ pub enum GuardianScope {
|
||||
Mcp,
|
||||
Network,
|
||||
Permissions,
|
||||
NativeTool,
|
||||
}
|
||||
|
||||
impl GuardianScope {
|
||||
|
||||
Reference in New Issue
Block a user