Download codex-rs/analytics/src/guardian_v2.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.43 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/analytics/src/guardian_v2.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/analytics/src/guardian_v2.rs
-
curl -L -o guardian_v2.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/analytics/src/guardian_v2.rs
1.43 kB
| //! Guardian V2 classifier and fast-decision facts, enriched by the existing reducer. | |
| //! Payloads contain attribution and bounded outcomes, never prompts or tool arguments. | |
| use crate::events::CodexAppServerClientMetadata; | |
| use crate::events::CodexRuntimeMetadata; | |
| use codex_protocol::protocol::ThreadSource; | |
| use serde::Serialize; | |
| pub struct GuardianV2Event { | |
| pub thread_id: String, | |
| pub turn_id: String, | |
| pub item_id: Option<String>, | |
| pub model: Option<String>, | |
| pub occurred_at_ms: u64, | |
| pub kind: GuardianV2EventKind, | |
| } | |
| pub enum GuardianV2EventKind { | |
| Classification { | |
| outcome: &'static str, | |
| risk_level: Option<&'static str>, | |
| duration_ms: u64, | |
| }, | |
| FastDecision { | |
| decision: &'static str, | |
| }, | |
| } | |
| pub(crate) struct GuardianV2EventRequest { | |
| pub(crate) event_type: &'static str, | |
| pub(crate) event_params: GuardianV2EventParams, | |
| } | |
| pub(crate) struct GuardianV2EventParams { | |
| pub(crate) session_id: String, | |
| pub(crate) app_server_client: CodexAppServerClientMetadata, | |
| pub(crate) runtime: CodexRuntimeMetadata, | |
| pub(crate) thread_source: Option<ThreadSource>, | |
| pub(crate) subagent_source: Option<String>, | |
| pub(crate) parent_thread_id: Option<String>, | |
| pub(crate) guardian_v2: GuardianV2Event, | |
| } | |