Claude SDK for C# 12.44.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.44.072 lines · 3.1K tokens
Total178 lines · 7.5K tokens

CWE Coverage

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

Prompt Preview

Apply the C# 14 baseline first. These rules cover the official Anthropic NuGet package 12.44.0 with C# 14 on .NET 10, including Messages, automatic tool execution, files, batches, and opt-in Managed Agents features.

Clients and credentials

  • Reference the official Anthropic package, let dotnet package add Anthropic choose the release, and lock what resolves. The same package ID also carries the former community package's older releases, which continue as tryAGI.Anthropic, so never type an Anthropic version from memory. Its dependencies, including System.Text.Json, System.Net.ServerSentEvents, and Microsoft.Extensions.AI.Abstractions, are declared as minimums that don't track security fixes, so audit the versions that actually resolve and raise any that audit flags.
  • Construct AnthropicClient in trusted server code with an explicit ClientOptions argument. Set the intended credentials and BaseUrl before construction: the parameterless constructor can discover credentials, workspace headers, and a base URL from environment variables and local profiles before object initializers run.
  • Select one authentication mechanism deliberately. For API-key authentication, explicitly set AuthToken = null to suppress ANTHROPIC_AUTH_TOKEN; for bearer-only authentication, suppress the API key. Explicit non-null ApiKey or AuthToken takes precedence over Credentials, and static key/token headers can otherwise both be sent.
  • Keep BaseUrl, ANTHROPIC_BASE_URL, HttpClient, Handlers, proxy settings, and ClientOptions.ExtraHeaders under deployment