mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Record reviewed actions with security risk scores (#40901)
## What changed - Add optional `call_id` and `action` fields to `SecurityRiskScore` so a persisted score identifies the tool call and bounded action that produced it. - Populate the fields after Guardian V2 classifies an action while leaving fail-closed and legacy scores without provenance. ## Testing - Verify scores preserve action details for direct tool calls and nested code-mode calls. - Verify rollout serialization retains the new fields. GitOrigin-RevId: fce69af37f368cecf1d9bce42bfc38a969e969b7
This commit is contained in:
1 parent
62fb56ee56
commit
d4998d611a
9 files changed
+130
-3
No files matched your search
@@ -12,6 +12,12 @@ use std::collections::BTreeMap;
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
|
||||
pub struct SecurityRiskScore {
|
||||
pub scores: BTreeMap<String, f64>,
|
||||
/// The tool call whose action produced this score, when available.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub call_id: Option<String>,
|
||||
/// The bounded tool action that was reviewed to produce this score.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub action: Option<serde_json::Value>,
|
||||
/// When sampling started, if this snapshot was written by a timestamp-aware client.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[schemars(with = "Option<String>")]
|
||||
|
||||
Reference in new issue
Block a user