fix: sanitize error logs#125
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR systematically removes detailed error information from logging statements across the codebase to prevent sensitive data exposure in logs. The changes focus on sanitizing error logs while maintaining error details where they are returned to error handlers or included in error responses.
Key changes:
- Replace
map_err(|e| { tracing::error!("message: {}", e); e })withinspect_err(|_| { tracing::error!("message") }) - Remove error details from logging statements while preserving them in returned error values
- Convert unused error bindings from
Err(e)toErr(_)where error details are no longer logged
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/services/src/responses/mod.rs | Sanitized error logs in response service by removing error details from tracing statements |
| crates/services/src/mcp/manager.rs | Removed detailed error logging when connecting to MCP servers |
| crates/services/src/inference_provider_pool/mod.rs | Made detailed_error_msg unused and removed it from error logging |
| crates/services/src/completions/mod.rs | Sanitized error logs in completion service for attestation and usage recording |
| crates/services/src/auth/mod.rs | Removed error details from logs when creating default org/workspace for new users |
| crates/services/src/attestation/mod.rs | Sanitized error logs in attestation service |
| crates/database/src/repositories/mcp_connector.rs | Changed SQL error logging from error to debug level |
| crates/database/src/patroni_discovery.rs | Removed error details from cluster state refresh logging |
| crates/database/src/cluster_manager.rs | Removed error details from cluster management logging |
| crates/api/src/routes/*.rs | Sanitized error logs across all API routes (workspaces, users, usage, responses, organizations, etc.) |
| crates/api/src/middleware/*.rs | Sanitized error logs in authentication, authorization, and usage middleware |
| crates/api/src/lib.rs | Removed error details from OAuth manager and model discovery initialization logs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Evrard-Nil
approved these changes
Oct 31, 2025
think-in-universe
approved these changes
Oct 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed potential information leakage code from the error log