File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 33import asyncio
44import copy
55import inspect
6+ import os
67from dataclasses import dataclass , field
78from typing import Any , Generic , cast
89
@@ -81,6 +82,12 @@ def get_default_agent_runner() -> AgentRunner:
8182 return DEFAULT_AGENT_RUNNER
8283
8384
85+ def _default_trace_include_sensitive_data () -> bool :
86+ """Returns the default value for trace_include_sensitive_data based on environment variable."""
87+ val = os .getenv ("OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA" , "true" )
88+ return val .strip ().lower () in ("1" , "true" , "yes" , "on" )
89+
90+
8491@dataclass
8592class RunConfig :
8693 """Configures settings for the entire agent run."""
@@ -114,7 +121,9 @@ class RunConfig:
114121 """Whether tracing is disabled for the agent run. If disabled, we will not trace the agent run.
115122 """
116123
117- trace_include_sensitive_data : bool = True
124+ trace_include_sensitive_data : bool = field (
125+ default_factory = _default_trace_include_sensitive_data
126+ )
118127 """Whether we include potentially sensitive data (for example: inputs/outputs of tool calls or
119128 LLM generations) in traces. If False, we'll still create spans for these events, but the
120129 sensitive data will not be included.
You can’t perform that action at this time.
0 commit comments