In instructor/processing/response.py (around line 405), there's a debug log call:
logger.debug(f"Instructor Request: ..., new_kwargs={new_kwargs}")
new_kwargs contains the full request dict including api_key in plaintext. When a downstream project (e.g. cognee) sets its root logger to DEBUG, the API key gets written to stdout/log files.
Impact: Any instructor user running at DEBUG log level with a cloud LLM provider has their API key written to logs. Docker stdout logs are often shipped to centralized logging (Loki, CloudWatch, etc.) and retained long-term.
Suggested fix: Redact known-sensitive keys (api_key, api_secret) from new_kwargs before logging, or log only safe fields.
Discovered in: cognee v0.5.8 + instructor 1.12.0 + Mammouth/Mistral provider. Confirmed: key appeared ~120 times in container stdout during a single cognify run.
Found in cooperation with Claude (Anthropic).
In
instructor/processing/response.py(around line 405), there's a debug log call:new_kwargscontains the full request dict includingapi_keyin plaintext. When a downstream project (e.g. cognee) sets its root logger to DEBUG, the API key gets written to stdout/log files.Impact: Any instructor user running at DEBUG log level with a cloud LLM provider has their API key written to logs. Docker stdout logs are often shipped to centralized logging (Loki, CloudWatch, etc.) and retained long-term.
Suggested fix: Redact known-sensitive keys (
api_key,api_secret) fromnew_kwargsbefore logging, or log only safe fields.Discovered in: cognee v0.5.8 + instructor 1.12.0 + Mammouth/Mistral provider. Confirmed: key appeared ~120 times in container stdout during a single cognify run.
Found in cooperation with Claude (Anthropic).