Update guardian output schema (#17061)

## Summary
- Update guardian output schema to separate risk, authorization,
outcome, and rationale.
- Feed guardian rationale into rejection messages.
- Split the guardian policy into template and tenant-config sections.

## Validation
- `cargo test -p codex-core mcp_tool_call`
- `env -u CODEX_SANDBOX_NETWORK_DISABLED INSTA_UPDATE=always cargo test
-p codex-core guardian::`

---------

Co-authored-by: Owen Lin <owen@openai.com>
This commit is contained in:
maja-openai
2026-04-08 15:47:29 -07:00
committed by GitHub
co-authored by Owen Lin
parent 49677ec71f
commit dcbc91fd39
45 changed files with 673 additions and 312 deletions
+2 -5
View File
@@ -55,12 +55,9 @@ async fn guardian_allows_shell_additional_permissions_requests_past_policy_valid
"msg-guardian",
&serde_json::json!({
"risk_level": "low",
"risk_score": 5,
"user_authorization": "high",
"outcome": "allow",
"rationale": "The request only widens permissions for a benign local echo command.",
"evidence": [{
"message": "The planned command is an `echo hi` smoke test.",
"why": "This is low-risk and does not attempt destructive or exfiltrating behavior.",
}],
})
.to_string(),
),