Skip to content

Redact credentials before trace and eval uploads - #882

Open
xeophon wants to merge 48 commits into
mainfrom
release/trace-upload-preflight
Open

Redact credentials before trace and eval uploads#882
xeophon wants to merge 48 commits into
mainfrom
release/trace-upload-preflight

Conversation

@xeophon

@xeophon xeophon commented Aug 31, 2026

Copy link
Copy Markdown
Member

Overview

Centralizes outbound evaluation and trace upload safety in prime-evals so Prime CLI and external uploaders share credential reduction and one fail-closed evaluation upload workflow.

Details

  • discovers configured, environment, structured, provider-shaped, authorization, connection-string, cookie, and transport credentials
  • exposes named secret sources and non-plaintext secret fingerprints through the public prime-evals API
  • reduces generated upload copies and rescans them before any network client opens
  • batches samples by exact serialized UTF-8 JSON size and rejects oversized samples before creating an evaluation
  • owns configuration, environment resolution, evaluation creation, sample upload, finalization, retries, and client cleanup
  • preserves local traces, reference answers, rubrics, team identifiers, and token telemetry
  • snapshots JSONL without changing the source and rejects malformed or ambiguous input
  • publishes prime-evals 0.2.4 as the shared upload-security owner

Release order

Publish prime-evals 0.2.4 before merging the companion Verifiers change in PrimeIntellect-ai/verifiers#2475.


Note

High Risk
Changes security-sensitive upload paths and redaction heuristics; mis-redaction could leak secrets or strip review data, and stricter sample sizing can break callers that relied on silent skips.

Overview
prime-evals 0.2.4 adds a shared upload preflight layer that scans and redacts credentials in outbound payloads before any HTTP upload, and wires Prime CLI eval/trace commands through it.

The new preflight module exposes prepare_upload, prepare_jsonl_upload, scan_upload, and secret_values (env, API key, optional --secrets-file, pattern/structured-field discovery). Upload copies are reduced to [REDACTED], rescanned fail-closed, and local source files stay unchanged; JSONL uploads snapshot/redact via temp paths with strict validation (UTF-8, duplicate keys, no output aliasing).

Evals client behavior changes: push_samples / async paths run preflight on samples, batch by exact serialized UTF-8 JSON size (serialize_json), and reject oversized samples with InvalidSampleError instead of skipping with warnings. New push_evaluation creates, uploads, and finalizes in one call with the same preflight. HTTP clients gain optional injected Config, context managers, and frontend_url config.

CLI: prime eval push and automatic hub push preflight all outbound fields; prime traces upload stages a safe copy through prepare_jsonl_upload before the traces client runs. Both support --secrets-file.

Reviewed by Cursor Bugbot for commit 59310b1. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T13:03:10.734214Z 59310b1 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03e1947d1e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4adb2146f5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated
Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 31f49ec735

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated
Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9306f16f05

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/evals.py
Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated
Comment thread packages/prime-evals/src/prime_evals/preflight.py
Comment thread packages/prime-evals/src/prime_evals/preflight.py
Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated
Comment thread packages/prime-evals/src/prime_evals/evals.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d12ebb233c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated
Comment thread packages/prime-evals/src/prime_evals/preflight.py
Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f2d2a51f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb3c1f7f64

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated
Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80d35b2b9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated
Comment thread packages/prime-evals/src/prime_evals/evals.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eca2b557c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5146a77eb9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py
Comment thread packages/prime-evals/src/prime_evals/preflight.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9bdf0498df

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated
Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated
Comment thread packages/prime-evals/src/prime_evals/preflight.py
Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated
Comment thread packages/prime-evals/src/prime_evals/preflight.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0cf9744be5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated
Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b2a36fe. Configure here.

Comment thread packages/prime-evals/src/prime_evals/preflight.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2a36feabb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 921f7c34de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/prime-evals/src/prime_evals/preflight.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59310b1c8f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +198 to +201
r"(?:x-api-key|api[_ -]?(?:key|token)|account[_ -]?key|"
r"access[_ -]?token|refresh[_ -]?token|auth[_ -]?token|auth|session[_ -]?token|"
r"client[_ -]?secret|secret[_ -]?access[_ -]?key|secret[_ -]?key|password|passwd|"
r"cookie|credentials?|private[_ -]?key|sas[_ -]?token|signature))\b"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Match connection-string credential assignments

Include sensitive connection fields such as connection_string, database_url, and redis_url in the assignment matchers. For unstructured trace text like CONNECTION_STRING=opaque-database-secret-0123456789, none of these alternatives matches, and there is no structured-field traversal to compensate; the residual scan repeats the same omission, so the credential is uploaded unchanged.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant