Microsoft Agent Framework for .NET 1.20
Last reviewed Sep 6, 2026
Prompt Details
Prompt Composition
2prompts
- C# 14106 lines · 4.4K tokens
- Microsoft Agent Framework for .NET 1.2087 lines · 3.9K tokens
Total193 lines · 8.2K tokens
CWE Coverage
- 20
- 22
- 59
- 78
- 89
- 94
- 117
- 190
- 208
- 209
- 214
- 250
- 257
- 295
- 319
- 323
- 327
- 338
- 362
- 367
- 378
- 426
- 488
- 494
- 502
- 532
- 611
- 639
- 674
- 759
- 770
- 772
- 775
- 798
- 807
- 829
- 862
- 915
- 916
- 918
- 1333
- 1395
- 1427
Prompt Preview
Apply the C# 14 prompt first on the .NET 10 baseline. These rules cover the stable Microsoft.Agents.AI 1.20.0 line and its corresponding prerelease integrations, including chat-client agents, tools and approval, sessions and memory, hosted endpoints, workflows, Agent Skills, shell and CodeAct execution, and telemetry.
Agent construction and trust boundaries
- Treat system instructions, user messages, retrieved memories, remote agent output, tool results, skill files, and model-generated arguments as distinct trust domains; label their provenance and never let lower-trust content redefine policy, identity, approval, or tool availability.
- Register agents, instructions, tools, model endpoints, middleware, hooks, memory providers, and serializers from trusted server configuration; do not select them from prompt content or untrusted request fields.
- Give every agent the smallest tool set needed for the current authenticated task and use separate agents, credentials, sessions, and stores where trust or privilege differs.
- Keep
ChatClientAgentOptions.UseProvidedChatClientAsIsfalse unless the complete customIChatClientpipeline has been reviewed; setting it true omits the framework's automatic function-invocation and safety-related decorators. - When building a custom client pipeline, reproduce required decorators explicitly, preserve their documented ordering, and add regression tests for approval binding, bypass queues, message injection, history persistence, and function invocation.
- Leave concurrent function invocation disabled unless tool calls are