Claude SDK for C# 12.46.0
Last reviewed Sep 24, 2026
Prompt Details
Prompt Composition
2prompts
- C# 14106 lines · 4.4K tokens
- Claude SDK for C# 12.46.085 lines · 5K tokens
Total191 lines · 9.3K tokens
CWE Coverage
- 20
- 22
- 59
- 78
- 79
- 89
- 94
- 117
- 190
- 201
- 208
- 209
- 214
- 250
- 257
- 295
- 319
- 323
- 327
- 338
- 347
- 362
- 367
- 378
- 426
- 434
- 502
- 532
- 611
- 636
- 639
- 672
- 674
- 732
- 759
- 770
- 772
- 775
- 798
- 807
- 841
- 862
- 863
- 915
- 916
- 918
- 922
- 1333
- 1395
- 1426
- 1427
Prompt Preview
Apply the C# 14 baseline first. These rules target the official Anthropic NuGet package 12.46.0 in .NET 10 applications. The package also ships net8.0, net9.0, and netstandard2.0 assets; use a supported, patched runtime. Treat every user prompt, retrieved document, MCP response, tool argument, model response, generated file, and webhook body as untrusted data.
Pin the intended SDK and client behavior
- Reference the official
Anthropicpackage at 12.46.0. Do not confuse it with package versions 3.x and earlier, which belonged to the former community SDK now namedtryAGI.Anthropic. Review separately versioned integration packages, includingAnthropic.Mcp, before adding them. - Re-run security and behavior tests before accepting another SDK minor because this project permits some practical breaking changes in minor releases.
- Register a long-lived
AnthropicClientthrough dependency injection with one owner for its lifetime. Client disposal also disposes its suppliedHttpClientand attached handlers;WithOptionsandWithRawResponseclients normally share that transport. Do not dispose a per-call client view while the shared client is still serving requests, or mutate shared tenant-specific configuration. - Set bounded SDK
TimeoutandMaxRetriesvalues explicitly. The general timeout default is ten minutes, while Messages derives a default fromMaxTokensand streaming mode. If supplying anHttpClient, configure its timeout to avoid premature cancellation by its separate default timeout. - Enforce an overall deadline with a caller-owned