unstale

npm / @langchain/anthropic

@langchain/anthropic

What changed in @langchain/anthropic 0.1 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

7 breaking3 security2 deprecations51 new APIs and options12 behavior and defaults31 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@langchain/anthropic 178 changes

Breaking changes 7

  • Installed dependencies must use Zod 4.6.6 or newer to exclude versions affected by GHSA-mrhx-c7xc-m3w5; Zod v3 schemas remain supported through the bundled zod/v3 entry point.

    1.6.4release notes

  • Anthropic tool-call arguments stream as tool-call-delta events containing only the new slice instead of block-delta snapshots; raw-event consumers should read tool-call-delta.

    1.6.0release notes

  • Removed from the model profiles.

    1.5.13release notes

  • The model profile's maxInputTokens is lowered to 200,000.

    1.5.13release notes

  • Only text, tool_addition and tool_removal blocks are sent; other blocks are dropped, and a system message with no remaining content is omitted.

    1.5.12release notes

  • The default model changes from claude-3-5-sonnet-latest to claude-sonnet-4-5-20250929.

    1.3.20release notes

  • Usage metadata input_tokens now includes cache creation and cache read tokens.

    1.2.2release notes

Security 2

  • LangChain: MongoDBChatMessageHistory query injection can allow cross-session access

    1.3.1security advisory

  • LangChain: RediSearch Filter Injection via Unescaped Tag/Text Values

    1.1.1security advisory

Deprecations 1

  • The output format setting moves to outputConfig.format; outputFormat remains available for backwards compatibility but is deprecated.

    1.3.15release notes

New APIs and options 27

  • Always-on adaptive thinking models are supported.

    1.6.2release notes

  • Profiles for Claude Fable 5.2 and Mythos 5.2 are supported.

    1.6.2release notes

  • The nameless computer toolset is supported.

    1.6.2release notes

  • Added to the model profiles.

    1.5.13release notes

  • Adds support for Claude Fable 5.1.

    1.5.10release notes

  • Adds support for Claude Sonnet 5.

    1.5.9release notes

  • Adds LangSmith Gateway environment configuration to Anthropic chat models.

    1.5.4release notes

  • Adds support for the claude-opus-5 model.

    1.5.2release notes

  • Adds support for strict tool calling for custom tools.

    1.4.0release notes

  • Anthropic structured output now supports standard schemas.

    1.3.22release notes

  • Anthropic raises ContextOverflowError for context overflow errors.

    1.3.18release notes

  • Adds the Claude Opus 4.6 model with 16384 default max output tokens.

    1.3.15release notes

  • Adds beta compaction support, including auto-detection of compact_20260112 edits and streaming handlers for compaction content blocks.

    1.3.15release notes

  • Adds a parameter for data residency controls.

    1.3.15release notes

  • Adds effort levels low, medium, high, and max for controlling token usage.

    1.3.15release notes

  • Supports adaptive thinking, recommended for Opus 4.6.

    1.3.15release notes

  • Exports ChatAnthropicInput, an intersection of AnthropicInput and BaseChatModelParams, for type-safe configuration and IntelliSense.

    1.3.0release notes

  • Adds a named computer use tool for use with Anthropic.

    1.3.0release notes

  • Adds a named mcp toolset tool for use with Anthropic.

    1.3.0release notes

  • Adds a named text editor tool for use with Anthropic.

    1.3.0release notes

  • Adds a named webfetch tool for use with Anthropic.

    1.3.0release notes

  • Adds support for the Anthropic tool search tool.

    1.3.0release notes

  • Adds support for advanced tool use.

    1.2.0release notes

  • Adds opus-4.5 to the supported model strings.

    1.1.3release notes

  • Support for the betas parameter was added.

    1.1.0release notes

  • Native structured output is now supported.

    1.1.0release notes

  • Adds a provider-agnostic property for accessing standard content blocks, including reasoning traces, citations, and built-in tools.

    1.0.0upgrade guide

