Microsoft Agent Framework for .NET 1.25

Last reviewed Oct 18, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. C# 14106 lines · 4.4K tokens
  2. Microsoft Agent Framework for .NET 1.2558 lines · 3K tokens
Total164 lines · 7.4K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 78
  • 79
  • 89
  • 94
  • 117
  • 190
  • 201
  • 208
  • 209
  • 214
  • 250
  • 257
  • 295
  • 306
  • 323
  • 327
  • 338
  • 362
  • 367
  • 378
  • 426
  • 502
  • 532
  • 611
  • 639
  • 674
  • 759
  • 770
  • 772
  • 775
  • 798
  • 807
  • 829
  • 841
  • 862
  • 863
  • 915
  • 916
  • 918
  • 922
  • 1333
  • 1395
  • 1426
  • 1427

Prompt Preview

Apply these rules to Microsoft Agent Framework for .NET 1.25 applications composed with C# 14 and .NET 10. Apply integration-specific rules only when that integration is used; the stable core does not make preview integrations stable. When hosting through ASP.NET Core, also apply the ASP.NET Core prompt for the host's installed version.

Prompt injection and agent configuration

  • Keep ChatOptions.Instructions, system-role messages, agent definitions, and tool registrations under application control. Put user text, retrieved documents, memory, and tool results in data messages; never promote them to instructions or permission to add tools.
  • Review AIContextProvider and ChatHistoryProvider implementations as privileged extensions: they can supply messages and influence the model. Preserve the untrusted status of retrieved content, enforce document access before retrieval, and keep tenant filters outside model-generated search arguments. A summary or restored memory does not acquire authority by being stored.
  • Construct ChatClientAgentRunOptions on the server. Do not bind client JSON directly to ChatOptions, tool collections, ChatClientFactory, or provider selection. Apply the same policy to tools added during a run and to MessageInjectingChatClient messages.

Tool authorization and approval

  • Enforce tool authorization inside each AIFunction before effects occur: validate the current authenticated principal, operation, final arguments, and target resource. Obtain identity from trusted request context, not model arguments. A tool schema, discovered