Problem
The LLM's model_validator writes API keys and base URLs directly into os.environ. In a multi-tenant server where different conversations may use different LLM providers/keys, one conversation's credentials are visible to all others via the process environment. Combined with the modify_params race (#4 in tracking issue), a conversation could inadvertently use another tenant's credentials.
Location: llm/llm.py model_validator
Evidence
Code review of llm.py model_validator. Environment variables are the mechanism for passing credentials to litellm.
Severity: Critical
Impact of fix
Tenant isolation for credentials in multi-conversation servers.
Suggested fix
Pass credentials through litellm's function arguments or per-call configuration instead of os.environ. Medium effort (requires understanding litellm's credential passing API).
Related issues and PRs
Discovered during profiling investigation (code review), May 2026. openhands-sdk v1.19.1.
Problem
The LLM's
model_validatorwrites API keys and base URLs directly intoos.environ. In a multi-tenant server where different conversations may use different LLM providers/keys, one conversation's credentials are visible to all others via the process environment. Combined with themodify_paramsrace (#4 in tracking issue), a conversation could inadvertently use another tenant's credentials.Location:
llm/llm.pymodel_validatorEvidence
Code review of
llm.pymodel_validator. Environment variables are the mechanism for passing credentials to litellm.Severity: Critical
Impact of fix
Tenant isolation for credentials in multi-conversation servers.
Suggested fix
Pass credentials through litellm's function arguments or per-call configuration instead of
os.environ. Medium effort (requires understanding litellm's credential passing API).Related issues and PRs
Discovered during profiling investigation (code review), May 2026. openhands-sdk v1.19.1.