.NET: Add security warnings to xml comments for core components#4527
Merged
westey-m merged 9 commits intomicrosoft:mainfrom Mar 6, 2026
Merged
.NET: Add security warnings to xml comments for core components#4527westey-m merged 9 commits intomicrosoft:mainfrom
westey-m merged 9 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds security-focused XML documentation warnings to core Agent Framework .NET components to help developers understand trust boundaries (external services, storage backends, tools) and common LLM-related risks (prompt injection, sensitive data exposure).
Changes:
- Add “Security considerations” sections to core abstractions (agents, sessions, context providers, chat history providers).
- Add targeted security notes to key implementations (Cosmos chat history, vector-store chat history memory, Mem0 provider, text search provider).
- Add telemetry-related sensitive data capture warning to OpenTelemetry integration.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI/TextSearchProvider.cs | Documents prompt-injection and untrusted-input risks when injecting external search results. |
| dotnet/src/Microsoft.Agents.AI/OpenTelemetryAgent.cs | Warns about PII/sensitive content exposure when enabling message-content telemetry. |
| dotnet/src/Microsoft.Agents.AI/Memory/ChatHistoryMemoryProvider.cs | Documents indirect prompt injection/PII risks for vector-store-backed memory retrieval and trace logging. |
| dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs | Adds class-level security remarks about trust boundaries, tool invocation, and output sanitization. |
| dotnet/src/Microsoft.Agents.AI.Mem0/Mem0Provider.cs | Documents external service trust, PII, prompt injection, and trace logging considerations for Mem0. |
| dotnet/src/Microsoft.Agents.AI.CosmosNoSql/CosmosChatHistoryProvider.cs | Documents PII retention/TTL, compromised store risks, and auth best practices for Cosmos DB. |
| dotnet/src/Microsoft.Agents.AI.Abstractions/ChatHistoryProvider.cs | Adds security guidance for untrusted loaded messages and secure storage of chat history. |
| dotnet/src/Microsoft.Agents.AI.Abstractions/AgentSession.cs | Adds guidance for secure session serialization and cautions about persisting sensitive StateBag data. |
| dotnet/src/Microsoft.Agents.AI.Abstractions/AIContextProvider.cs | Documents risks of providers injecting high-trust roles and unvalidated external content into context. |
| dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs | Adds top-level agent security remarks and session/message handling cautions. |
SergeyMenshykh
approved these changes
Mar 6, 2026
rogerbarreto
approved these changes
Mar 6, 2026
peibekwe
approved these changes
Mar 6, 2026
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
#3236
Description
Contribution Checklist