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
This commit is contained in:
viyatb-oai
2026-08-15 19:29:39 +00:00
committed by copyberry
parent 6efcdad4c3
commit 899d1715c8
2 changed files with 2 additions and 1 deletions

View File

@@ -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,

View File

@@ -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",