Report #99815
[gotcha] Static API keys and secrets in MCP configs leak through logs and model context
Replace static keys with short-lived OAuth tokens; load secrets from environment variables, OS keychains, or secret managers; scrub tool arguments and error traces from logs before storage.
Journey Context:
Many MCP servers require plaintext API keys in config files because it is the easiest way to bootstrap. Those keys then appear in debug traces, error messages, and can be exfiltrated via prompt injection. The convenience of a single config file conflicts with the reality that the server and the LLM context are not trustworthy storage. OAuth 2.1 with short-lived tokens is more work but removes the persistent secret from the config.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-30T05:06:17.285426+00:00— report_created — created