[#1181] agents-copilotstudio-client: Reduce privacy/security risk from logging full request bodies and activity - #1193
Merged
tracyboehrer (tracyboehrer) merged 6 commits intoAug 14, 2026
Conversation
Copilot started reviewing on behalf of
Cecilia Avila (ceciliaavila)
July 21, 2026 14:36
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces privacy/security risk in @microsoft/agents-copilotstudio-client by pseudonymizing conversation IDs (optionally using a customer-supplied diagnostics key) and redacting sensitive fields before writing diagnostics logs and emitting telemetry/metrics.
Changes:
- Added
diagnosticsPseudonymKeysupport to connection settings (including env loading) and used it to pseudonymize conversation IDs in logs/telemetry. - Introduced
redactDiagnosticObject+pseudonymizeConversationIdutilities in@microsoft/agents-telemetryand applied them across client/webchat logging paths. - Refactored Copilot Studio trace/metric recording to avoid including conversation IDs in metric labels.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| test-agents/copilotstudio-webchat/settings.js | Exposes enableDiagnostics + diagnosticsPseudonymKey in sample webchat agent settings. |
| test-agents/copilotstudio-console/env.TEMPLATE | Documents diagnosticsPseudonymKey for console sample env configuration. |
| packages/agents-telemetry/test/utils/redact.test.ts | Adds unit coverage for diagnostic redaction + conversation ID pseudonymization behavior. |
| packages/agents-telemetry/src/utils/redact.ts | Adds HMAC-based conversation ID pseudonymization and recursive diagnostic redaction helper. |
| packages/agents-telemetry/src/index.mts | Exports new redaction/pseudonymization utilities from the ESM entrypoint. |
| packages/agents-telemetry/src/index.cts | Exports new redaction/pseudonymization utilities from the CJS entrypoint. |
| packages/agents-telemetry/package.json | Adds @noble/hashes dependency required for HMAC pseudonymization. |
| packages/agents-copilotstudio-client/src/powerPlatformEnvironment.ts | Redacts URLs in debug logs for connection URL selection/generation. |
| packages/agents-copilotstudio-client/src/observability/traces.ts | Refactors trace actions/records to accept activity type + pseudonymized conversation ID; removes conversation ID from metric labels. |
| packages/agents-copilotstudio-client/src/copilotStudioWebChat.ts | Uses pseudonymized conversation IDs and redacted diagnostic objects when logging activities/events. |
| packages/agents-copilotstudio-client/src/copilotStudioConnectionSettings.ts | Adds diagnosticsPseudonymKey to the public connection settings interface. |
| packages/agents-copilotstudio-client/src/copilotStudioClient.ts | Applies URL redaction + diagnostic-object redaction and pseudonymized conversation IDs across request/activity/subscribe logs and traces. |
| packages/agents-copilotstudio-client/src/connectionSettings.ts | Adds diagnosticsPseudonymKey to options and env-based settings loading (with redacted settings logging). |
| package-lock.json | Locks @noble/hashes and updates dependency tree accordingly. |
tracyboehrer (tracyboehrer)
enabled auto-merge (squash)
August 13, 2026 15:02
tracyboehrer (tracyboehrer)
previously approved these changes
Aug 13, 2026
# Conflicts: # packages/agents-copilotstudio-client/src/copilotStudioClient.ts # packages/agents-copilotstudio-client/src/copilotStudioWebChat.ts # packages/agents-copilotstudio-client/src/observability/traces.ts
tracyboehrer (tracyboehrer)
approved these changes
Aug 14, 2026
tracyboehrer (tracyboehrer)
deleted the
southworks/fix/logging-privacy-risks
branch
August 14, 2026 16:33
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.
Fixes #1181
Description
This pull request introduces enhanced diagnostics and privacy controls for the Copilot Studio client by adding support for a diagnostics pseudonym key, improving redaction and pseudonymization of sensitive data, and updating observability and logging throughout the codebase. The changes ensure that conversation IDs and other potentially sensitive information are consistently pseudonymized or redacted in logs and telemetry, reducing the risk of exposing user data.
Diagnostics and Privacy Enhancements:
diagnosticsPseudonymKeyproperty toConnectionOptionsand included it in environment-based settings loading (connectionSettings.ts). This key is used to pseudonymize conversation IDs across restarts for stable diagnostics without exposing real identifiers. [1] [2]CopilotStudioClientandCopilotStudioWebChatclasses to use thediagnosticsPseudonymKeyfor pseudonymizing conversation IDs in logs, diagnostics, and telemetry events. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Logging and Redaction Improvements:
redactUrl,redactString,redactDiagnosticObject,pseudonymizeConversationId). [1] [2] [3] [4] [5]Telemetry and Observability Updates:
These changes collectively improve the privacy posture of the Copilot Studio client, while maintaining robust diagnostics and observability for troubleshooting and monitoring.
Testing
This image shows the redacted values and the pseudomyzed conversationId.

And these show the conversationId pseudonym after restarting the server.
