NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #548 most downloaded on PyPI
A model-driven approach to building AI agents in just a few lines of code
Latest stable
1.68.0
Last release today
27 Nov 2026
Ships on a steady schedule
a new release about every 1 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
93 releases · first in 2025
Drag across the ruler to compare, or tap a release to open it.
_Auto-drafted from commits in python/v1.67.0..python/v1.68.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.67.0..python/v1.68.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
_Auto-drafted from commits in python/v1.66.0..python/v1.67.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.66.0..python/v1.67.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
feat: vend the todos plugin in the SDK and deprecate the harness built-in
Auto-drafted from commits in python/v1.65.0..python/v1.66.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.64.0..python/v1.65.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.64.0..python/v1.65.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.63.0..python/v1.64.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.63.0..python/v1.64.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
feat(vended-tools): port edit tool to TypeScript, deprecate fileEditor
Auto-drafted from commits in python/v1.62.0..python/v1.63.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.61.1..python/v1.62.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.61.1..python/v1.62.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.61.0..python/v1.61.1, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.61.0..python/v1.61.1, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.60.0..python/v1.61.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.60.0..python/v1.61.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.59.0..python/v1.60.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.59.0..python/v1.60.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.58.1..python/v1.59.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.58.1..python/v1.59.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.58.0..python/v1.58.1, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.58.0..python/v1.58.1, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.57.2..python/v1.58.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.57.2..python/v1.58.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.57.1..python/v1.57.2, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.57.1..python/v1.57.2, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.57.0..python/v1.57.1, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.57.0..python/v1.57.1, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.56.0..python/v1.57.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.56.0..python/v1.57.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.55.1..python/v1.56.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.55.1..python/v1.56.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.55.0..python/v1.55.1, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.55.0..python/v1.55.1, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
feat(models): add tools_ttl to CacheConfig and deprecate cache_tools
Auto-drafted from commits in python/v1.54.0..python/v1.55.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.53.0..python/v1.54.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.53.0..python/v1.54.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
docs(team): require both decorator and log when deprecating a tool
Auto-drafted from commits in python/v1.52.0..python/v1.53.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
fix(vended-tools): keep the pre-rename name on the deprecated bash aliases
Auto-drafted from commits in python/v1.51.0..python/v1.52.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
refactor(vended-tools): mark make_bash with typing_extensions.deprecated
Auto-drafted from commits in python/v1.50.2..python/v1.51.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
chore: update context offloader comments to deprecate legacy storage
Auto-drafted from commits in python/v1.50.1..python/v1.50.2, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.50.0..python/v1.50.1, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.50.0..python/v1.50.1, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
fix: replace deprecated datetime.utcnow() with timezone-aware datetime.now(timezone.utc)
Auto-drafted from commits in python/v1.48.0..python/v1.50.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.47.0..python/v1.48.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.47.0..python/v1.48.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.46.0..python/v1.47.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.46.0..python/v1.47.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
_Auto-drafted from commits in python/v1.45.0..python/v1.46.0, grouped by conventional-commit type. Edit on the release page after publish if you want
Auto-drafted from commits in python/v1.45.0..python/v1.46.0, grouped by conventional-commit type. Edit on the release page after publish if you want a polished writeup; the canonical release notes live on the website.
feat(memory): support managed Bedrock knowledge bases in retrieve and ACL _(shared with TS)_ by @notowen333 in #2909
Full Changelog: https://github.com/strands-agents/harness-sdk/compare/python/v1.44.0...python/v1.45.0
feat(memory): port memory manager and extraction to Python by @JackYPCOnline in #2740
Agent memory_manager param with configurable sync auto-flush by @JackYPCOnline in #2795BedrockKnowledgeBaseStore to strands-py by @pgrayy in #2834InvokeModelStage (shared with TS) by @zastrowm in #2760InMemoryStorage (shared with TS) by @lizradway in #2648invocation_state to edge condition calls by @yananym in #2642InterventionHandler lifecycle overrides by @agent-of-mkmeral in #2800ExtractionConfig as a TypedDict by @pgrayy in #2827| None from optional config fields by @pgrayy in #2832Full Changelog: https://github.com/strands-agents/harness-sdk/compare/python/v1.43.0...python/v1.44.0
feat(strands-py): add optional hook order by @lizradway in https://github.com/strands-agents/harness-sdk/pull/2559
blog type in PR title validation by @zastrowm in https://github.com/strands-agents/harness-sdk/pull/2718Full Changelog: https://github.com/strands-agents/harness-sdk/compare/python-wasm/v0.0.1...python/v1.43.0
fix(tests): fix flaky tests to accept string or number by @lizradway in https://github.com/strands-agents/sdk-python/pull/2319
agent_card_url property to A2AServer for customizable url in AgentCard by @waitasecant in https://github.com/strands-agents/sdk-python/pull/2003Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.41.0...python/v1.42.0
feat(plugins): add MultiAgentPlugin for Swarm and Graph orchestrators by @zastrowm in https://github.com/strands-agents/sdk-python/pull/2280
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.40.0...v1.41.0
feat: add proactive context compression to conversation managers by @opieter-aws in https://github.com/strands-agents/sdk-python/pull/2239
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.39.0...v1.40.0
feat: enable openai provider use aws profile by @JackYPCOnline in https://github.com/strands-agents/sdk-python/pull/2230
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.38.0...v1.39.0
feat(mcp): preserve CallToolResult.isError flag in MCPToolResult by @Zelys-DFKH in https://github.com/strands-agents/sdk-python/pull/2118
count_token method to model with naive estimation using tiktoken by @lizradway in https://github.com/strands-agents/sdk-python/pull/2031Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.37.0...v1.38.0
fix: add fallback trim point for tool-heavy conversations in SlidingWindowConversationManager by @lufecadu in https://github.com/strands-agents/sdk-py
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.36.0...v1.37.0
feat(a2a): add client_config param and deprecate a2a_client_factory by @agent-of-mkmeral in https://github.com/strands-agents/sdk-python/pull/2103
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.35.0...v1.36.0
Anthropic Pydantic deprecation warnings — PR#2044: Fixed message_stop event handling to avoid Pydantic deprecation warnings.
Amazon Bedrock now offers service tiers (Priority, Standard, Flex) that let you control the trade-off between latency and cost on a per-request basis. BedrockModel accepts a new service_tier configuration field, consistent with how other Bedrock-specific features like guardrails are exposed. When not set, the field is omitted and Bedrock uses its default behavior.
from strands import Agent
from strands.models.bedrock import BedrockModel
# Use "flex" tier for cost-optimized batch processing
model = BedrockModel(
model_id="us.anthropic.claude-sonnet-4-20250514-v1:0",
service_tier="flex",
)
agent = Agent(model=model)
# Use "priority" for latency-sensitive applications
realtime_model = BedrockModel(
model_id="us.anthropic.claude-sonnet-4-20250514-v1:0",
service_tier="priority",
)
Valid values are "default", "priority", and "flex". If a model or region does not support the specified tier, Bedrock returns a ValidationException.
Sliding window conversation manager user-first enforcement — PR#2087: The sliding window could produce a trimmed conversation starting with an assistant message, causing ValidationException on providers that require user-first ordering (including Bedrock Nova). The trim-point validation now ensures the first remaining message always has role == "user". Also fixed a short-circuit logic bug in the toolUse guard that let orphaned tool-use blocks slip through at window boundaries.
MCP _meta forwarding — PR#1918, PR#2081: Custom metadata per the MCP spec was silently dropped because MCPClient never forwarded the _meta field to ClientSession.call_tool(). Additionally, the OTEL instrumentation used model_dump() instead of model_dump(by_alias=True), serializing the field as "meta" instead of "_meta" and corrupting the payload. Both the direct call_tool and task-augmented execution paths now correctly forward meta.
Tool exception propagation to OpenTelemetry spans — PR#2046: When a tool raised an exception, the original exception was dropped before reaching end_tool_call_span, causing all tool spans to get StatusCode.OK even on errors. Tool errors now correctly propagate with StatusCode.ERROR, preserving the original exception type and traceback for observability backends like Langfuse.
Anthropic premature stream termination — PR#2047: The Anthropic provider crashed with AttributeError when the stream terminated before the final message_stop event, because it accessed event.message.usage on event types that lack a .message attribute. Now uses the Anthropic SDK's stream.get_final_message() to read accumulated usage from all received events, gracefully handling premature termination and empty streams.
Anthropic Pydantic deprecation warnings — PR#2044: Fixed message_stop event handling to avoid Pydantic deprecation warnings.
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.34.1...v1.35.0
fix: fix type imcompatible by @JackYPCOnline in https://github.com/strands-agents/sdk-python/pull/2018
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.34.0...v1.34.1
chore: remove Cohere from required integ test providers by @zastrowm in https://github.com/strands-agents/sdk-python/pull/1967
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.33.0...v1.34.0
Pins litellm<=1.82.6 to supply chain attack - Supply Chain Attack in litellm 1.82.8 on PyPI
Pins litellm<=1.82.6 to supply chain attack - Supply Chain Attack in litellm 1.82.8 on PyPI
litellm<=1.82.6 to mitigate supply chain attack by @udaymehta in https://github.com/strands-agents/sdk-python/pull/1961Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.32.0...v1.33.0
fix(event-loop): ensure all cycle metrics include end time and duration by @stephentreacy in https://github.com/strands-agents/sdk-python/pull/1903
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.31.0...v1.32.0
feat: pass A2A request context metadata as invocation state by @mkmeral in https://github.com/strands-agents/sdk-python/pull/1854
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.30.0...v1.31.0
feat: add "anthropic" cache strategy to bypass model ID check by @kevmyung in https://github.com/strands-agents/sdk-python/pull/1808
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.29.0...v1.30.0
test: pin virtualenv to <21 for hatch bug by @clareliguori in https://github.com/strands-agents/sdk-python/pull/1771
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.28.0...v1.29.0
fix: update region for agentcore in our new account by @afarntrog in https://github.com/strands-agents/sdk-python/pull/1715
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.27.0...v1.28.0
feat: Propagate exceptions to AfterToolCallEvent for decorated tools (#1565) by @charles-dyfis-net in https://github.com/strands-agents/sdk-python/pul
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.26.0...v1.27.0
ci: bump aws-actions/configure-aws-credentials from 5 to 6 by @dependabot[bot] in https://github.com/strands-agents/sdk-python/pull/1632
parts for Artifact by @punkyoon in https://github.com/strands-agents/sdk-python/pull/1643Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.25.0...v1.26.0
…the default strategy. Note: This is a minor breaking change in behavior for code that explicitly passed None.
The new A2AAgent class makes it simple to connect to and invoke remote agents that implement the Agent-to-Agent (A2A) protocol. A2AAgent implements the AgentBase protocol, so it can be called synchronously, asynchronously, or used in streaming mode just like a local Agent. It automatically discovers the remote agent's card to populate its name and description, and manages HTTP client lifecycle for you.
from strands.agent.a2a_agent import A2AAgent
# Connect to a remote A2A agent
a2a_agent = A2AAgent(endpoint="http://localhost:9000")
# Invoke it like any other agent
result = a2a_agent("Show me 10 ^ 6")
print(result.message)
# Or stream events asynchronously
async for event in a2a_agent.stream_async("Summarize this report"):
if event.get("type") == "a2a_stream":
print(f"A2A event: {event['event']}")
elif "result" in event:
print(f"Final: {event['result'].message}")
Graph nodes now accept any AgentBase implementation as an executor, not just the concrete Agent class. This means A2AAgent instances and other custom AgentBase implementations can participate in graph-based multi-agent workflows alongside local agents. The Agent class also now explicitly extends AgentBase for compile-time protocol verification.
from strands import Agent
from strands.agent.a2a_agent import A2AAgent
from strands.multiagent.graph import GraphBuilder
local_agent = Agent(name="summarizer", system_prompt="Summarize input concisely.")
remote_agent = A2AAgent(endpoint="http://remote-agent:9000")
builder = GraphBuilder()
builder.add_node(remote_agent, "research")
builder.add_node(local_agent, "summarize")
builder.add_edge("research", "summarize")
graph = builder.build()
result = graph("Analyze recent AI trends")
Interrupts now propagate correctly through nested multi-agent graph nodes. When an agent inside a nested Graph, Swarm, or any custom MultiAgentBase node raises an interrupt, the outer graph pauses execution and surfaces the interrupt to the caller. After the caller provides a response, the outer graph resumes execution from where it left off. This builds on the interrupt support for single-agent graph nodes added in v1.24.0.
from strands import Agent, tool
from strands.interrupt import Interrupt
from strands.multiagent import GraphBuilder, Status
from strands.types.tools import ToolContext
@tool(context=True)
def approval_tool(tool_context: ToolContext) -> str:
return tool_context.interrupt("approval", reason="Needs human approval")
agent = Agent(name="reviewer", tools=[approval_tool])
inner_graph = GraphBuilder()
inner_graph.add_node(agent, "reviewer")
outer_graph = GraphBuilder()
outer_graph.add_node(inner_graph.build(), "review_pipeline")
graph = outer_graph.build()
result = graph("Review this document")
while result.status == Status.INTERRUPTED:
responses = [
{"interruptResponse": {"interruptId": i.id, "response": "Approved"}}
for i in result.interrupts
]
result = graph(responses)
Media content types now support S3 locations as a source, allowing you to reference documents, images, and videos stored in Amazon S3 directly without base64 encoding. The new S3Location type includes a required uri field and an optional bucketOwner field for cross-account access. On Bedrock, S3 locations are passed through to the API natively.
from strands import Agent
agent = Agent()
response = agent([{
"role": "user",
"content": [
{"text": "Summarize this document:"},
{
"document": {
"format": "pdf",
"name": "report",
"source": {
"location": {
"type": "s3",
"uri": "s3://my-bucket/documents/report.pdf",
"bucketOwner": "123456789012" # optional, for cross-account
}
}
}
}
]
}])
The prompt message the agent uses to request structured output formatting is now configurable via the structured_output_prompt parameter. Previously, the hardcoded message "You must format the previous response as structured output." could trigger Bedrock Guardrails prompt-attack filters. You can now customize this message at the agent level or per invocation to work around guardrail rules or to better suit your use case.
from strands import Agent
from pydantic import BaseModel
class UserInfo(BaseModel):
name: str
age: int
# Custom prompt avoids triggering Bedrock Guardrails prompt attack filter
agent = Agent(
structured_output_model=UserInfo,
structured_output_prompt="Please use the output tool now."
)
# Or override per invocation
result = agent(
"Extract user info from: John is 30 years old",
structured_output_prompt="Format the response using the output tool."
)
Nullable Semantics Preserved for Required Union[T, None] Tool Parameters - PR#1584
When a @tool parameter was typed as T | None without a default value, the schema cleaning logic was stripping null from the anyOf array, making the field required with no way to express null. This caused LLMs to fall back to passing "null" as a string. The anyOf simplification is now skipped for fields in the required array, preserving proper nullable semantics.
LedgerProvider Now Handles Parallel Tool Calls Correctly - PR#1559
When agents proposed multiple tool calls in a single model response, the ledger provider only updated the last tool in the batch (ledger['tool_calls'][-1]), leaving earlier pending tools without proper status updates. The provider now correctly tracks and updates each individual tool call.
Context Overflow Detection for OpenAI-Compatible Bedrock Endpoints - PR#1529
OpenAI-compatible endpoints that wrap Bedrock models (e.g., Databricks Model Serving) return Bedrock-style error messages like "Input is too long for requested model" as APIError instead of BadRequestError with code context_length_exceeded. These errors are now detected and converted to ContextWindowOverflowException, allowing conversation managers like SummarizingConversationManager to trigger properly.
retry_strategy=None Now Disables Retries - PR#1630
Passing retry_strategy=None to the Agent constructor previously applied the default retry strategy instead of disabling retries. Now None explicitly disables all SDK retries (equivalent to ModelRetryStrategy(max_attempts=1)), while omitting the parameter entirely still applies the default strategy. Note: This is a minor breaking change in behavior for code that explicitly passed None.
A2A Server Agent Card URL Updated on Host/Port Override - PR#1626
When overriding host and port in A2AServer.serve(), the agent card at /.well-known/agent-card.json still returned the original URL from constructor defaults, causing A2A clients to connect to the wrong address. The server now updates the agent card URL to match the overridden host/port, unless an explicit http_url was provided in the constructor.
actions/setup-python from 4 to 6 - PR#1548aws-actions/configure-aws-credentials from 4 to 5 - PR#1547actions/download-artifact from 4 to 7 - PR#1609actions/upload-artifact from 4 to 6 - PR#1608Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.24.0...v1.25.0
test: fix flaky openai structured output test by adding Field guidance by @dbschmigelski in https://github.com/strands-agents/sdk-python/pull/1534
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.23.0...v1.24.0
Agents now support customizable retry behavior when handling model throttling exceptions. The new ModelRetryStrategy class allows you to configure max
Agents now support customizable retry behavior when handling model throttling exceptions. The new ModelRetryStrategy class allows you to configure maximum retry attempts, initial delay, and maximum delay, replacing the previously hardcoded retry logic.
from strands import Agent, ModelRetryStrategy
agent = Agent(
model="anthropic.claude-3-sonnet",
retry_strategy=ModelRetryStrategy(
max_attempts=3,
initial_delay=2,
max_delay=60
)
)
Steering handlers can now intercept and guide model responses through the new steer_after_model() method. This enables validation of model outputs, enforcement of required tool usage, and conversation flow control based on model responses before the agent completes.
from strands.experimental.steering import Guide, Proceed, SteeringHandler
class ForceToolUsageHandler(SteeringHandler):
def __init__(self, required_tool: str):
super().__init__()
self.required_tool = required_tool
async def steer_after_model(self, *, agent, message, stop_reason, **kwargs):
if stop_reason != "end_turn":
return Proceed(reason="Model still processing")
# Check if required tool was used
for block in message.get("content", []):
if "toolUse" in block and block["toolUse"].get("name") == self.required_tool:
return Proceed(reason="Required tool was used")
# Force tool usage
return Guide(reason=f"You MUST use the {self.required_tool} tool.")
agent = Agent(tools=[log_tool], hooks=[ForceToolUsageHandler("log_activity")])
The BeforeInvocationEvent hook now exposes the input messages through a new messages parameter, enabling preprocessing, guardrails, and filters to run before the agent processes user input.
from strands import Agent
from strands.hooks import HookProvider, BeforeInvocationEvent
class PreprocessingHook(HookProvider):
def register_hooks(self, registry):
registry.add_callback(BeforeInvocationEvent, self.preprocess)
def preprocess(self, event):
# Access input messages for preprocessing
messages = event.messages
# Apply guardrails or filters here
pass
agent = Agent(hooks=[PreprocessingHook()])
BidiAgent now supports Amazon Nova Sonic v2 models with enhanced features including the turn_taking parameter and improved text input handling for bidirectional voice conversations.
from strands.experimental.bidi.models import BidiNovaSonicModel
from strands.experimental.bidi import BidiAgent
model = BidiNovaSonicModel(model_id="us.amazon.nova-sonic-v2:0")
agent = BidiAgent(model=model)
Graph nodes can now be interrupted from BeforeNodeCallEvent hooks, enabling approval workflows and human-in-the-loop validation before specific agents execute in multi-agent graphs.
from strands import Agent
from strands.hooks import HookProvider, BeforeNodeCallEvent
from strands.multiagent import GraphBuilder, Status
class ApprovalHook(HookProvider):
def register_hooks(self, registry):
registry.add_callback(BeforeNodeCallEvent, self.approve)
def approve(self, event):
if event.node_id == "info_agent":
return
response = event.interrupt("my_interrupt", reason=f"{event.node_id} needs approval")
if response != "APPROVE":
event.cancel_node = "node rejected"
builder = GraphBuilder()
builder.add_node(info_agent, "info_agent")
builder.add_node(weather_agent, "weather_agent")
builder.add_edge("info_agent", "weather_agent")
builder.set_hook_providers([ApprovalHook()])
graph = builder.build()
result = graph("What is the weather?")
while result.status == Status.INTERRUPTED:
# Handle interrupts and resume with responses
result = graph(interrupt_responses)
Multiagent hook events (BeforeNodeCallEvent, AfterNodeCallEvent) have been promoted from experimental to the stable API. These events are now available directly from strands.hooks without the experimental import path.
from strands.hooks import BeforeNodeCallEvent, AfterNodeCallEvent, HookProvider
class MyMultiagentHook(HookProvider):
def register_hooks(self, registry):
registry.add_callback(BeforeNodeCallEvent, self.before_node)
registry.add_callback(AfterNodeCallEvent, self.after_node)
def before_node(self, event):
print(f"Starting node: {event.node_id}")
def after_node(self, event):
print(f"Completed node: {event.node_id}")
from __future__ import annotations, which caused PydanticUserError due to unresolved string type annotations.Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.22.0...v1.23.0
Deprecation Warning on Import - PR#1380 Fixed unwanted deprecation warnings appearing when importing strands by using lazy __getattr__ to emit warning…
The MCP client now supports resource operations, enabling agents to list, read, and work with resources provided by MCP servers. This includes static resources, binary resources, and parameterized resource templates.
from strands.tools.mcp import MCPClient
with MCPClient(server_transport) as client:
# List available resources
resources = client.list_resources_sync()
for resource in resources.resources:
print(f"Resource: {resource.name} at {resource.uri}")
# Read a specific resource
content = client.read_resource_sync("file://documents/report.txt")
text = content.contents[0].text
# List resource templates (parameterized resources)
templates = client.list_resource_templates_sync()
for template in templates.resourceTemplates:
print(f"Template: {template.uriTemplate}")
Bedrock models now support the guardrail_latest_message parameter, which sends only the latest user message to AWS Bedrock Guardrails for evaluation instead of the entire conversation history. This reduces token usage and enables conversation recovery after guardrail interventions.
from strands.models.bedrock import BedrockModel
model = BedrockModel(
model_id="us.anthropic.claude-sonnet-4-20250514-v1:0",
guardrail_id="your-guardrail-id",
guardrail_version="DRAFT",
guardrail_latest_message=True # Only evaluate the latest user message
)
See the Bedrock Guardrails documentation for more details.
The LiteLLM model provider now correctly handles non-streaming responses, fixing an issue where stream=False would raise an error. Both streaming and non-streaming modes now work seamlessly.
from strands.models.litellm import LiteLLMModel
# Use non-streaming mode for simpler response handling
model = LiteLLMModel(
model_id="gpt-3.5-turbo",
params={"stream": False}
)
# Works correctly now - no more ValueError
agent = Agent(model=model)
result = agent("What is 2+2?")
Concurrent Agent Invocations - PR#1453
Fixed critical agent state corruption when multiple concurrent invocations occurred on the same agent instance. A new ConcurrencyException is now raised to prevent concurrent invocations and protect agent state integrity.
Gemini Empty Stream Handling - PR#1420
Fixed UnboundLocalError crash when Gemini returns an empty event stream by properly initializing variables before the stream loop.
Deprecation Warning on Import - PR#1380
Fixed unwanted deprecation warnings appearing when importing strands by using lazy __getattr__ to emit warnings only when deprecated aliases are actually accessed.
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.21.0...v1.22.0
fix: check api breaking change against main by @JackYPCOnline in https://github.com/strands-agents/sdk-python/pull/1397
The OpenAI and Gemini model providers now accept a pre-configured client via the client parameter, enabling connection pooling, proxy configuration, custom timeouts, and centralized observability across all model requests. The client is reused for all requests and its lifecycle is managed by the caller, not the model provider.
from strands.models.openai import OpenAIModel
import httpx
# Create custom client with proxy and timeout configuration
custom_client = httpx.AsyncClient(
proxy="http://proxy.example.com:8080",
timeout=60.0
)
model = OpenAIModel(model_id="gpt-4o-mini", client=custom_client)
Gemini models now support native Google tools like GoogleSearch and CodeExecution through the gemini_tools parameter. These tools integrate directly with Gemini's API without requiring custom function implementations, enabling agents to search the web and execute code natively.
from strands.models.gemini import GeminiModel
from google.genai import types
model = GeminiModel(
model_id="gemini-2.0-flash-exp",
gemini_tools=[types.Tool(google_search=types.GoogleSearch())]
)
Hooks can now retry model invocations by setting event.retry = True in the AfterModelCallEvent handler, enabling custom retry logic for transient errors, rate limits, or quality checks. This provides fine-grained control over model retry behavior beyond basic exception handling.
class RetryOnServiceUnavailable(HookProvider):
def __init__(self, max_retries=3):
self.max_retries = max_retries
self.retry_count = 0
def register_hooks(self, registry, **kwargs):
registry.add_callback(BeforeInvocationEvent, self.reset_counts)
registry.add_callback(AfterModelCallEvent, self.handle_retry)
def reset_counts(self, event = None):
self.retry_count = 0
async def handle_retry(self, event):
if event.exception:
if "ServiceUnavailable" in str(event.exception):
logger.info("ServiceUnavailable encountered")
count = self.retry_count
if count < self.max_retries:
logger.info("Retrying model call")
self.retry_count = count + 1
event.retry = True
await asyncio.sleep(2 ** count) # Exponential backoff
else:
# reset counts in the succesful case
self.reset_counts(None)
Conversation managers now support mid-execution management via the per_turn parameter, applying conversation window management before each model call rather than only at the end. This prevents context window overflow during multi-turn conversations with tools or long responses.
from strands import Agent
from strands.agent.conversation_manager import SlidingWindowConversationManager
# Enable management before every model call
manager = SlidingWindowConversationManager(
per_turn=True,
window_size=40
)
# Or manage every N turns
manager = SlidingWindowConversationManager(
per_turn=3, # Manage every 3 model calls
window_size=40
)
agent = Agent(model=model, conversation_manager=manager)
Metrics now track per-invocation data through agent_invocations and latest_agent_invocation properties, providing granular insight into each agent call's performance, token usage, and execution time. This enables detailed performance analysis for multi-invocation workflows.
from strands import Agent
agent = Agent(model=model)
result = agent("Analyze this data")
# Access invocation-level metrics
latest = result.metrics.latest_agent_invocation
print(f"Cycles: {len(latest.cycles)}")
print(f"Tokens: {latest.usage}")
# Access all invocations
for invocation in result.metrics.agent_invocations:
print(f"Invocation usage: {invocation.usage}")
The ToolRegistry now supports replacing existing tools via the replace() method, enabling dynamic tool updates without re-registering all tools. This is particularly useful for hot-reloading tool implementations or updating tools based on runtime conditions.
from strands.tools.registry import ToolRegistry
from strands import tool
registry = ToolRegistry()
@tool
def calculate(x: int, y: int) -> int:
"""Calculate sum."""
return x + y
registry.register_tool(calculate)
# Later, replace with updated implementation
@tool
def calculate(x: int, y: int) -> int:
"""Calculate product (new implementation)."""
return x * y
registry.replace(calculate)
Citations now support web locations (WebLocation) and search result positions (SearchResultLocation), enabling agents to reference specific URLs and search result indices when grounding responses in retrieved information.
from strands.types.citations import WebLocation, SearchResultLocation
# Create web location citation
web_citation: WebLocation = {
"url": "https://docs.example.com/api",
"domain": "docs.example.com"
}
# Create search result citation
search_citation: SearchResultLocation = {
"searchResultIndex": 0,
"start": 150,
"end": 320
}
A2A servers now support passing additional kwargs to FastAPI and Starlette app constructors via app_kwargs, enabling customization of documentation URLs, debug settings, middleware, and other application-level configuration.
from strands.multiagent.a2a import A2AServer
server = A2AServer(agent)
# Customize FastAPI app
app = server.to_fastapi_app(
app_kwargs={
"title": "My Custom Agent API",
"docs_url": None, # Disable docs
"redoc_url": None # Disable redoc
}
)
# Customize Starlette app
app = server.to_starlette_app(
app_kwargs={"debug": True}
)
Citation Streaming and Union Type Fix - PR#1341
Fixed CitationLocation to properly handle union types and correctly join citation chunks during streaming, resolving issues where citations were malformed or lost in streamed responses.
Usage Metrics Double Counting - PR#1327
Fixed telemetry double counting of usage metrics, ensuring accurate token usage tracking and preventing inflated cost calculations.
Tools Returning Image Content - PR#1079
Fixed OpenAI model provider to properly support tools that return image content, enabling vision-capable tools to work correctly.
Deprecation Warning Timing - PR#1380
Fixed deprecation warnings to only emit when deprecated aliases are actually accessed, eliminating spurious warnings for users not using deprecated features.
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.20.0...v1.21.0
Swarm multi-agent systems now support interrupts, enabling Human-in-the-Loop patterns for approval workflows and user interaction during agent executi
Swarm multi-agent systems now support interrupts, enabling Human-in-the-Loop patterns for approval workflows and user interaction during agent execution. Interrupts can be triggered via BeforeNodeCallEvent hooks or directly within agent tools using ToolContext.
from strands import Agent, tool
from strands.experimental.hooks.multiagent import BeforeNodeCallEvent
from strands.hooks import HookProvider
from strands.multiagent import Swarm
from strands.multiagent.base import Status
# Example 1: Interrupt via Hook
class ApprovalHook(HookProvider):
def register_hooks(self, registry):
registry.add_callback(BeforeNodeCallEvent, self.approve)
def approve(self, event):
response = event.interrupt("approval", reason=f"{event.node_id} needs approval")
if response != "APPROVE":
event.cancel_node = "rejected"
swarm = Swarm([agent1, agent2], hooks=[ApprovalHook()])
result = swarm("Task requiring approval")
# Handle interrupts
while result.status == Status.INTERRUPTED:
for interrupt in result.interrupts:
user_input = input(f"{interrupt.reason}: ")
responses = [{"interruptResponse": {"interruptId": interrupt.id, "response": user_input}}]
result = swarm(responses)
# Example 2: Interrupt via Tool
@tool(context=True)
def get_user_info(tool_context: ToolContext) -> str:
response = tool_context.interrupt("user_info", reason="need user name")
return f"User: {response}"
user_agent = Agent(name="user", tools=[get_user_info])
swarm = Swarm([user_agent])
result = swarm("Who is the user?")
# Resume with interrupt response as shown above
See the interrupts documentation for more details.
Hooks can now access the complete AgentResult in AfterInvocationEvent, enabling post-invocation actions based on the agent's output, stop reason, and metrics. This enhancement allows for richer observability and custom handling of agent results.
from strands import Agent
from strands.hooks import AfterInvocationEvent, HookProvider
class ResultLoggingHook(HookProvider):
def register_hooks(self, registry):
registry.add_callback(AfterInvocationEvent, self.log_result)
def log_result(self, event: AfterInvocationEvent):
# Access the complete AgentResult
if event.result:
print(f"Stop reason: {event.result.stop_reason}")
print(f"Tokens used: {event.result.usage}")
print(f"Response: {event.result.text}")
agent = Agent(hooks=[ResultLoggingHook()])
result = agent("What is 2+2?")
Structured Output Display Fix - PR#1290
Fixed AgentResult.__str__() to return structured output JSON when no text content is present, resolving issues where print(agent_result) showed empty output and structured output was lost in multi-agent graph propagation.
Tool Spec Composition Keywords Fix - PR#1301
Fixed tool specification handling for JSON Schema composition keywords (anyOf, oneOf, allOf, not), preventing models from incorrectly returning string-encoded JSON for optional parameters like Optional[List[str]].
MCP Client Resource Leak Fix - PR#1321
Fixed file descriptor leak in MCP client by properly closing the asyncio event loop, preventing resource exhaustion in multi-tenant applications that create many MCP clients.
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.19.0...v1.20.0
Bidirectional Agents (Experimental): This release introduces BidiAgent for real-time voice conversations with AI agents through persistent connections
Bidirectional Agents (Experimental): This release introduces BidiAgent for real-time voice conversations with AI agents through persistent connections that support continuous audio streaming, natural interruptions, and concurrent tool execution. This experimental feature allows developers to build voice assistants and interactive applications with support for Amazon Nova Sonic, OpenAI Realtime API, and Google Gemini Live.
Steering (Experimental): Enables modular prompting with progressive disclosure for complex agent workflows through just-in-time feedback loops. Instead of front-loading all instructions into monolithic prompts, steering handlers provide contextual guidance that appears when relevant, maintaining agent effectiveness on multi-step tasks while preserving adaptive reasoning capabilities.
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.18.0...v1.19.0
multi agent input by @pgrayy in https://github.com/strands-agents/sdk-python/pull/1196
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.17.0...v1.18.0
You can now set custom timeout values when creating MCP (Model Context Protocol) agent tools, providing better control over tool execution time limits
You can now set custom timeout values when creating MCP (Model Context Protocol) agent tools, providing better control over tool execution time limits and improving reliability when working with external MCP servers.
from datetime import timedelta
from strands.tools.mcp import MCPAgentTool
# Create MCP tool with custom 30-second timeout
mcp_tool = MCPAgentTool(
...,
timeout=timedelta(seconds=30)
)
agent = Agent(tools=[mcp_tool])
This feature is especially useful when working with MCP servers that may have varying response times, allowing you to fine-tune timeout behavior for different use cases.
Swarm Handoff Timing - PR#1147
Fixed swarm handoff behavior to only switch to the handoff node after the current node completes execution. Previously, the switch occurred mid-execution, causing incorrect event emissions and invalid swarm state when tools were interrupted concurrently with handoff tools.
LiteLLM Stream Parameter Validation - PR#1183
Added validation for the stream parameter in LiteLLM to prevent TypeError when stream=False is provided. The SDK now properly handles both streaming and non-streaming responses with clear error messaging.
Optional MetadataEvent Fields - PR#1187
Fixed handling of MetadataEvents when custom model implementations omit optional usage or metrics fields. The SDK now provides sensible defaults, preventing KeyError exceptions and enabling greater flexibility for custom model providers.
A2A Protocol File Data Decoding - PR#1195
Fixed A2A (Agent-to-Agent) executor to properly base64 decode file bytes from A2A messages before passing to Strands agents. Previously, agents were receiving base64-encoded strings instead of actual binary file content.
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.16.0...v1.17.0
Hooks now support asynchronous callbacks, allowing your hook code to run concurrently with other async tasks without blocking the event loop. This is
Hooks now support asynchronous callbacks, allowing your hook code to run concurrently with other async tasks without blocking the event loop. This is particularly beneficial for async agent invocations and scenarios where hooks perform I/O operations.
import asyncio
from strands import Agent
from strands.hooks import BeforeInvocationEvent, HookProvider, HookRegistry
class AsyncHook(HookProvider):
def register_hooks(self, registry: HookRegistry, **kwargs) -> None:
registry.add_callback(BeforeInvocationEvent, self.async_callback)
async def async_callback(self, event: BeforeInvocationEvent) -> None:
# Perform async operations without blocking the event loop
await asyncio.sleep(1)
print("Hook executed asynchronously!")
agent = Agent(hooks=[AsyncHook()])
await agent.invoke_async("Hello!")
Context variables (contextvars) are now automatically copied from the main thread to agent threads when using synchronous invocations. This ensures that context-dependent tools and hooks work correctly.
from contextvars import ContextVar
from strands import Agent, tool
request_id = ContextVar('request_id')
@tool
def my_tool():
# Context variables are now accessible within tools
current_request_id = request_id.get()
return f"Processing request: {current_request_id}"
request_id.set("abc-123")
agent = Agent(tools=[my_tool])
response = agent.invoke_async("Use my tool") # Context is properly propagated
Tool definitions are now included in OpenTelemetry traces via semantic convention opt-in, providing better observability into agent tool usage, following the OpenTelemetry semantic conventions for GenAI.
Opt-in via environment variable:
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_tool_definitions
from strands import Agent, tool
from strands_tools import calculator
# Tool definition will appear in telemetry traces
agent = Agent(tools=[calculator])
agent("What is 5 + 3?")
You can now use simple string descriptions directly in Annotated type hints for tool parameters, improving code readability and reducing boilerplate.
from typing import Annotated
from strands import tool
@tool
def get_weather(
location: Annotated[str, "The city and state, e.g., San Francisco, CA"],
units: Annotated[str, "Temperature units: 'celsius' or 'fahrenheit'"] = "celsius"
):
"""Get weather for a location."""
return f"Weather in {location}: 72°{units[0].upper()}"
# Previously required more verbose Field() syntax or using a doc-string
Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.15.0...v1.16.0
One column per month.