.NET: Update AIContextProviders to use Microsoft.Extensions.Compliance.Redaction#4854
Open
westey-m wants to merge 4 commits intomicrosoft:mainfrom
Open
.NET: Update AIContextProviders to use Microsoft.Extensions.Compliance.Redaction#4854westey-m wants to merge 4 commits intomicrosoft:mainfrom
westey-m wants to merge 4 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates .NET AI context providers’ logging redaction to use Microsoft.Extensions.Compliance.Redaction.Redactor, allowing callers to supply a custom redactor while keeping an explicit EnableSensitiveTelemetryData override for unredacted logs.
Changes:
- Add
Redactor+EnableSensitiveTelemetryDataoptions to multiple providers and route log payloads through the configured redactor. - Introduce a shared internal
ReplacingRedactor(default placeholder"<redacted>") and MSBuild injection support (InjectSharedRedaction). - Expand unit tests to validate default vs custom redaction behavior and precedence rules.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI/Memory/ChatHistoryMemoryProviderOptions.cs | Adds Redactor option + precedence remarks. |
| dotnet/src/Microsoft.Agents.AI/Memory/ChatHistoryMemoryProvider.cs | Switches sanitization to a Redactor instance (default placeholder or caller-provided). |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/Memory/ChatHistoryMemoryProviderTests.cs | Updates tests for default/custom redaction and precedence. |
| dotnet/src/Microsoft.Agents.AI/TextSearchProviderOptions.cs | Adds EnableSensitiveTelemetryData and Redactor options. |
| dotnet/src/Microsoft.Agents.AI/TextSearchProvider.cs | Applies redaction to trace log payloads via a Redactor. |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/Data/TextSearchProviderTests.cs | Adds test coverage for redaction behavior. |
| dotnet/src/Microsoft.Agents.AI.Mem0/Mem0ProviderOptions.cs | Adds Redactor option + precedence remarks. |
| dotnet/src/Microsoft.Agents.AI.Mem0/Mem0Provider.cs | Switches sanitization to Redactor instance. |
| dotnet/tests/Microsoft.Agents.AI.Mem0.UnitTests/Mem0ProviderTests.cs | Updates tests for default/custom redaction and precedence. |
| dotnet/src/Microsoft.Agents.AI.FoundryMemory/FoundryMemoryProviderOptions.cs | Adds Redactor option + precedence remarks. |
| dotnet/src/Microsoft.Agents.AI.FoundryMemory/FoundryMemoryProvider.cs | Switches sanitization to Redactor instance. |
| dotnet/src/Shared/Redaction/ReplacingRedactor.cs | Adds shared internal placeholder redactor implementation. |
| dotnet/src/Shared/Redaction/README.md | Documents shared redaction injection and package dependency. |
| dotnet/eng/MSBuild/Shared.props | Adds InjectSharedRedaction injection hook. |
| dotnet/src/Microsoft.Agents.AI/Microsoft.Agents.AI.csproj | Enables shared redaction injection + adds compliance abstractions package reference. |
| dotnet/src/Microsoft.Agents.AI.Mem0/Microsoft.Agents.AI.Mem0.csproj | Enables shared redaction injection + adds compliance abstractions package reference. |
| dotnet/src/Microsoft.Agents.AI.FoundryMemory/Microsoft.Agents.AI.FoundryMemory.csproj | Enables shared redaction injection + adds compliance abstractions package reference. |
| dotnet/Directory.Packages.props | Pins Microsoft.Extensions.Compliance.Abstractions version. |
| dotnet/agent-framework-dotnet.slnx | Adds shared redaction files as solution items. |
dotnet/tests/Microsoft.Agents.AI.Mem0.UnitTests/Mem0ProviderTests.cs
Outdated
Show resolved
Hide resolved
dotnet/tests/Microsoft.Agents.AI.UnitTests/Memory/ChatHistoryMemoryProviderTests.cs
Outdated
Show resolved
Hide resolved
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.
Motivation and Context
Addressing SDK review feedback.
#2375
Description
Contribution Checklist