Skip to content

Feature: Make trace_include_sensitive_data configurable via environment variable #1192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Kunmeer-SyedMohamedHyder
Copy link

@Kunmeer-SyedMohamedHyder Kunmeer-SyedMohamedHyder commented Jul 19, 2025

Description:

This PR adds support for configuring trace_include_sensitive_data in RunConfig 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 into RunConfig. 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, and no (case-insensitive).

Fixes: #1183

Behavior Summary:

  • If trace_include_sensitive_data is passed explicitly, that value is used.
  • Otherwise, the value defaults based on the OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA environment variable.
  • If the environment variable is not set, it falls back to True (preserving current behavior).

Example usage:

export OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA=false
config = RunConfig()  # trace_include_sensitive_data will be False

config = RunConfig(trace_include_sensitive_data=True)  # Explicit override, will be True

@Kunmeer-SyedMohamedHyder Kunmeer-SyedMohamedHyder changed the title Feature: Load trace_include_sensitive_data from an environment variable Feature: Make trace_include_sensitive_data configurable via environment variable Jul 19, 2025
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.

2 participants