Removing sensitive info logging - #530
Merged
Rodrigo Brandão (rodrigobr-msft) merged 1 commit intoAug 7, 2026
Merged
Conversation
Copilot started reviewing on behalf of
Rodrigo Brandão (rodrigobr-msft)
August 7, 2026 18:11
View session
Rodrigo Brandão (rodrigobr-msft)
marked this pull request as ready for review
August 7, 2026 18:13
Rodrigo Brandão (rodrigobr-msft)
requested a review
from a team
as a code owner
August 7, 2026 18:13
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates logging in the MSAL on-behalf-of token acquisition path and the hosting-core OAuth flow to avoid emitting potentially sensitive token contents into logs, improving security/privacy in the authentication pipeline.
Changes:
- Remove logging of full
TokenResponseobjects in the OAuth flow (get_user_token,continue_flow). - Remove logging of the
user_assertionvalue when MSAL OBO token acquisition fails.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/_oauth/_oauth_flow.py | Makes success logs more generic by not logging the full token response object. |
| libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/msal_auth.py | Removes user_assertion from the OBO failure log message to prevent sensitive data exposure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tracyboehrer (tracyboehrer)
approved these changes
Aug 7, 2026
Rodrigo Brandão (rodrigobr-msft)
deleted the
users/robrandao/sensitive-logs
branch
August 7, 2026 18:19
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.
This pull request makes improvements to logging messages in the authentication and OAuth flow code. The main changes focus on removing sensitive information from logs and making the log messages more generic to enhance security and privacy.
Logging improvements:
msal_auth.py: Updated the error log inacquire_token_on_behalf_ofto remove the user assertion from the message, reducing potential exposure of sensitive data._oauth_flow.py:get_user_tokento avoid logging the entire token response, which may contain sensitive information.continue_flowto no longer include the fullTokenResponseobject, further protecting sensitive details.