Skip to content

[codex-analytics] guardian review analytics schema polishing#17692

Merged
rhan-oai merged 1 commit intomainfrom
pr17692
Apr 20, 2026
Merged

[codex-analytics] guardian review analytics schema polishing#17692
rhan-oai merged 1 commit intomainfrom
pr17692

Conversation

@rhan-oai
Copy link
Copy Markdown
Collaborator

@rhan-oai rhan-oai commented Apr 13, 2026

Why

Guardian review analytics needs a Rust event shape that matches the backend schema while avoiding unnecessary PII exposure from reviewed tool calls. This PR narrows the analytics payload to the fields we intend to emit and keeps shared Guardian assessment enums in protocol instead of duplicating equivalent analytics-only enums.

What changed

  • Uses protocol Guardian enums directly for risk_level, user_authorization, outcome, and command source values.
  • Removes high-risk reviewed-action fields from the analytics payload, including raw commands, display strings, working directories, file paths, network targets/hosts, justification text, retry reason, and rationale text.
  • Makes target_item_id and tool_call_count nullable so the Codex event can represent cases where the app-server protocol or producer does not have those values.
  • Keeps lower-risk structured reviewed-action metadata such as sandbox permissions, permission profile, tty, execve source/program, network protocol/port, and MCP connector/tool labels.
  • Adds an analytics reducer/client test covering codex_guardian_review serialization with an optional target_item_id and absent removed fields.

Verification

  • cargo test -p codex-analytics guardian_review_event_ingests_custom_fact_with_optional_target_item
  • cargo fmt --check

Stack created with Sapling. Best reviewed with ReviewStack.

@rhan-oai rhan-oai marked this pull request as ready for review April 17, 2026 20:58
@rhan-oai rhan-oai requested a review from dylan-hurd-oai April 17, 2026 23:05
@rhan-oai rhan-oai merged commit 7f53e47 into main Apr 20, 2026
47 of 61 checks passed
@rhan-oai rhan-oai deleted the pr17692 branch April 20, 2026 20:08
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 20, 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.

2 participants