Behavior and default changes 11

  • Model profiles declare support for tools in the middle of a conversation for the listed Claude models.

    1.5.13release notes

  • SystemMessage content can carry tool_addition and tool_removal blocks, which are forwarded verbatim; the required beta is added automatically based on how the tool is defined.

    1.5.12release notes

  • System content built from standard content blocks no longer sends the internal block id to the provider.

    1.5.11release notes

  • Rate limits are marked retryable; context overflow, invalid tool results, bad credentials, and unknown models are marked non-retryable. Other errors remain unmarked and retry as before.

    1.5.6release notes

  • Native streamEvents event coverage was updated, changing which events are covered.

    1.5.0release notes

  • Adds compatibility updates for Claude Opus 4.7, allowing developers to use the model with this package.

    1.3.27release notes

  • Adds a default max token value for Sonnet models.

    1.3.25release notes

  • Runnable traces now include package version metadata, making version information available in LangSmith trace metadata.

    1.3.21release notes

  • Structured outputs are GA and no longer require a beta header.

    1.3.15release notes

  • Anthropic models handle standard file content blocks.

    1.3.13release notes

  • Invocation parameters now set an empty tool array.

    1.3.1release notes

Fixes and other changes 30

  • Falls back to tool_calls so withStructuredOutput works when streamed content is normalized to tool_call blocks.

    1.6.5release notes

  • A refusal stop reason maps to the content_filter finish reason in stream events.

    1.6.3release notes

  • withStructuredOutput throws ModelRefusalError on a refusal, including when thinking is enabled.

    1.6.3release notes

  • Forced tool choice is avoided for always-on thinking models.

    1.6.2release notes

  • Streamed usage now comes from cumulative message_delta usage, counting input and cache tokens from server tool passes without double-counting output tokens.

    1.6.2release notes

  • Streamed server_tool_use input is now kept when replaying messages.

    1.6.1release notes

  • Model profiles declare support for system messages in the middle of a conversation for the listed Claude models; Sonnet 5 also supports this.

    1.5.13release notes

  • SystemMessage can appear anywhere in the message list; it applies from its position onwards, and adding one preserves the prompt cache for earlier turns.

    1.5.11release notes

  • A leading run of two or more SystemMessages is merged into the top-level system field instead of being rejected.

    1.5.11release notes

  • Preserves the generic tool search result block type in streaming output and message payload conversion, preventing INVALID_TOOL_RESULTS in multi-turn conversations after a client-tool round-trip.

    1.5.8release notes

  • Message translation now round-trips this tool search result block, preventing multi-turn requests from failing when the block is dropped.

    1.5.7release notes

  • A per-call maxRetries is forwarded to the retry loop, allowing a surrounding retry loop such as modelRetryMiddleware to take over instead of multiplying retry counts.

    1.5.6release notes

  • convertAnthropicStream now surfaces an Anthropic-compatible gateway's numeric usage.cost in response_metadata.usage.cost; token accounting in usage_metadata is unchanged.

    1.5.5release notes

  • Filters tools with unsupported root schema composition.

    1.5.4release notes

  • Anthropic streams preserve cost metadata provided by the gateway.

    1.5.3release notes

  • Requests no longer include thinking: { type: "disabled" } unless the user explicitly configured it, preventing default instances from failing with adaptive-only models that reject this setting.

    1.5.1release notes

  • Tool choice required is now implemented for Anthropic.

    1.3.26release notes

  • Undefined values are no longer set on the request object.

    1.3.24release notes

  • Undefined values are no longer set on the request object, and validation works when thinking is enabled.

    1.3.24release notes

  • Prevents cache tokens from being double-counted during streaming.

    1.3.23release notes

  • Only set topP when it is defined, avoiding an API error.

    1.3.21release notes

  • When content is an empty array and tool_calls are present, formatting now appends unrepresented calls as tool_use blocks instead of silently dropping them and causing Anthropic API requests to fail.

    1.3.20release notes

  • Model profiles were updated.

    1.3.18release notes

  • Corrected the default maximum output token values for all Claude models.

    1.3.17release notes

  • Chat model invocations and streams now properly handle abort signals; invoke() throws ModelAbortError with accumulated partial output when aborted during streaming, while stream() throws AbortError.

    1.3.13release notes

  • Consolidates input_json_delta blocks in streaming tool calls, improving how streamed tool-call inputs are handled.

    1.3.11release notes

  • Fixed converting partial tool inputs.

    1.3.10release notes

  • Reasoning tokens are now properly elevated.

    1.3.8release notes

  • Fixes the .js import issue in chat_models.ts.

    1.3.0release notes

  • Fixes passing betas to the client when streaming.

    1.1.1release notes

