Packages
Anthropic Python SDK 2.16.0: Bedrock Managed Agents, Concurrent Tool Runners, and 401 Auth Fixes
Released December 1, 2026 on PyPI and GitHub, anthropic 2.16.0 brings Claude Managed Agents support to Amazon Bedrock alongside max_concurrent_calls for multi-thread tool runners, expanded bash/tool timeouts (295s/325s), direct stream event construction, and 401 credential refresh fixes from v2.15.0.
8 min read
Anthropic Python SDK 2.16.0: Bedrock Managed Agents, Concurrent Tool Runners, and 401 Auth Fixes
Executive Summary
On December 1, 2026, Anthropic published anthropic v2.16.0 to PyPI and GitHub (anthropics/anthropic-sdk-python), one day after shipping v2.15.0 on November 30, 2026. Requiring Python >=3.10 under the Apache-2.0 license (with pre-change contributions remaining under MIT per LICENSE-MIT), v2.16.0 expands the official Python client beyond direct Messages API calls with Claude Managed Agents on Amazon Bedrock, a max_concurrent_calls concurrency knob for session tool runners and environment workers, and major reliability and timeout updates for sandboxed bash and async tool execution.
For production AI engineering teams, v2.15.0 and v2.16.0 also introduce several subtle behavioral changes that affect error handling, token refresh, and structured outputs. In v2.16.0, handle_item() unwraps exceptions instead of wrapping them in an ExceptionGroup, transform_schema() caches a Pydantic model's JSON schema on first call, bash and tool timeouts expand (295s and 325s, respectively) with stricter process-tree cleanup, and v2.15.0 removes retired Claude Sonnet 4.5 models while fixing multi-process 401 token-refresh loops.
Adoption Telemetry & Version Changelog
As of December 1–2, 2026, anthropic on PyPI carries 4,120 GitHub stars, 922 forks, 74 open issues, and 179 open pull requests in its PyPI-verified repository metadata, alongside a matching 2.16.0 noarch package on conda-forge (updated December 1, 2026). As documented in Anthropic's CLI, SDKs, and libraries overview, Python 2.16.0 ships in step with @anthropic-ai/sdk 1.16.0 (TypeScript), anthropic-sdk-go/v2 2.17.0 (Go), Anthropic 13.16.0 (C#), and ant CLI 2.15.0. Per pyproject.toml, optional extras include mcp (mcp>=1.0, <3; python_version >= '3.10') for Model Context Protocol integrations and webhooks (standardwebhooks >= 1.0.1, < 2) for webhook signature validation.
Changelog Highlights: v2.15.0 (Nov 30) & v2.16.0 (Dec 1, 2026)
From the official CHANGELOG.md:
- Claude Managed Agents on Amazon Bedrock (
v2.16.0): Adds SDK API bindings for running Claude Managed Agents on Amazon Bedrock, paired with the newstorage_not_readyerror code so callers can distinguish transient workspace/session storage initialization from permanent failures. - Concurrent Session Tool Runner (
v2.16.0): Addsmax_concurrent_callsto both the session tool runner and the environment worker. Settingmax_concurrent_calls > 1(orNonefor unlimited concurrency) executes calls across different session threads concurrently, while keeping the default at1(sequential execution) to preserve existing stateful tool assumptions. - Environment Poller & Lease Hardening (
v2.16.0):- Claims a work item before serving it and avoids stopping items whose lease was lost.
auto_stopnow sends a force stop, andhandle_item()logs lease-loss failures instead of raising while raising underlying errors directly rather than wrapping them in anExceptionGroup.- Uploads memory files when a session goes idle, downloads subagent skills automatically alongside primary agent skills, and deduplicates colliding skill names using first-wins order (previously last-wins).
- Propagates permanent API errors encountered while reading a session (such as a
404for a deleted session) instead of swallowing or retrying indefinitely.
- Direct Stream Construction & Schema Caching (
v2.16.0): Constructs stream events directly instead of reflectively to reduce per-event CPU overhead in high-throughput SSE streams, and caches a model's JSON schema on first pass intransform_schema()(aligning its behavior withparse()andstream()). - Auth, Admin API & Model Lifecycle (
v2.15.0):- Adds Admin API
api_key_requester_unconfirmed, cost-report size-limit error codes, anduser_profile_clearedworkspace update error codes. - Refreshes credentials after HTTP
401even when a custom hook mutates theAuthorizationheader (and drops cached tokens even whenmax_retries=0so the next call refreshes cleanly), while preventing multiple processes sharing one login from refreshing each other's tokens in a loop. - Removes retired Claude Sonnet 4.5 models, tightens argument checks in structured-output helpers, and clarifies fast-mode beta header requirements and compliance review policy category values in docs.
- Adds Admin API
Breaking Changes, Tool Timeouts & Internals
The largest operational shifts in v2.16.0 live inside the session tool runner and bash tool sandbox, where defaults were tuned for longer-running agentic workflows and cleaner cancellation across multi-thread sessions.
Bash & Session Tool Execution Changes (v2.16.0)
- Longer Timeouts & Strict Shutdown Caps: A bash command may now run up to
295 seconds(up from120s), and the overall session tool timeout increased to325 seconds(up from150s). When the session tool runner stops, cancelled tools are given at most150 secondsto finish cleanup before termination. - Process-Tree Cleanup & Restart Guard: A timeout or cancellation now kills both the bash shell and its spawned background jobs, while
bashmaintains one dedicated shell per session thread. Once a shell has ended, subsequent bash calls are refused until a call explicitly passesrestart. Also note: useBashSession.start()rather than instantiatingBashSession()directly, asBashSession()takes internal arguments. - Output Truncation & File Offloading: Command output is ordered
stdoutthenstderr(orstderrfirst when a command fails) and truncated after30,000 characters(previously the last100 KiB), returning the path of a saved file containing the full output. Similarly,readview_rangerequests trigger above110,000 bytes(previously256 KiB). - AnyIO Cancellation Contract for Async Tools:
v2.16.0executes only the session tool calls the session is actively waiting on and cancels running async tools immediately if the session stops or no longer accepts their result. Custom async tools must shield cleanup awaits withanyio.CancelScope(shield=True)and offload blocking I/O viaanyio.to_thread.run_sync(which is awaited on cancellation).
Schema Caching & ExceptionGroup Removal
Two subtle breaking edges require code audits before upgrading:
transform_schema()caching: If your application mutates a Pydantic model dynamically after passing it totransform_schema(),v2.16.0will now return the cached first schema—passModel.model_json_schema()explicitly when dynamic per-call schema generation is required.handle_item()exception unwrapping: Error handlers expectingexcept*orExceptionGrouparoundhandle_item()should switch to catching the underlying exception directly.
Safe Implementation Pattern: Concurrent Session Tools & Shielded Cleanup
The example below illustrates the v2.16.0 cancellation-safe pattern for custom async tools alongside standard Messages API usage:
import anyio
from anthropic import Anthropic
# Standard Messages API usage with current Claude models (2.16.0+)
client = Anthropic() # Reads ANTHROPIC_API_KEY from environment
message = client.messages.create(
model="claude-opus-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Summarize our Bedrock deployment checklist."}],
)
print(message.content)
# Cancellation-safe async tool pattern required by anthropic 2.16.0
async def safe_async_tool(payload: dict) -> str:
resource = await acquire_temp_resource(payload)
try:
# Run blocking SDK/file work off the event loop; awaited on cancel
return await anyio.to_thread.run_sync(process_blocking, resource)
finally:
# Shield cleanup awaits so 2.16.0 session cancellation doesn't abort teardown
with anyio.CancelScope(shield=True):
await release_temp_resource(resource)
Ecosystem Comparison & Upgrade Checklist
How does anthropic 2.16.0 compare against its two primary Python frontier-model SDK counterparts (openai 3.62.2 and google-genai v3.x) as of early December 2026? All three official SDKs share Apache-2.0 licensing and a Python >=3.10 minimum floor, while diverging on cloud-managed agent surfaces and HTTP transport stacks. Note also that within Anthropic's own Python ecosystem, anthropic 2.16.0 powers direct Messages API, tool runner, and Managed Agents integrations, whereas claude-agent-sdk (0.2.189 on PyPI, MIT license) bundles the full local Claude Code CLI harness.
| Dimension | anthropic (2.16.0) |
openai (3.62.2) |
google-genai (v3.x) |
|---|---|---|---|
| Latest Release (Verified) | Dec 1, 2026 (PyPI) | Dec 2, 2026 (PyPI) | Major v3+ (PyPI) |
| License & Python Floor | Apache-2.0, Python >=3.10 |
Apache-2.0, Python >=3.10 |
Apache-2.0, Python >=3.10 |
| GitHub Stars (PyPI Metadata) | 4,120 stars, 922 forks |
32.3k stars (openai/openai-python) |
Official Google Gen AI SDK |
| Managed Cloud / Agent Support | Claude Managed Agents on Amazon Bedrock + Vertex | Bedrock SigV4/Mantle, Azure, Vertex, X.509 mTLS | Gemini Developer v1 & Vertex AI v1beta1 |
| Built-In Tool & Concurrency | max_concurrent_calls, BashSession.start(), 295s/325s timeouts |
Responses API, Realtime websockets 17, chunked webhooks |
httpx2 transport, CodeExecutionResultStep unions |
| MCP & Webhook Extras | anthropic[mcp] (mcp>=1.0,<3), anthropic[webhooks] |
openai[aiohttp], openai[bedrock], openai[realtime] |
google-genai[httpx] optional fallback |
Upgrade Checklist for anthropic 2.16.0
Before bumping anthropic==2.16.0 in pyproject.toml or requirements.txt:
- Remove retired Claude Sonnet 4.5 model IDs: Audit configs and fallback lists for retired Sonnet 4.5 identifiers removed in
v2.15.0. - Shield async tool cleanup with
anyio.CancelScope(shield=True): Verify all custom async session tools wrap teardown logic in a shieldedCancelScopeand useanyio.to_thread.run_syncfor blocking work (v2.16.0). - Update
BashSession&readassumptions: Switch directBashSession()instantiations toBashSession.start(), handlerestartafter shell termination, and adapt parsers to30,000-character truncation with file offloading (110,000-byteview_range). - Audit
handle_item()&transform_schema()callers: ReplaceExceptionGrouphandlers aroundhandle_item()with direct exception catches, and passModel.model_json_schema()if schemas mutate at runtime. - Tune
max_concurrent_callsexplicitly: Keep the default (1) for stateful single-thread tools, or raisemax_concurrent_callsfor independent multi-thread session workers. - Test skill collision order: If loading duplicate skill names across agents, verify that
v2.16.0's first-wins deduplication selects the intended skill.
Frequently Asked Questions
What is new in anthropic 2.16.0 for Amazon Bedrock users?
anthropic 2.16.0 (released December 1, 2026) adds API support for Claude Managed Agents on Amazon Bedrock alongside the new storage_not_ready error code for workspace/session storage readiness handling.
How does max_concurrent_calls work in the session tool runner?
Added in v2.16.0, max_concurrent_calls controls how many tool calls across different session threads can execute concurrently in the session tool runner and environment worker. Setting a value > 1 (or None for no limit) enables parallel execution, while the default remains 1 (one call at a time).
Why did bash and tool timeouts change in anthropic 2.16.0?
v2.16.0 increased the bash command timeout from 120s to 295s and the session tool timeout from 150s to 325s to accommodate longer agentic tasks, while adding strict cleanup that kills the shell and its background jobs on timeout or cancellation (with a 150s cancellation grace cap).
What changed in v2.15.0 for 401 token refresh and multi-process logins?
v2.15.0 (November 30, 2026) ensures credentials refresh after a 401 even if hooks modify the Authorization header (dropping cached tokens even when max_retries=0), and prevents multiple processes sharing a single login from endlessly refreshing each other's tokens.
Does anthropic 2.16.0 still support mcp and standardwebhooks extras?
Yes. Per pyproject.toml, anthropic[mcp] installs mcp>=1.0, <3 (Python >=3.10) and anthropic[webhooks] installs standardwebhooks >= 1.0.1, < 2.
Sources
- GitHub —
anthropics/anthropic-sdk-pythonCHANGELOG.md(v2.15.0–v2.16.0) (Released December 1, 2026): https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md - PyPI —
anthropic 2.16.0Package Page & Metadata (Released December 1, 2026): https://pypi.org/project/anthropic/ - GitHub —
anthropics/anthropic-sdk-pythonpyproject.toml(Accessed December 2, 2026): https://github.com/anthropics/anthropic-sdk-python/blob/main/pyproject.toml - Claude Platform Docs — "SDKs, CLI, and libraries" (Accessed December 2, 2026): https://platform.claude.com/docs/en/cli-sdks-libraries/overview
- Anaconda / conda-forge —
anthropic 2.16.0Feedstock (Updated December 1, 2026): https://anaconda.org/conda-forge/anthropic - PyPI —
openai 3.62.2,google-genai, andclaude-agent-sdkPackage Pages (Accessed December 2, 2026): https://pypi.org/project/openai/, https://pypi.org/project/google-genai/, and https://pypi.org/project/claude-agent-sdk/