Anthropic SDK for Ruby 1.67.0
Last reviewed Sep 24, 2026
Prompt Details
Prompt Composition
2prompts
- Ruby 4.0124 lines · 4.3K tokens
- Anthropic SDK for Ruby 1.67.076 lines · 3.2K tokens
Total200 lines · 7.5K tokens
CWE Coverage
- 20
- 23
- 59
- 74
- 78
- 79
- 89
- 95
- 117
- 122
- 134
- 201
- 208
- 209
- 214
- 250
- 295
- 319
- 327
- 338
- 347
- 362
- 367
- 378
- 409
- 416
- 426
- 470
- 502
- 532
- 639
- 770
- 772
- 807
- 829
- 862
- 863
- 915
- 916
- 918
- 922
- 923
- 1333
- 1395
- 1427
Prompt Preview
Apply the Ruby 4.0 baseline first. These additional rules target the anthropic 1.67.0 gem on Ruby 4.0; the gem's minimum Ruby requirement is 3.2.0. Use the APIs and defaults of this exact SDK version.
Client and credential boundaries
- Construct
Anthropic::Clientonly in trusted server code. Supplyapi_key:,auth_token:,credentials:, orconfig:from deployment-controlled secrets and configuration; never deserialize a client configuration supplied by an end user or model. - Select one intended authentication mechanism. Explicit static credentials override
credentials:, and ambientANTHROPIC_API_KEYorANTHROPIC_AUTH_TOKENoverrides automatic profile/federation discovery; remove obsolete credentials when adopting federation. - Protect credential profiles, identity-token files, and
config:paths from application-user writes. Foruser_oauthprofiles, arrange external credential rotation: this version does not implement refresh-token renewal for those files. - Allowlist the effective HTTPS API origin, including
base_url:,ANTHROPIC_BASE_URL, and profile configuration. ControlANTHROPIC_CUSTOM_HEADERSand proxy settings through deployment policy, and enforce approved destinations on redirects as well as initial requests. - Build
request_options:from trusted values. Itsextra_body,extra_query, andextra_headersoverride ordinary parameters and headers; never merge request payloads into these options or exposeclient.requestas a general authenticated HTTP proxy. - Install only reviewed client and per-request
middleware. Middleware