From 899d1715c87a504ce4c9ec85c2fd7753e33a7be4 Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Sat, 15 Aug 2026 19:29:39 +0000 Subject: [PATCH] Route executor policy audits through log-only telemetry (#38800) ## Why Forwarded network policy decisions are audit telemetry and should not be written to the persistent state log. ## What changed - Emit forwarded `codex.network_proxy.policy_decision` events on the `codex_otel.log_only` target, keeping them available to OTEL log export while excluding them from persistent logs. - Assert the log-only target in the existing trusted-metadata audit test. GitOrigin-RevId: 16d07c8f390245036e4fa092a876012ef2b2fdba --- codex-rs/exec-server/src/client/network_policy_audit.rs | 2 +- codex-rs/exec-server/src/client/tests/network_policy_tests.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/codex-rs/exec-server/src/client/network_policy_audit.rs b/codex-rs/exec-server/src/client/network_policy_audit.rs index deaaf8eaf8..b16249a9b9 100644 --- a/codex-rs/exec-server/src/client/network_policy_audit.rs +++ b/codex-rs/exec-server/src/client/network_policy_audit.rs @@ -52,7 +52,7 @@ pub(super) fn emit_network_policy_decision( }; let metadata = &context.metadata; tracing::event!( - target: "codex_otel.network_proxy", + target: "codex_otel.log_only", tracing::Level::INFO, event.name = "codex.network_proxy.policy_decision", event.timestamp = decision.timestamp, diff --git a/codex-rs/exec-server/src/client/tests/network_policy_tests.rs b/codex-rs/exec-server/src/client/tests/network_policy_tests.rs index 008fa4440f..4721527fa1 100644 --- a/codex-rs/exec-server/src/client/tests/network_policy_tests.rs +++ b/codex-rs/exec-server/src/client/tests/network_policy_tests.rs @@ -177,6 +177,7 @@ async fn policy_decisions_reject_forged_process_and_use_trusted_controller_metad .expect("audit log should be UTF-8"); assert!(!output.contains("forged.example")); for expected in [ + "codex_otel.log_only", "trusted-conversation", "trusted-account", "trusted-execution",