Skip to content

.NET: Add security warnings to xml comments for core components#4527

Merged
westey-m merged 9 commits into
microsoft:mainfrom
westey-m:add-security-warnings
Mar 6, 2026
Merged

.NET: Add security warnings to xml comments for core components#4527
westey-m merged 9 commits into
microsoft:mainfrom
westey-m:add-security-warnings

Conversation

@westey-m

@westey-m westey-m commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

#3236

Description

  • Add security warnings to xml comments for core components

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings March 6, 2026 15:39
@markwallace-microsoft markwallace-microsoft added the .NET Usage: [Issues, PRs], Target: .Net label Mar 6, 2026
@github-actions github-actions Bot changed the title Add security warnings to xml comments for core components .NET: Add security warnings to xml comments for core components Mar 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread dotnet/src/Microsoft.Agents.AI.Mem0/Mem0Provider.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants