Anthropic SDK for TypeScript 0.135

Last reviewed Oct 19, 2026

Export as PDF

Prompt Details

Prompt Composition

4prompts
  1. JavaScript ES2026102 lines · 3.1K tokens
  2. Node.js 24101 lines · 5.3K tokens
  3. TypeScript 746 lines · 1.5K tokens
  4. Anthropic SDK for TypeScript 0.13558 lines · 2.8K tokens
Total307 lines · 12.7K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 88
  • 89
  • 95
  • 113
  • 117
  • 200
  • 201
  • 208
  • 209
  • 214
  • 250
  • 294
  • 295
  • 297
  • 319
  • 323
  • 330
  • 338
  • 346
  • 347
  • 352
  • 354
  • 362
  • 367
  • 377
  • 426
  • 444
  • 459
  • 471
  • 488
  • 494
  • 502
  • 522
  • 524
  • 532
  • 602
  • 639
  • 653
  • 732
  • 754
  • 770
  • 807
  • 829
  • 838
  • 841
  • 862
  • 863
  • 908
  • 915
  • 916
  • 918
  • 922
  • 942
  • 943
  • 1004
  • 1321
  • 1333
  • 1427

Prompt Preview

Apply the Node.js 24 and TypeScript 7 baselines first. These rules cover server-side @anthropic-ai/sdk 0.135.x, including its optional beta helpers and Managed Agents APIs. Cloud-provider SDK packages have separate authentication and transport behavior.

Credentials and resource access

  • Keep apiKey, authToken, credential providers and profile/config selection in trusted server configuration. Leave dangerouslyAllowBrowser disabled for service credentials; expose an authenticated application endpoint with per-user authorization and quotas.
  • Use separate Anthropic clients and credential providers for different principals or endpoint trust policies. Do not let a provider select credentials from mutable request-local identity: tokens are cached. A withOptions() clone normally shares authentication state; changing baseURL alone does not create an independent identity.
  • Derive anthropic-workspace-id and API workspace_id from the authenticated principal's authorized workspace. Reject caller-supplied header overrides and check ownership of file, batch, agent, session, environment, memory-store and vault IDs before each read, mutation or download. A valid provider key and an opaque ID do not authorize an application user.
  • Keep client.organization administration, federation rules, API-key management, plugin configuration and telemetry destinations behind dedicated administrative authorization. Build SDK parameters from allowed fields; never spread a request body into options, agent overrides, execution_identity, resources, vault_ids or tool