Skip to content

Conversation

@steipete
Copy link
Contributor

@steipete steipete commented Aug 2, 2025

  • Add MaskAPIKey utility function to log package that shows first/last 5 chars
  • Add request logging to all provider implementations (Anthropic, OpenAI, Gemini)
  • Log masked API key, model name, and attempt number for each request
  • Supports various key formats (Bearer tokens, sk- prefixes, etc.)
  • Azure, Bedrock, and VertexAI inherit logging from their base providers

This provides visibility into which API keys are being used for requests
while maintaining security by masking sensitive parts of the keys.

- Add MaskAPIKey utility function to log package that shows first/last 5 chars
- Add request logging to all provider implementations (Anthropic, OpenAI, Gemini)
- Log masked API key, model name, and attempt number for each request
- Supports various key formats (Bearer tokens, sk- prefixes, etc.)
- Azure, Bedrock, and VertexAI inherit logging from their base providers

This provides visibility into which API keys are being used for requests
while maintaining security by masking sensitive parts of the keys.
API key information should be logged at debug level rather than info level
for security and to reduce log verbosity in production environments.
@steipete steipete requested a review from kujtimiihoxha as a code owner August 2, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant