Skip to content

Conversation

@OpenSourceSoul
Copy link

Problem

By default, was set to , which meant sensitive data (tool inputs/outputs, LLM generations) was automatically included in traces without explicit user consent. This violates the security principle of "secure by default" and could lead to:

  • Accidental data leakage of PII, secrets, or confidential information in production traces
  • Compliance violations for organizations with strict data handling requirements
  • Security incidents where developers unknowingly expose sensitive data

Changes

This PR makes the SDK secure-by-default by changing the default value from to :

  1. src/agents/run_config.py: Changed environment variable default from to
  2. src/agents/voice/pipeline_config.py: Changed default from to with improved documentation
  3. tests/test_run_config.py: Updated test expectations to reflect new secure-by-default behavior

Impact

  • Breaking change: Users relying on the old default will need to explicitly opt-in by setting or passing to their config
  • Security improvement: Prevents accidental exposure of sensitive data in production deployments
  • Total diff: ~15 lines changed (well within the 10-100 line limit)

Migration for existing users

Users who want to maintain the previous behavior can:

This change aligns with security best practices and protects users from unintentional data exposure.

By default, trace_include_sensitive_data was set to True, which meant
sensitive data (tool inputs/outputs, LLM generations) was included in
traces without explicit user consent. This is a security risk as it could
lead to accidental data leakage of PII, secrets, or confidential info.

This change makes the SDK secure-by-default:
- Changed OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA env default from 'true' to 'false'
- Changed VoicePipelineConfig.trace_include_sensitive_data default from True to False
- Updated tests to reflect new secure-by-default behavior

Users can still opt-in to include sensitive data by:
1. Setting OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA=true environment variable
2. Explicitly passing trace_include_sensitive_data=True to RunConfig or VoicePipelineConfig

Security impact: Prevents accidental exposure of sensitive data in production deployments.
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