-
Notifications
You must be signed in to change notification settings - Fork 682
.NET: Implement Purview middleware in dotnet #1949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
.NET: Implement Purview middleware in dotnet #1949
Conversation
… ignore exceptions
|
@microsoft-github-policy-service agree company="Microsoft" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds Microsoft Purview integration capabilities to the Agent Framework, enabling AI agents to leverage Purview's data governance and compliance features. The implementation includes client libraries for interacting with Purview APIs, middleware for wrapping agents and chat clients, and comprehensive unit tests.
Key changes:
- New
Microsoft.Agents.AI.Purviewlibrary for Purview integration - Extension methods to add Purview capabilities to agents and chat clients
- Background job processing for asynchronous content activities
- Comprehensive unit tests for all major components
- Sample application demonstrating Purview integration
Reviewed Changes
Copilot reviewed 79 out of 79 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| Microsoft.Agents.AI.Purview.csproj | Project configuration for the Purview library |
| PurviewClient.cs | HTTP client implementation for Purview API calls |
| ScopedContentProcessor.cs | Orchestrates protection scope, content processing, and activity tracking |
| PurviewWrapper.cs | Middleware wrapper for agent/chat client integration |
| PurviewExtensions.cs | Extension methods for adding Purview to agents and chat clients |
| PurviewSettings.cs | Configuration settings for Purview integration |
| Various model classes | Request/response models for Purview API interactions |
| Unit test files | Comprehensive test coverage for all components |
| AgentWithPurview sample | Sample application demonstrating usage |
dotnet/src/Microsoft.Agents.AI.Purview/Models/Requests/ProtectionScopesRequest.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Purview/Models/Common/ProtectionScopesCacheKey.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Purview/Models/Common/ProtectionScopesCacheKey.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Purview/ScopedContentProcessor.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Purview/ScopedContentProcessor.cs
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,43 @@ | |||
| // Copyright (c) Microsoft. All rights reserved. | |||
|
|
|||
| // This sample shows how to create and use a simple AI agent with Azure OpenAI Responses as the backend. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure there should be a Purview sample in the "Getting Started" section, since ostensibly the samples in there should target core/basic scenarios involved in building agents (admittedly there's probably other stuff in there that can be cleaned up).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit niche compared to the other examples in that directory. I added a new folder for Purview and moved this there, please let me know if there's a better spot for it.
Motivation and Context
Description
Adds dotnet Purview middleware similar to 1142. This will enforce Purview data security policies for prompts and responses sent to/from an agent.
Contribution Checklist