🔒 Fix: Redact sensitive LlmConfig fields in logs#58
Conversation
Redacts sensitive information (API key) from LlmConfig before logging it in src/llm.rs. This provides a defense-in-depth measure to ensure secrets are never leaked, even if the LlmConfig Debug implementation is changed in the future. - Clones the config object before logging - Manually sets the api_key field to "REDACTED" if present - Logs the redacted clone instead of the original config Co-authored-by: myaple <10523487+myaple@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR fixes a security vulnerability where
LlmConfigwas being logged usingdebug!, potentially exposing sensitive information like API keys.Although
LlmConfigcurrently has a manualDebugimplementation that redacts the API key, this PR adds an extra layer of security by explicitly creating a redacted clone of the configuration before logging it. This ensures that even if theDebugimplementation ofLlmConfigis modified or removed in the future (e.g., reverting toderive(Debug)), the secrets will not be leaked in this log statement.Testing:
cargo test).LlmClient::newfunction works correctly with the change.PR created automatically by Jules for task 10474778031711846422 started by @myaple