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@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.
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.
Removed from the model profiles.
The model profile's maxInputTokens is lowered to 200,000.
Only text, tool_addition and tool_removal blocks are sent; other blocks are dropped, and a system message with no remaining content is omitted.
The default model changes from claude-3-5-sonnet-latest to claude-sonnet-4-5-20250929.
Usage metadata input_tokens now includes cache creation and cache read tokens.
Security 2
LangChain: MongoDBChatMessageHistory query injection can allow cross-session access
LangChain: RediSearch Filter Injection via Unescaped Tag/Text Values
Deprecations 1
The output format setting moves to outputConfig.format; outputFormat remains available for backwards compatibility but is deprecated.
New APIs and options 27
Always-on adaptive thinking models are supported.
Profiles for Claude Fable 5.2 and Mythos 5.2 are supported.
The nameless computer toolset is supported.
Added to the model profiles.
Adds support for Claude Fable 5.1.
Adds support for Claude Sonnet 5.
Adds LangSmith Gateway environment configuration to Anthropic chat models.
Adds support for the claude-opus-5 model.
Adds support for strict tool calling for custom tools.
Anthropic structured output now supports standard schemas.
Anthropic raises ContextOverflowError for context overflow errors.
Adds the Claude Opus 4.6 model with 16384 default max output tokens.
Adds beta compaction support, including auto-detection of compact_20260112 edits and streaming handlers for compaction content blocks.
Adds a parameter for data residency controls.
Adds effort levels low, medium, high, and max for controlling token usage.
Supports adaptive thinking, recommended for Opus 4.6.
Exports ChatAnthropicInput, an intersection of AnthropicInput and BaseChatModelParams, for type-safe configuration and IntelliSense.
Adds a named computer use tool for use with Anthropic.
Adds a named mcp toolset tool for use with Anthropic.
Adds a named text editor tool for use with Anthropic.
Adds a named webfetch tool for use with Anthropic.
Adds support for the Anthropic tool search tool.
Adds support for advanced tool use.
Adds opus-4.5 to the supported model strings.
Support for the betas parameter was added.
Native structured output is now supported.
Adds a provider-agnostic property for accessing standard content blocks, including reasoning traces, citations, and built-in tools.
Behavior and default changes 11
Model profiles declare support for tools in the middle of a conversation for the listed Claude models.
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.
System content built from standard content blocks no longer sends the internal block id to the provider.
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.
Native streamEvents event coverage was updated, changing which events are covered.
Adds compatibility updates for Claude Opus 4.7, allowing developers to use the model with this package.
Adds a default max token value for Sonnet models.
Runnable traces now include package version metadata, making version information available in LangSmith trace metadata.
Structured outputs are GA and no longer require a beta header.
Anthropic models handle standard file content blocks.
Invocation parameters now set an empty tool array.
Fixes and other changes 30
Falls back to tool_calls so withStructuredOutput works when streamed content is normalized to tool_call blocks.
A refusal stop reason maps to the content_filter finish reason in stream events.
withStructuredOutput throws ModelRefusalError on a refusal, including when thinking is enabled.
Forced tool choice is avoided for always-on thinking models.
Streamed usage now comes from cumulative message_delta usage, counting input and cache tokens from server tool passes without double-counting output tokens.
Streamed server_tool_use input is now kept when replaying messages.
Model profiles declare support for system messages in the middle of a conversation for the listed Claude models; Sonnet 5 also supports this.
SystemMessage can appear anywhere in the message list; it applies from its position onwards, and adding one preserves the prompt cache for earlier turns.
A leading run of two or more SystemMessages is merged into the top-level system field instead of being rejected.
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.
Message translation now round-trips this tool search result block, preventing multi-turn requests from failing when the block is dropped.
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.
convertAnthropicStream now surfaces an Anthropic-compatible gateway's numeric usage.cost in response_metadata.usage.cost; token accounting in usage_metadata is unchanged.
Filters tools with unsupported root schema composition.
Anthropic streams preserve cost metadata provided by the gateway.
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.
Tool choice required is now implemented for Anthropic.
Undefined values are no longer set on the request object.
Undefined values are no longer set on the request object, and validation works when thinking is enabled.
Prevents cache tokens from being double-counted during streaming.
Only set topP when it is defined, avoiding an API error.
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.
Model profiles were updated.
Corrected the default maximum output token values for all Claude models.
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.
Consolidates input_json_delta blocks in streaming tool calls, improving how streamed tool-call inputs are handled.
Fixed converting partial tool inputs.
Reasoning tokens are now properly elevated.
Fixes the
.jsimport issue in chat_models.ts.Fixes passing betas to the client when streaming.
@langchain/anthropic 0.32 changes
Security 1
A fix addresses CVE-2025-12735.
Fixes and other changes 1
The default temperature option in v0/anthropic is fixed.
@langchain/anthropic 0.126 changes
Deprecations 1
Marks the read_only field as deprecated in the API key response schema.
New APIs and options 24
Adds an organization-scoped endpoint for creating model price entries that apply to every workspace in the organization.
Adds a DELETE endpoint for removing an organization model price, whether or not it exists.
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.
Adds an endpoint to list an organization’s model prices, with optional pagination using page_size and cursor.
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.
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.
Adds a GET endpoint to retrieve an organization-wide team's grant in a workspace, including its role and workspace ID.
Adds an endpoint to list organization user groups, with optional workspace, parent group, identity, page size, and cursor filters.
Adds an endpoint to list a user group's access policies, with cursor-based pagination and organization- or workspace-scoped read permissions.
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.
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.
Adds an endpoint that returns the organization's default monthly trace limit for workspaces.
Adds a beta endpoint to get a browser and its attached windows, with browser and error response schemas.
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.
Adds a beta endpoint that opens a tab in a browser window and returns the created tab.
Adds a beta DELETE endpoint to close a tab in a browser window.
Adds a GET endpoint to list tracing projects and experiments, with filtering, sorting, optional statistics and facets, and cursor-based pagination.
Adds the upsert query parameter to update an existing session with the same name.
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.
Adds an endpoint to retrieve one user group in an organization, with organization- or workspace-scoped read permissions.
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.
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.
Allows creating a browser with HiDPI rendering; the setting is off by default and fixed once the browser is created.
Allows setting the memory size of the browser sandbox.
Behavior and default changes 1
The endpoint opens about:blank when the URL is empty or omitted.