Repository navigation
Add opt-in OTLP logging for Guardian assessments - #47870
Merged
copyberry[bot] merged 1 commit intoSep 24, 2026
Merged
copyberry[bot] merged 1 commit into
copyberry[bot] merged 1 commit into
Conversation
## What changed Add `otel.log_guardian_assessments`, disabled by default and requiring an OTLP HTTP or gRPC log exporter. Emit `codex.guardian_assessment` when a synchronous Guardian review finishes, including review identifiers, status, risk level, user authorization, and rationale. Include `allow` or `deny` outcomes only for completed model assessments, not review errors, timeouts, or cancellations. Cap exported rationales at 64 KiB on a UTF-8 character boundary and record their original byte length and truncation status. Use the log-only route to exclude assessment payloads from trace export, local state logs, and bug-report log buffers. Cached V2 approvals are not included. ## Testing Add coverage for configuration gating, enabled and disabled denial logging, terminal statuses and outcomes, UTF-8 rationale truncation, export routing, and bug-report log buffer exclusion. GitOrigin-RevId: dcbb5b429c8726a5a5c80ff82f9d625e81796ede
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/dcbb5b429c8726a5a5c80ff82f9d625e81796ede
branch
from
September 24, 2026 16:06
e2f1fbd to
30758e5
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/dcbb5b429c8726a5a5c80ff82f9d625e81796ede
branch
September 24, 2026 16:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add opt-in OTLP logging for Guardian assessments
What changed
Add
otel.log_guardian_assessments, disabled by default and requiring an OTLP HTTP or gRPC log exporter. Emitcodex.guardian_assessmentwhen a synchronous Guardian review finishes, including review identifiers, status, risk level, user authorization, and rationale. Includeallowordenyoutcomes only for completed model assessments, not review errors, timeouts, or cancellations.Cap exported rationales at 64 KiB on a UTF-8 character boundary and record their original byte length and truncation status. Use the log-only route to exclude assessment payloads from trace export, local state logs, and bug-report log buffers. Cached V2 approvals are not included.
Testing
Add coverage for configuration gating, enabled and disabled denial logging, terminal statuses and outcomes, UTF-8 rationale truncation, export routing, and bug-report log buffer exclusion.