Microsoft Agent Framework for .NET 1.19
Last reviewed Sep 6, 2026
Prompt Details
Prompt Composition
2prompts
- C# 14106 lines · 4.4K tokens
- Microsoft Agent Framework for .NET 1.1958 lines · 2.2K tokens
Total164 lines · 6.6K tokens
CWE Coverage
- 20
- 22
- 59
- 78
- 89
- 94
- 117
- 190
- 208
- 209
- 214
- 250
- 257
- 295
- 323
- 327
- 338
- 362
- 367
- 378
- 426
- 488
- 502
- 532
- 611
- 639
- 674
- 759
- 770
- 772
- 775
- 798
- 807
- 829
- 862
- 915
- 916
- 918
- 922
- 1333
- 1395
- 1427
Prompt Preview
Apply the C# 14 baseline first and target .NET 10. These rules cover Microsoft Agent Framework for .NET 1.19 agents, chat clients, tools, workflows, state, approvals, middleware, telemetry, hosting, and operations.
Agent and chat-client construction
- Leave
ChatClientAgentOptions.AllowConcurrentInvocation=falseunless the agent, session provider, middleware, and every tool are concurrency-safe; this setting is independent ofChatOptions.AllowMultipleToolCalls. - Do not set
UseProvidedChatClientAsIs=trueunless the suppliedIChatClientalready has every required decorator, because that switch removes the framework’s automatic function-invocation and safety decorators. - If using
UseProvidedChatClientAsIs, construct and testFunctionInvokingChatClientexplicitly;AllowConcurrentInvocationon the agent options has no effect on a client supplied as-is. - Bound model turns, output tokens, wall time, retries, concurrent invocations, handoffs, and aggregate tool cost in trusted configuration; a workflow edge or model finish reason is not a resource limit.
- Treat all message text, citations, structured responses, and tool-call arguments as untrusted data and validate them again for the destination operation.
Tools and approval binding
- Register
AIFunctioninstances from a fixed trusted set, give them narrow schemas, wrap high-risk functions inApprovalRequiredAIFunction, and reauthorize each invocation against the current principal, tenant, resource, arguments, and workflow state. - Keep approval-response binding enabled by leaving