@langchain/anthropic 0.32 changes

Security 1

Fixes and other changes 1

  • The default temperature option in v0/anthropic is fixed.

    0.3.58release notes

@langchain/anthropic 0.126 changes

Deprecations 1

  • Marks the read_only field as deprecated in the API key response schema.

    0.1.0docs

New APIs and options 24

  • Adds an organization-scoped endpoint for creating model price entries that apply to every workspace in the organization.

    0.1.0docs

  • Adds a DELETE endpoint for removing an organization model price, whether or not it exists.

    0.1.0docs

  • Adds a PUT endpoint to replace an organization model-price entry. The request is a full replacement; omitted optional fields reset to defaults, and existing run costs are not recomputed.

    0.1.0docs

  • Adds an endpoint to list an organization’s model prices, with optional pagination using page_size and cursor.

    0.1.0docs

  • Adds an endpoint to create an organization tracing key. Requests require workspaces and may include a description and expiration; the response includes the created key.

    0.1.0docs

  • Adds a GET endpoint to list a team's access policies with cursor pagination; organization- and workspace-scoped teams require their corresponding teams:read permission.

    0.1.0docs

  • Adds a GET endpoint to retrieve an organization-wide team's grant in a workspace, including its role and workspace ID.

    0.1.0docs

  • Adds an endpoint to list organization user groups, with optional workspace, parent group, identity, page size, and cursor filters.

    0.1.0docs

  • Adds an endpoint to list a user group's access policies, with cursor-based pagination and organization- or workspace-scoped read permissions.

    0.1.0docs

  • A POST endpoint grants an organization-wide user group a role in a workspace; it requires organization:user-groups:manage-grants and accepts role_id and workspace_id.

    0.1.0docs

  • Adds an endpoint that resolves AGENT, EXPERIMENT, or EVALUATOR addresses to a tracing project session_id. It is not supported on BYOC data planes; self-hosted deployments need LangSmith v0.18 or later.

    0.1.0docs

  • Adds an endpoint that returns the organization's default monthly trace limit for workspaces.

    0.1.0docs

  • Adds a beta endpoint to get a browser and its attached windows, with browser and error response schemas.

    0.1.0docs

  • Adds an endpoint to attach a sandbox to a browser or open a browser window for the caller, with options for controller, window size, localhost sharing, and unrestricted access.

    0.1.0docs

  • Adds a beta endpoint that opens a tab in a browser window and returns the created tab.

    0.1.0docs

  • Adds a beta DELETE endpoint to close a tab in a browser window.

    0.1.0docs

  • Adds a GET endpoint to list tracing projects and experiments, with filtering, sorting, optional statistics and facets, and cursor-based pagination.

    0.1.0docs

  • Adds the upsert query parameter to update an existing session with the same name.

    0.1.0docs

  • Adds an endpoint to remove an organization-wide team's access to a workspace, including workspace-attached access policies and the workspace-scoped team. Requires organization:teams:manage-grants.

    0.1.0docs

  • Adds an endpoint to retrieve one user group in an organization, with organization- or workspace-scoped read permissions.

    0.1.0docs

  • Adds an endpoint to grant an organization-wide team a role in a workspace. It requires organization:teams:manage-grants and accepts role_id and workspace_id.

    0.1.0docs

  • Adds a beta endpoint to create a copy-on-write clone of an existing volume. Requires sandbox volumes to be enabled; a volume attached read-write can be cloned only when its sandbox is stopped.

    0.1.0docs

  • Allows creating a browser with HiDPI rendering; the setting is off by default and fixed once the browser is created.

    0.1.0docs

  • Allows setting the memory size of the browser sandbox.

    0.1.0docs

Behavior and default changes 1

  • The endpoint opens about:blank when the URL is empty or omitted.

    0.1.0docs