mirror of
https://github.com/openai/codex.git
synced 2026-08-23 13:09:46 +00:00
Store security risk scores as a snapshot (#38567)
## What changed - Replace the single `category` and `score` fields in `SecurityRiskScore` with a deterministic map of category names to scores. - Validate the full Guardian V2 classifier response before storing it as one thread extension value and, for non-ephemeral threads, one rollout item. - Cover serialization and rollout loading with snapshots containing multiple score categories. GitOrigin-RevId: 24525de691f96bd34ccfe04acab2f01aca309837
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
/// A durable, thread-owned security risk classifier score.
|
||||
/// A durable, thread-owned snapshot of security risk classifier scores.
|
||||
///
|
||||
/// These records belong to rollout history only and must not enter model-visible
|
||||
/// conversation context or user-visible thread item projections.
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
|
||||
pub struct SecurityRiskScore {
|
||||
pub category: String,
|
||||
pub score: f64,
|
||||
pub scores: BTreeMap<String, f64>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user