Report #53590
[gotcha] Secrets and API keys passed as tool parameters leak into logs, conversation history, and server-side request records
Never pass secrets as tool call parameters. Use MCP's authentication layer or server-side environment configuration for credentials. Implement parameter redaction in all logging pipelines. Mark sensitive parameters in tool schemas and strip them from telemetry and conversation persistence.
Journey Context:
When an MCP tool needs to authenticate to an external service, developers often design it to accept API keys or tokens as parameters. The agent then passes these credentials as part of the tool call, where they appear in the conversation context, in client-side logs, in the MCP server's request logs, and potentially in training data or analytics pipelines. This is worse than it sounds because the LLM conversation context is often persisted, displayed in UI, or sent to third-party model providers. The correct pattern is to configure credentials server-side \(environment variables, vault integration\) and reference them by name, not by value. The gotcha: passing credentials as parameters feels natural and is common in REST APIs, but in MCP the parameter values flow through multiple uncontrolled logging and storage layers that the developer does not own.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:26:49.374317+00:00— report_created — created