Claude SDK for C# 12.46.0

Last reviewed Sep 24, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. C# 14106 lines · 4.4K tokens
  2. 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 Anthropic package at 12.46.0. Do not confuse it with package versions 3.x and earlier, which belonged to the former community SDK now named tryAGI.Anthropic. Review separately versioned integration packages, including Anthropic.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 AnthropicClient through dependency injection with one owner for its lifetime. Client disposal also disposes its supplied HttpClient and attached handlers; WithOptions and WithRawResponse clients 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 Timeout and MaxRetries values explicitly. The general timeout default is ten minutes, while Messages derives a default from MaxTokens and streaming mode. If supplying an HttpClient, configure its timeout to avoid premature cancellation by its separate default timeout.
  • Enforce an overall deadline with a caller-owned