Skip to content

🔒 Fix: Redact sensitive LlmConfig fields in logs#58

Merged
myaple merged 1 commit intomasterfrom
fix-llm-config-logging-10474778031711846422
Feb 11, 2026
Merged

🔒 Fix: Redact sensitive LlmConfig fields in logs#58
myaple merged 1 commit intomasterfrom
fix-llm-config-logging-10474778031711846422

Conversation

@myaple
Copy link
Copy Markdown
Owner

@myaple myaple commented Feb 11, 2026

This PR fixes a security vulnerability where LlmConfig was being logged using debug!, potentially exposing sensitive information like API keys.

Although LlmConfig currently has a manual Debug implementation 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 the Debug implementation of LlmConfig is modified or removed in the future (e.g., reverting to derive(Debug)), the secrets will not be leaked in this log statement.

Testing:

  • Verified that existing tests pass (cargo test).
  • Verified that the LlmClient::new function works correctly with the change.

PR created automatically by Jules for task 10474778031711846422 started by @myaple

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>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@myaple myaple merged commit 09ad5fd into master Feb 11, 2026
2 checks passed
@myaple myaple deleted the fix-llm-config-logging-10474778031711846422 branch February 11, 2026 20:33
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