Claude SDK for C# 13

Last reviewed Oct 25, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. C# 14106 lines · 4.4K tokens
  2. Claude SDK for C# 1366 lines · 4.2K tokens
Total172 lines · 8.6K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 89
  • 94
  • 117
  • 190
  • 201
  • 208
  • 209
  • 214
  • 250
  • 257
  • 295
  • 319
  • 323
  • 327
  • 338
  • 347
  • 362
  • 367
  • 378
  • 426
  • 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

SDK version 13 here is the official Anthropic NuGet package's release line; the application language baseline is C# 14. Apply these rules to that combination. Use the rules for the APIs present in the installed SDK; beta helpers and cloud-provider packages have their own availability and compatibility boundaries.

Client identity and request configuration

  • Create AnthropicClient in a trusted service. Supply one intended credential through ApiKey, AuthToken, or Credentials, and keep credentials out of browser bundles, desktop distributions, prompts, and user-visible errors. If relying on environment discovery, account for ANTHROPIC_API_KEY taking precedence over ANTHROPIC_AUTH_TOKEN; do not let inherited developer credentials select a production principal.
  • Resolve WorkspaceID, anthropic-workspace-id, and resource IDs from the authenticated tenant's server-side configuration. Check tenant ownership before reading or mutating files, batches, sessions, threads, memory stores, vaults, or organization resources; knowing an upstream ID is not permission to use it.
  • Keep organization administration and privileged credentials separate from message-generation clients and callable tools. In API version 2026-10-21, inspect an API key's Scope and its type: an organization scope has no workspace ID and must not be treated as the Default Workspace. Use the actual Default Workspace ID when that is the intended boundary.
  • Construct MessageCreateParams and other parameter objects from application-owned fields. Do not deserialize an incoming request directly