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:
jif authored and copyberry committed 2026-08-14 12:16:51 +00:00
1 parent 08c48e3700
commit aa905bb962
10 files changed
+41 -32

No files matched your search

+6 -1
View File
@@ -354,7 +354,12 @@ fn rollout_item_variants_preserve_existing_payload_shapes() -> Result<()> {
}),
json!({
"type": "security_risk_score",
"payload": { "category": "action_risk", "score": 0.92 },
"payload": {
"scores": {
"action_risk": 0.92,
"data_exfiltration": 0.31,
},
},
}),
json!({
"type": "event_msg",