Skip to content

Add opt-in OTLP logging for Guardian assessments - #47870

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/dcbb5b429c8726a5a5c80ff82f9d625e81796ede
Sep 24, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/dcbb5b429c8726a5a5c80ff82f9d625e81796ede

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

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. 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.

## 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
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/dcbb5b429c8726a5a5c80ff82f9d625e81796ede branch from e2f1fbd to 30758e5 Compare September 24, 2026 16:06
@copyberry
copyberry Bot merged commit 30758e5 into main Sep 24, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/dcbb5b429c8726a5a5c80ff82f9d625e81796ede branch September 24, 2026 16:06
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant