Skip to content

feat: customize output guardrail blocked messages - #4594

Merged
seratch merged 1 commit into
mainfrom
feat/customize-output-guardrail-blocked-message
Aug 22, 2026
Merged

seratch merged 1 commit into
mainfrom
feat/customize-output-guardrail-blocked-message

Conversation

@seratch

@seratch seratch commented Aug 22, 2026

Copy link
Copy Markdown
Member

This pull request adds configurable, data-free placeholder messages for terminal tool output rejected by an output guardrail.

RunConfig.output_guardrail_blocked_message accepts either a non-empty fixed string or a synchronous formatter receiving the default message, guardrail name, current agent, and run context. This allows applications to localize or otherwise adjust the retained message based on context.

The selected placeholder is applied consistently to the caller-visible tripwire, Session history, serialized RunState, streamed results, tool-output guardrail metadata, and subsequent model replay. Formatter failures and invalid return values fail closed to the existing SDK default, and rejected output or guardrail output_info is never passed to the formatter.

Async formatters are intentionally rejected. Awaiting application code between the terminal tripwire and retained-owner redaction can leave rejected output reachable through cancellation traceback locals or partially sanitized state, so async support requires a redesign of that redaction boundary rather than simply awaiting the formatter result.

@seratch seratch added this to the 0.22.x milestone Aug 22, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 22, 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-08-22T22:44:09.374389Z 7437200 PR opened
🔒 Security Review ✅ Completed 2026-08-22T22:44:32.048920Z 7437200 PR opened
ℹ️ 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.

@seratch
seratch merged commit 89fab0f into main Aug 22, 2026
17 checks passed
@seratch
seratch deleted the feat/customize-output-guardrail-blocked-message branch August 22, 2026 23:45
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.

1 participant