Skip to content

fix: redact JSON validation errors - #4211

Open
seratch wants to merge 3 commits into
mainfrom
fix/model-json-validation-redaction
Open

fix: redact JSON validation errors#4211
seratch wants to merge 3 commits into
mainfrom
fix/model-json-validation-redaction

Conversation

@seratch

@seratch seratch commented Aug 5, 2026

Copy link
Copy Markdown
Member

This pull request fixes issue #4207 by redacting model-generated JSON validation failures according to the applicable model and tool data logging policies. Structured outputs use the model-data policy, while normal and Realtime handoffs require both model and tool data disclosure to be enabled before detailed diagnostics are retained.

It also removes sensitive payloads from exception chains and SDK traceback frames across Runner and Realtime synchronous, asynchronous, and shutdown paths, and ensures tracing failures cannot replace the safe redacted error.

This pull request resolves #4207.

@seratch seratch added this to the 0.20.x milestone Aug 5, 2026

@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: ab134a0d6d

ℹ️ 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 src/agents/run.py Outdated
Comment thread src/agents/run_internal/run_loop.py Outdated
Comment thread src/agents/run.py Outdated
Comment thread src/agents/run_internal/run_loop.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: 5af632d742

ℹ️ 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 src/agents/run.py
Comment thread src/agents/run_internal/turn_resolution.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: 19c596ab7e

ℹ️ 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".

message_item = (
create_message_output_item(
public_agent,
format_final_output_text(public_agent, final_output),

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 Suppress fallback serialization warnings in redacted mode

When an invalid_final_output handler returns a fallback accepted by a permissive schema such as a Pydantic SkipValidation field and include_in_history remains true, the initial validation serialization suppresses warnings via data_redacted, but this second serialization calls format_final_output_text() with the default warnings="warn". Pydantic serializer warnings include the unexpected fallback value's representation, so a handler-derived model payload can still be written to stderr while DONT_LOG_MODEL_DATA is enabled; propagate the redaction policy into this formatting step as well.

AGENTS.md reference: AGENTS.md:L95-L95

Useful? React with 👍 / 👎.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model output leaks into JSON validation errors despite DONT_LOG_MODEL_DATA

1 participant