Claude SDK for C# 13
Last reviewed Oct 25, 2026
Prompt Details
Prompt Composition
2prompts
- C# 14106 lines · 4.4K tokens
- 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
AnthropicClientin a trusted service. Supply one intended credential throughApiKey,AuthToken, orCredentials, and keep credentials out of browser bundles, desktop distributions, prompts, and user-visible errors. If relying on environment discovery, account forANTHROPIC_API_KEYtaking precedence overANTHROPIC_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'sScopeand 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
MessageCreateParamsand other parameter objects from application-owned fields. Do not deserialize an incoming request directly