openai / openai/openai-agents-python

Change trace_include_sensitive_data defaults to True in future releases

Open
#2,393 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature:core feature:tracing
Dominant language
Python
Stars
29.6k
Forks
4.8k
Avg merge
1d 20h
Merged PRs (30d)
123

Description

Problem Description

The current default configuration for is set to , which means that by default, sensitive data such as tool inputs/outputs and LLM generations are automatically included in traces without requiring explicit user consent.

Security Risk

This default behavior violates the "secure by default" principle and poses several security risks:

  1. Accidental Data Leakage: Users may unknowingly expose Personally Identifiable Information (PII), secrets, or confidential business data in traces
  2. Compliance Violations: Organizations with strict data handling requirements (GDPR, HIPAA, SOC 2) may inadvertently violate compliance by exposing sensitive data
  3. Production Security Incidents: Developers might accidentally log sensitive production data without realizing it, leading to potential security breaches

Proposed Solution

Change the default value of from to to make the SDK secure-by-default.

Implementation

A Pull Request has already been created with the fix:

PR Link: https://github.com/openai/openai-agents-python/pull/2392

Changes in the PR:
  • Changed environment variable default from "true" to "false" in
  • Changed default from to in
  • Updated tests to reflect the new secure-by-default behavior in
Migration for Users

Users who want to maintain the previous behavior (including sensitive data in traces) can:

Why This Matters

  • Security Best Practices: Follows the principle of least privilege and secure-by-default
  • Production Safety: Prevents accidental data exposure in production environments
  • Compliance: Helps organizations meet data protection requirements
  • Developer Experience: Forces explicit opt-in for sensitive data handling, making developers aware of the security implications

The fix is minimal (~15 lines changed) but has significant security impact for all users of the SDK.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing pull request #2392 and the tests it updates, since the proposed fix is already under way. Verify that the environment-variable and SDK defaults are secure by default and that the tests cover explicit opt-in for sensitive trace data.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, observability-sre, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.