From 5a8ba73e113cdd7020b442edf28c23f708c7a746 Mon Sep 17 00:00:00 2001 From: SN <6432132+samnoyes@users.noreply.github.com> Date: Thu, 18 Jan 2024 13:05:23 -0800 Subject: [PATCH] exclude secrets and tokens --- python/langsmith/env/_runtime_env.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/langsmith/env/_runtime_env.py b/python/langsmith/env/_runtime_env.py index e206bb22b..745fa4495 100644 --- a/python/langsmith/env/_runtime_env.py +++ b/python/langsmith/env/_runtime_env.py @@ -167,7 +167,11 @@ def get_langchain_env_var_metadata() -> dict: langchain_metadata = { k: v for k, v in os.environ.items() - if k.startswith("LANGCHAIN_") and k not in excluded and "key" not in k.lower() + if k.startswith("LANGCHAIN_") + and k not in excluded + and "key" not in k.lower() + and "secret" not in k.lower() + and "token" not in k.lower() } env_revision_id = langchain_metadata.pop("LANGCHAIN_REVISION_ID", None) if env_revision_id: