Feature: Make trace_include_sensitive_data configurable via environment variable #1192
+62
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR adds support for configuring
trace_include_sensitive_data
inRunConfig
using an environment variable:OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA
.Previously, this field always defaulted to
True
, and there was no way to control it without explicitly passing it intoRunConfig
. With this change, if the field is not set explicitly, its value will be pulled from the environment. This provides more flexibility, especially in environments where trace sensitivity and data privacy are important.The environment variable supports common boolean values like
true
,false
,1
,0
,yes
, andno
(case-insensitive).Fixes: #1183
Behavior Summary:
trace_include_sensitive_data
is passed explicitly, that value is used.OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA
environment variable.True
(preserving current behavior).Example usage:
export OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA=false