pypi / ag2
ag2
What changed in ag2 0.10 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
56 breaking19 security33 deprecations250 new APIs and options2 performance46 behavior and defaults2 tooling168 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initag2 1261 changes
Breaking changes 44
The
acpextra now requires agent-client-protocol>=1.0.0,<2; 0.12.x is no longer supported.A turn ending on a final tool result or client-tool handoff now ends there even if input was queued; queued input goes to the next turn.
ag2.acp.AuthMethod no longer supports the env-var method removed by the SDK.
BridgeState.turn_text is replaced by turn_messages.
Inline media values in DataSource.value and encryptedValue are decoded strictly; invalid Base64, including whitespace and line breaks, receives 400 before the stream starts.
Thought summaries arrive as ModelReasoning instead of being included in reply text.
ACP emits each message chunk as its own ModelMessage event instead of joining a turn's chunks into one string.
In ACP, reply.body is now the agent's final message rather than everything it said.
Token usage is normalized across providers: prompt_tokens includes cache reads and writes, cache token fields are parts of it, and total_tokens is at least prompt_tokens plus completion_tokens. Gemini Live thinking tokens count toward completion_tokens.
Composes a store, the knowledge tool, bootstrap, and event logging; compaction and aggregation are configured through the plugin with corresponding triggers.
AG2 1.3 requires Python 3.11 or newer; environments using Python 3.10 must upgrade.
Fresh root invocations copy their input values, so callers should read results from reply.context.variables rather than their original containers.
Plain values are deep-copied for each branch by default.
Original descendant usage records reach ancestors as they arrive with source identity and are counted once; new delegation rollups are no longer generated.
Supports Anthropic SDK 2.x; the extra now requires anthropic>=1.15.0,<3.
Rejects non-string dataset tags.
The OpenAI SDK requirement is now openai>=3.37.0,<4.
Provides the current Chat Completions behavior as the replacement for OpenAIConfig.
Rejects empty old_content when updating non-empty files.
The ElevenLabs integration now requires elevenlabs>=2.73.0,<3.
Can now return an Input or a sequence of them, so custom channel adapters may need changes.
Tool calls use the configuration that discovered the tool; a Variable(default_factory=...) can no longer route a call to a different server.
Mistral support uses mistralai 3.2 and exposes its new chat parameters; the extra requires mistralai>=3.2.0,<4.
The async_client type is now httpx2.AsyncClient; httpx.AsyncClient still works at runtime but no longer type-checks.
The shell refuses ignored files named through a wildcard.
The
|operator creates an independent toolkit collection: tools retain their existing middleware, and source middleware is not inherited by tools from the other side or later additions.Approval grants are now keyed by tool implementation, binding approval to the specific implementation.
The bedrock extra installs aiobotocore>=3.9.1,<4 instead of boto3; applications that also install boto3 must choose a compatible botocore version.
The session parameter now requires an aiobotocore AioSession; a boto3.Session fails on the first call.
The context() tool now rejects non-positive limit and recent_n values.
readonly mode now allows only commands that cannot write files or run other programs; several commands were removed from its built-in set.
With allowed or readonly enabled, commands are split into argv, checked, and run without a shell; shell syntax is refused and expansions cannot bypass the allow-list.
Each turn exposes one tool per name; later code-declared tools win, while runtime MCP and client tools rank below code-declared tools.
Reserved ag: and a2a: keys are stripped in both directions across A2A, AG-UI, A2UI and NLIP; dropped inbound keys are logged as warnings, and outbound keys are removed before transmission.
A turn now fails instead of waiting indefinitely when nobody can answer a human-input request.
Every AG2 MCP client and server surface now targets the MCP 2.0 protocol.
The dependency bound is now mcp>=2.0.0,<3; update pins below 2.0 before upgrading.
The integration is adapted to TinyFish 0.5 per-product hosts and pinned to the 0.5 release line.
The top-level package is now imported as ag2; the autogen import name is no longer shipped by this repository.
as_tool(stream=...) accepts a Stream instance and rejects invalid types loudly instead of silently.
The autogen import name is no longer shipped by this repository; Classic remains available from its own distribution.
The beta namespace is gone; its contents moved to the top-level ag2 package.
The classic CLI has been removed.
Failures previously discarded silently now surface, so developers should review error handling that relied on the old behavior.
Security 5
Shell command-filter bypasses are fixed.
A new TealTiger policy inspects tool output after the call, so disallowed results can be caught on the way back.
TealTiger governance adds prompt injection detection to its policy set.
Served agent cards are signed and consumed cards are verified, allowing agents to establish that a card came from who it claims.
Transport security is available for agent-to-agent communication over gRPC.
Deprecations 12
Agent(assembly=...) continues to work with deprecation warnings and is scheduled for removal in 1.4.0; register AssemblerMiddleware through middleware= and add HaltCheckMiddleware when using AlertPolicy.
Agent(knowledge=...) continues to work with deprecation warnings and is scheduled for removal in 1.4.0; use plugins=[KnowledgePlugin(...)].
Agent(tasks=...) and Agent.tasks continue to work with deprecation warnings and are scheduled for removal in 1.4.0; construct workers explicitly and delegate through Agent.as_tool().
Continues to work with deprecation warnings and is scheduled for removal in 1.4.0; construct Task(owner_id=..., spec=TaskSpec(...)) directly for standalone work.
Will become an alias for OpenAIResponsesConfig in 1.4; use OpenAIResponsesConfig or OpenAICompletionsConfig explicitly.
The automatically injected tool continues to work with deprecation warnings and is scheduled for removal in 1.4.0; delegate through Agent.as_tool().
Continues to work with deprecation warnings and is scheduled for removal in 1.4.0; construct workers explicitly and delegate through Agent.as_tool().
temperature is deprecated until 1.4.0; SDK 2.x warns and drops it, while SDK 1.x warns and still sends it.
top_k is deprecated until 1.4.0; SDK 2.x warns and drops it, while SDK 1.x warns and still sends it.
top_p is deprecated until 1.4.0; SDK 2.x warns and drops it, while SDK 1.x warns and still sends it.
Deprecated ahead of the 1.4.0 Responses API change; create() emits a DeprecationWarning. Use OpenAICompletionsConfig to keep Chat Completions or OpenAIResponsesConfig to move now.
AG2 Classic now lives in a separate repository and remains installable and maintained; use its distribution rather than upgrading to ag2>=1.0 for existing Classic code.
New APIs and options 93
PermissionPolicy is now exported from ag2.acp.
Enables lifecycle events for ask, run, or resume with a capability value.
Ancestors receive descendant events, including streamed chunks; typed observer callbacks can monitor them without triggering ancestor model or tool handling.
An observed event exposes a live handle to the invocation that authored it, allowing delivery through that invocation's normal handlers.
Controls resumption of responses that reach the per-request token limit.
Retained events can be filtered by type and conditions, selected by first or last match, or counted; since_last_user_input limits queries to the latest user-input interval.
Configures the maximum accepted event size for tool results.
Keeps a value from being inherited by descendants.
Shares one binding across an invocation tree, including replacement of its value; applications provide synchronization for concurrent updates.
Defines whether values are copied per branch, local to an agent, or shared across an invocation tree.
Provides current facts before the model's next decision; callbacks support dependency injection and can persist snapshots as service observations.
Captures the complete ordered model input for each call.
Enables lifecycle events with an expiry deadline for an external observer; it does not impose a local execution timeout.
Updates A2UI to the current spec, including callAgentFunction, agentFunctionResponse and renderer capabilities.
Adds an option to configure or disable the Anthropic SDK's own OpenTelemetry spans.
Adds a typed speed option to AnthropicConfig.
Adds a paid-data toolkit extension.
Adds a timeout that limits each callback.
Adds a timeout that limits each observer callback.
Accepts question_instructions as strings, ag2 inputs or SDK parts, and appends them to the agent prompt.
Provides a way to move to the Responses API now.
Adds a timeout that limits each stream subscriber callback.
Adds a per-invocation timeout for function tool calls; timed-out calls return a TimeoutError to the model, which can continue.
Adds support for Box questions with a BoundingBox response schema.
Adds an extension that measures whether a CompactStrategy makes the agent's next actions worse, not just how many tokens it saves.
The ElevenLabs integration supports Scribe and TTS options.
Adds a Firecrawl search and scrape toolkit.
Adds a Keenable search toolkit.
Adds realtime Mistral speech-to-text support in ag2.live.
Adds a streaming Mistral text-to-speech configuration.
Adds offline Mistral speech-to-text support in ag2.live.
Adds a Mistral text-to-speech configuration.
Accepts a reasoning option for configuring effort and summaries.
ResponseSchema(BoundingBox) enables TypeSafe Box questions to locate objects in images.
Agent cards can be cacheable.
Cache diagnostics support is available in the Anthropic client and config.
Input media type validation is available as an opt-in.
Ollama supports configuring an API key.
Ollama supports a custom HTTP client.
Ollama supports configuring tool names.
OpenAI voice configs accept explicit API keys.
OpenAI Decisions API support is available through OpenAIDecisionsConfig.
Push notification URL validation is exposed and can be configured.
The
Questionmarker is available for shared decision schemas used with OpenAI and TypeSafe.AG-UI serves version 1.0.
Plugins can be scoped to an invocation.
A tool in a served agent can ask a human a question through context.input(); the question arrives as the AG-UI run's interrupt outcome and the answer comes in the next run's resume.
Install this extra to use the TypeSafe Jev provider.
ConversationContext.enqueue() announces a transient event after appending to an agent's inbox, allowing a live session to react between model responses.
Adds TypeSafe Jev support for decision-only agents; response schemas express typed questions, with probabilities and confidence on ModelMessage.metadata. Tools and streaming are unsupported.
A served agent can own its HTTP transport settings.
Prompt cache controls are exposed for OpenAI chat and responses.
Adds diagnostics for OpenAI prompt caching.
Adds a rate_limit governance policy for tealtiger.
You can control which sources supply URLs that web-fetch can fetch.
AG2 can now serve MCP Apps, with structured tool output and extension support.
A new built-in tool provides improved event handling for Anthropic.
TealTiger governance can validate tool arguments before the call runs.
Concurrent task fan-out to subagents can be bounded to set a ceiling on how many run at once.
Toolkit tools can be namespaced to prevent tools from different toolkits colliding on name.
AG2 supports the OpenAI SDK 3.x line, including hosted shell and MCP events.
The function is now exported so developers can turn spans into traces in their own tooling.
An AG2 Agent served over ACP can resume a prior session rather than starting fresh on every connection.
TealTiger governance can deny specific tools by pattern, as an alternative to enumerating permitted tools.
A new community search extension is available.
MCP servers can now expose metadata about themselves.
Define user extensions on top of the A2A protocol.
Any AG2 Agent can now be exposed as an ACP agent for ACP clients to drive.
ACP agents can be driven across a network boundary over HTTP and WebSocket, with support for answering their questions mid-task.
ACP configurations add Kilo Code support and model selection.
An agent's composition is exposed as read-only properties for inspection without reaching into internals.
ElevenLabs is available as a realtime voice provider for LiveAgent.
Gemini now supports HEIC and HEIF image inputs.
Middleware can report its configuration, making a middleware stack inspectable at runtime.
A community extension provides deterministic governance as middleware.
A community extension provides sandbox integration for isolated execution.
Adds full Mistral SDK support, including streaming, multi-modality, and structured outputs.
Adds MistralConfig for the Mistral API.
Adds Agent Client Protocol support for driving CLI coding agents.
Adds support for a new Anthropic code_execution version.
Adds FileSearchTool support for OpenAI Responses.
Gemini FileSearchTool now supports store search.
Adds Gemini GoogleMapsTool grounding.
Exposes AG2 tools to CLI coding agents through an MCP tool gateway.
Adds support for the MCP UI extension.
Adds tracing across the multi-agent network.
Adds integration for the Natural Language Interaction Protocol.
Adds support for exporting metrics to a Prometheus scrape endpoint.
Agents can discover and load tools on demand instead of holding the full tool surface in context up front.
Adds SkillsTool support for OpenAI Responses.
__version__ is now exported at the top level of the package.
Adds a tweet search toolkit.
Adds Files API support for the Z.AI provider.
Performance 1
persistent_stream() now reuses a single stream object rather than creating one per call.
Behavior and default changes 27
Python 3.15 is now supported; installing ag2 on that version builds PyYAML from source and requires a C compiler.
A flat dataclass, TypedDict, or Pydantic model can represent several decision questions in one request; unsupported class schemas are rejected locally.
Sends a reply's text over one connection per reply.
Model runs, delegations, and standalone Task blocks share lifecycle transitions; lifecycle events can be enabled for ask, run, or resume.
Anthropic continuation tokens are now included in token usage counts.
Gemini thinking tokens are now included in token usage counts.
xAI reasoning tokens are now included in token usage counts.
render_envelope can now return an Input or a sequence of them, so custom channel adapters may need changes.
A2A servers can run on several replicas.
Anthropic-only web-fetch options are gated by version.
MemorySkill renders its body anew on each read.
Events retain the identifier returned by the provider.
Chat spans now record the full history and tool-call output, rather than a partial view.
AG-UI stream events now carry token usage reporting.
Tool spans record structured and multi-part tool results instead of flattening them.
ACP is upgraded to protocol version 0.12.1.
Conversation handling is updated for the MCP 2.0 model.
An ACP host driving a served AG2 Agent can answer human-input requests raised mid-task.
ACP is upgraded to protocol version 0.12.
Unknown fields now produce a warning instead of being dropped silently.
Durable reasoning items are kept in ConversationPolicy.
Built-in tools now work alongside function calling.
AG2 1.0.1 pins mcp to <2 until compatibility with MCP 2.0 is implemented.
OpenAI encrypted reasoning content is requested when store is false, allowing reasoning to survive without server-side retention.
Read paths are serialized with the connection lock.
UsageEvent telemetry is excluded from history compaction via the __conversational__ marker.
Perplexity requests now send an X-Pplx-Integration attribution header.
Fixes and other changes 79
ACP preserves text and blob resources, resource links, and the structure of tool results.
Sessions left open when the event loop shuts down no longer fail with
asynchronous generator is already running; client configs work withoutasync with.ACP resolves cwd and additional_directories to absolute paths when a session starts.
Fixes reconnect recovery, artifact reconciliation, and cancellation racing completion.
Child processes are now stopped on cancellation, timeout, and close.
Resolves the enclosing task correctly under concurrent sibling tasks.
Final tool batches are retained for correct conversation replay and continuation.
Preserves the artifact type for empty text artifacts.
Maps OpenAI cache_write_tokens to cache_creation_input_tokens for token usage reporting.
Checks the final response when attributing failures.
Fixes streamed completion choice isolation.
Accepts SKILL.md files that start with a UTF-8 BOM.
Preserves explicitly provided empty storage.
ACP keeps input parts separate and sends each part as its own content block based on what the agent advertises; previously non-text parts were dropped.
Removes empty parent directories after deletion.
File listing now enumerates all pages.
File operations honor the configured HTTP client.
Function call IDs are preserved in Gemini history.
It does not catch errors raised by httpx2.
Accepts os.PathLike values.
Lock paths are normalized.
Watchers are notified of both renamed paths.
Response handling accepts Literal schemas.
Explicit media types are honored for local paths.
Multipart tool results are serialized as text.
Tool call IDs remain unique across turns.
Rejects files uploaded to another provider with UnsupportedInputError.
Accepts empty text, raw, and URL parts.
Threshold keys are applied to passthrough feedback.
Knowledge appends are atomic across connections.
Paths after '=' are checked against the ignore list.
Knowledge appends are atomic across stores.
Sizing falls back to the media type for unknown binary kinds.
Falsy Variable and Inject values are resolved from context.
Conversation history order is preserved.
File creation timestamps are preserved.
The language tag is stripped from single-line markdown fences.
on_changecan watch a file path.Dropped log segments are numbered after the highest existing segment.
Evaluation suites saved with a UTF-8 BOM are accepted.
Toolkit discovery refreshes when resolved configuration changes.
Duplicate streaming tool-call IDs are avoided.
Backslashes are escaped when recovering unquoted frontmatter values.
Prefixes are matched literally.
Evaluation Suite items handle null and single-string tags or metadata.
loadsaccepts null transitions and args.Local skill ownership is checked before arguments are validated.
Model output schemas are derived from serialization.
Nested scripts execute from their declared paths.
Timeout failures are preserved after the Tenki SDK upgrade.
MCPToolkit and MCPServerTool now send exactly one Authorization header on every provider, regardless of casing of an explicit header next to authorization_token.
Explicit keys and region_name now apply when passed together with session, rather than being silently ignored.
delegate() now closes its channel when sending the first message fails.
Idle expiry and LRU overflow no longer drop an MCP conversation while a turn is running on it.
Protocol-level failures return the prescribed JSON-RPC codes instead of a generic error or a tool result flagged isError.
Prompts with required arguments are validated before rendering.
Prevents a shared event descriptor from retargeting under concurrency, which could leave a tool awaiting a result that never matched and cause intermittent worker-thread hangs on Windows CI.
Only the SDK extra for the chosen A2A transport is required.
Thinking tokens are reported, and a measured zero remains zero.
Semaphore provisioning for max_concurrency is locked per event loop.
Resource template URI variables are decoded when processing MCP resources.
Tool discovery follows pagination to find tools beyond the first page.
AG2 adapts to breaking changes in the Anthropic SDK 1.x line, with Anthropic model name references updated to match.
Retries stop once streaming chunks have been emitted, preventing duplicate output already seen by the caller.
Suite tasks that produce no trace are counted rather than dropped, so suite totals reflect what actually ran.
Async scorer results are now awaited.
The sources from which usage is accounted have been corrected.
The tool type surface now lives in ag2.tools.types.
Built-in tool calls are no longer trimmed away from their reasoning item.
media_resolution is sent in the Part shape expected by the SDK.
SDK response nodes that arrive as dicts are now read correctly.
A2UI extension activation now persists on ServerCallContext.state.
Sub-task usage incurred before a failure is now reported rather than lost.
Namespaced delegate targets resolve correctly, and unknown targets are enumerated rather than failing opaquely.
Enum types are preserved across a serialization round-trip.
History is now sized correctly from event content.
Redis listener cancellation is now propagated correctly.
Adds support for the current Anthropic web_fetch tool version.
Adds support for the current Anthropic web_search tool version.
ag2 0.1416 changes
Breaking changes 1
Network now fails fast when a delegate targets itself.
New APIs and options 11
Beta agents can now generate UI on the fly with A2UI.
Agents can resume execution from an intermediate state, enabling fine-grained replays and forking.
Adds an observable run method alongside ask so callers can step through or watch an agent run.
Adds an observable run method alongside ask so callers can step through or watch a reply run.
Gemini configuration now accepts a custom asynchronous httpx client.
Adds a convenience method with per-agent client lifecycle.
Beta Gemini configuration adds image generation, editing, and image_config for fine-tuned image behavior.
Adds MemorySkill to provide code-defined skills.
Skills can now compose across runtimes.
Adds support for package as an OpenAI parameter.
Adds support for Z.AI / GLM models, including GLM 5.2.
Fixes and other changes 4
Compaction preserves tool-call cycles and renders CompactionSummary correctly.
Preserves falsy non-Field defaults on events.
Concatenates multi-part text in non-streaming responses.
Zero-argument tools now emit a valid empty-object JSON Schema.
ag2 0.1390 changes
Breaking changes 4
Aggregation now counts only conversational and work events.
Rejects URLs that do not use the http(s) scheme.
Uses arun for async LangChain tools.
The say tool was removed from DiscussionAdapter.
Security 4
MCP servers can use OAuth Resource Server authentication for production-grade access control.
Escapes string values before eval to prevent code injection; users on prior versions should upgrade.
Blocks shell operators when running in readonly or allowed-command mode.
Adds URL validation to prevent Server-Side Request Forgery in the Document Agent.
New APIs and options 52
A new Beta client brings Amazon Bedrock into the Beta config architecture.
AG2 Agents can now be served as MCP servers, allowing MCP clients to use an AG2 Agent as a tool.
SkillPlugin gives agents access to local skills aligned with the agentskills.io spec, creating a portable extension surface for AG2 Agents.
Usage reporting is now decoupled via UsageEvent, separating LLM calls from usage tracking.
Runs an agent in the background while the parent agent continues, useful for long-running work that should not block the foreground conversation.
Adds a cross-process control plane for hub registration, channel lifecycle, and governance.
Provides a local implementation of the Sandbox protocol.
Agent-as-a-judge and Pairwise judge can now exclude reference answers.
Adds the ability to export run_agent spans to an external backend.
Introduces a protocol abstraction for sandboxed execution.
Carries envelopes between hub and clients over WebSocket, with auth and delivery semantics.
Adds a next-generation Anthropic client using the UnifiedResponse architecture.
Adds a beta evaluation framework for grading agent outputs.
Adds a next-generation AWS Bedrock client returning UnifiedResponse with provider, model, text, usage, and cost.
Adds a threshold scorer and
agent_judge(threshold=)for pass/fail gating in beta evaluations.Adds a Classic experimental TinyFish fetch tool.
Adds a Classic experimental TinyFish search tool.
Adds a Beta toolkit exposing TinyFish search and fetch APIs.
Adds support for workflow-based agents introduced in llama-index 0.13.
Adds file API support in the Beta xAI provider.
New middleware gates middleware activation based on event conditions.
Allows custom span attributes and values for telemetry.
Agents can create an agent dynamically through their tooling.
Adds event type negation to _ConditionMeta, enabling expressions such as ~ToolCallEvent.
The AG-UI stream handler supports media inputs.
AG-UI supports multimodal user message content.
N-party channels support [name] prefixes for clearer multi-party addressing.
AG-UI supports reasoning messages in both directions.
Adds support for xAI (Grok) models.
Connects to a remote A2A endpoint as if it were an LLM provider.
Allows an AG2 Agent to be exposed over A2A.
Adds A2A v1.0 support in the Beta framework.
Adds full-duplex realtime voice agents backed by provider realtime APIs, with continuous bidirectional sessions, built-in VAD and barge-in, and tool support.
Defines a protocol for custom adapters, letting developers specify manifests, state, and turn-taking rules while reusing the network's durability and identity layers.
Adds a built-in 1-to-1, one-round channel pattern with strict question-and-response behavior and automatic closure.
Adds a built-in, long-running, multi-turn 1-to-1 channel pattern with bidirectional exchanges.
Adds a built-in N-party turn-taking channel pattern with round-robin, dynamic, or static ordering.
Adds configuration support for passing extra_body to Anthropic requests.
Adds human peers as first-class participants on the network.
Adds opt-out flags for more control over knowledge harness behavior.
Adds client-side MCP connections that discover tools and execute them locally, supporting remote HTTP and local stdio subprocesses.
Adds provider-side MCP connections that forward the server URL and credentials to the LLM provider.
Introduces a multi-agent runtime built around durable, identity-scoped, protocol-typed channels with append-only event logs and built-in orchestration patterns.
Adds an immutable, hub-stamped identity record for agents on the network.
Adds federation that lets a channel span two hubs, supporting cross-organization channels.
Adds a mutable agent track record with observed stats, used by discovery to rank agents by observed outcomes.
Adds an LLM-facing document as part of the network's three-record agent identity.
Adds an audio peer that shares conversation context with the agent.
Adds a foundation for managing long-running agent tasks.
Allows a realtime session to retain low-latency turn detection while disabling audio output.
Adds Thinking Level support to the Gemini and Vertex AI client, including thinking token usage tracking.
Adds declarative workflow orchestration with conditions and dynamic handoffs for multi-agent channels.
Behavior and default changes 6
Network now supports agents in separate processes and machines participating in the same channels.
Empty parameters are omitted from Beta OpenAI configs.
Uses a serializable guardrail response schema.
The Beta filesystem toolset pins read and write encoding to UTF-8.
Tools can signal completion to the WorkflowAdapter, ending the workflow from within a tool call.
Makes the knowledge aggregation lifecycle observable.
Fixes and other changes 24
The A2A protocol version is validated during connection.
Prevents a NoneType crash when a tool result is missing.
The local ChatCompletion model is synchronized with the moderation field in openai 2.41.0.
Guards against a second matching event aborting the turn.
A2A now creates the artifact before appending streamed text chunks.
Prevents AutoPattern from silently ignoring TerminateTarget.
The Beta OpenAI client maps reasoning tokens to thinking_tokens rather than cache_creation.
Writes the user-defined functions module as UTF-8.
Reads files as UTF-8 to prevent Windows charmap errors.
Fixes DeepResearchAgent returning a None summary.
Writes Docling conversion artifacts as UTF-8 to avoid Windows encoding errors.
Writes generated text artifacts as UTF-8 to avoid Windows charmap errors.
Prevents double-registering tools that were already registered.
Coerces the chat summary to str.
Passes working_dir to StdioServerParameters.
Fixes tool_call simulation in agent messages.
Current-turn envelopes render consistently with history, with a coordinator pattern.
Routes keyword-passed positional-or-keyword parameters before **kwargs, fixing tool calls that combine regular arguments with **kwargs.
Initializes the task variable to prevent UnboundLocalError.
Counts Responses image costs per output item.
Pins encoding in mcp_proxy, PythonEnvironment, and Jupyter HTML output.
Pairs tool calls and results correctly after history trimming.
Recursively strips additionalProperties to fix anyOf rejections in the Beta Gemini schema.
Aligns optional-extras pins so dependency resolution succeeds when running uv sync.
ag2 0.1291 changes
Breaking changes 3
Renamed from PerplexitySearchTool to follow the toolkit pattern.
Agent subtasks are disabled by default for safer behavior.
The docker package is now an optional dependency; install it with ag2[docker] to use Docker code execution.
Security 1
Remaining unredacted logger paths now apply redact().
Deprecations 21
PerplexitySearchTool is no longer deprecated and will continue to be supported.
agent_eval is deprecated and planned for removal in v0.14.
AgentOptimizer is deprecated and planned for removal in v0.14.
CrewAIInteroperability is deprecated; the notes recommend LangChain or PydanticAI interop.
FirecrawlTool is deprecated and planned for removal in v0.14.
GPTAssistantAgent is deprecated and planned for removal in v0.14.
ImageGeneration is deprecated and planned for removal in v0.14.
LLaVAAgent is deprecated and planned for removal in v0.14.
MathUserProxyAgent is deprecated and planned for removal in v0.14.
PerplexitySearchTool is deprecated and planned for removal in v0.14.
PythonCodeExecutionTool is deprecated and planned for removal in v0.14.
QdrantRetrieveUserProxyAgent is deprecated and planned for removal in v0.14.
RealtimeAgent is deprecated and planned for removal in v0.14.
RetrieveAssistantAgent is deprecated and planned for removal in v0.14.
SearxngSearchTool is deprecated and planned for removal in v0.14.
SocietyOfMindAgent is deprecated and planned for removal in v0.14.
Swarm functions are deprecated; use the new Group Chat.
SwarmAgent is deprecated and planned for removal in v0.14.
TextAnalyzerAgent is deprecated and planned for removal in v0.14.
WebSearchPreviewTool is deprecated and planned for removal in v0.14.
WebSurferAgent is deprecated and planned for removal in v0.14.
New APIs and options 40
A new top-level Perplexity Search integration is available.
A new Beta tool runs agent-generated code in isolated Daytona or Docker environments.
Adds an opt-in architecture for stateful agents with persistence, assembly, execution, and post-processing stages, enabling memory across sessions and context management without rewriting the agent loop.
Harness LLM calls emit compaction or aggregation completion events on the stream, making their costs visible.
Adds composable assembly policies for shaping agent context, including independent reduction and injection policies.
Adds aggregation that builds long-term memory from short-term experience, including per-session summaries and persistent agent state.
Adds bootstrap support that writes knowledge-store paths and SKILL.md files so agents know where to look on first run.
Adds an agent-owned virtual filesystem with read, write, list, delete, and exists operations, backed by five store implementations.
Builtin tool result events now expose normalized parts.
Makes PerplexitySearchTool available in Beta and integrates it into the search module.
Adds constraint-respecting compaction of the live event stream, with a zero-LLM-cost tail-window option and an LLM-based summarization option.
A LangChain interop factory supports Gemini on Vertex AI.
A DuckDuckGo search tool is available in beta.
A new toolkit for Exa search is available.
A beta Files API client and related file-handling functionality are available.
Step event support enables advanced orchestration patterns.
A new Tavily-powered web search tool is available.
A new API lets developers merge toolkits.
Tools can return Input types and multi-part ToolResult values.
Beta AG-UI support adds UI integration.
Beta agents can delegate tasks using tool calls through the new Tasks API.
Runtime GroupChat candidate filtering is available through AgentEligibilityPolicy.
The beta release adds AgentSpec.
The approval_required middleware adds the allow_always option.
The Beta OpenAI client adds support for the extra_body parameter.
A new Beta tool supports code execution.
A new code executor integrates with Daytona.
A beta toolkit adds file operations.
Beta FunctionTool now supports middleware.
A beta environment supports local shell execution.
A beta tool adds local shell execution.
Beta input support covers Image, Document, Audio, and Video for OpenAI, Gemini, and Anthropic.
Adds Natural Language Interface Protocol support.
Subscribe to Agent events for monitoring and debugging.
A beta plugin system supports composable agent configuration.
Beta search skills support adds skills discovery.
Beta agents are fully serializable.
Beta skills management and discovery are available through the Skills Tool.
Beta Toolkit now supports middleware.
Beta WebSearchTool adds streaming support for web search.
Performance 1
Search tools now use async SDK clients for better performance.
Behavior and default changes 8
AG2 aligns with the v1.0 Agent2Agent protocol specification and provides a compatibility layer for v0.3, enabling interoperability with the broader A2A ecosystem.
The Exa integration header is now set via client.headers.
Redis serialization has moved to the event serializer.
Server-side builtin tool calls are now persisted in history.
Beta support lets developers use models on Google Vertex AI.
Timeouts were added to HTTP requests across multiple modules.
RedisStream events are dispatched locally before publishing.
Improved compatibility with existing ConversableAgents supports handoffs in tool calls.
Tooling 1
The CLI package is now published to PyPI.
Fixes and other changes 16
Updated for the current Exa API.
None content is now handled correctly.
Fixed image handling on both Chat Completions and Responses APIs.
Drains the buffer when a callback outlasts max_wait.
Empty Gemini text parts are dropped, with an AG-UI guard added.
Gemini ToolCallEvent instances now receive unique IDs when the provider omits fc.id.
Adds workload_identity support to OpenAI.
The AG-UI flow was fixed, including handling for the new ToolResult.parts shape in the adapter.
Beta input type mappers were fixed.
A ModuleNotFoundError for this OpenTelemetry exporter module was fixed.
Anthropic Usage calculation now includes total_tokens.
Tool call thought signatures are preserved with VertexAI.
Streaming usage metadata with VertexAI was fixed.
Fixed the DiskCache vulnerability identified as CVE-2025-69872.
Error messages now show actual type names instead of 't'.
Fixed the token-to-char budget calculation.
ag2 0.1164 changes
Breaking changes 2
Updates the client to use the Mistral V2 API.
Migrates the client to OpenAI's Responses v2 API, enabling stateful conversations without manual history management, built-in tools, reasoning features, multimodal applications, structured outputs, and enhanced cost and token tracking.
Security 6
Slack tool dictionary access was made safe.
File operations validate file_name against path traversal.
FileLogger output now redacts sensitive keys to help prevent credential leakage.
MCP resource URIs are validated against path traversal attacks.
ShellExecutor now uses shell=False with shlex.split to prevent command injection.
File operations validate subfolder_path against path traversal.
New APIs and options 29
A new tool generates images.
A new tool manages agent memory and integrates into existing tool schemas.
Redis stream support was added for scalable message handling.
Structured output support using ResponseSchema enables more predictable agent responses.
A new tool executes shell commands.
Telemetry support was added for monitoring and analytics.
Middleware hooks can now be scoped to specific tools for fine-grained control.
A new tool fetches web content.
Domain filtering was added for WebSearchTool.
A new tool and related schemas provide code execution capabilities.
A new middleware hook enables intercepting, transforming, or logging human input during agent conversations.
Tools can return ToolResult with final=True to skip the follow-up LLM call and end the turn immediately.
Introduces AG2 Beta, a redesigned framework that runs alongside the existing AG2 module without breaking current code.
Adds streaming support to the Gemini client.
Lets tools and prompt hooks declare dependencies through Annotated type hints and dependency injection.
Provides a pub/sub event bus for conversation state isolation, real-time streaming, and safe reuse of agents across concurrent users.
Adds an extensible middleware system with built-in history limiting, token limiting, and LLM retry capabilities.
Introduces a unified protocol for LLM support across OpenAI, Anthropic, Gemini, DashScope, and Ollama clients.
Adds a tool for parallel web research that searches and synthesizes information from multiple sources concurrently.
Provides canned LLM responses for unit tests without network calls.
Adds an integration with the TinyFish scraper for web content extraction.
Added support for custom HTTP headers in OpenAILLMConfigEntry and AzureOpenAILLMConfigEntry API requests.
Added support for a new phase key in the Responses client.
Adds processing of human-in-the-loop events in Agent2Agent communication for interactive approval workflows in agent pipelines.
Adds server- and client-side streaming for Agent2Agent communication, including LLM text streaming for real-time remote-agent responses.
Adds event-based streaming for incremental agent-response text updates in AG-UI frontends.
Adds support for Crawl4AI 0.8.x.
AG2 natively supports AG-UI for streaming responses, shared state synchronization, tool call rendering, and human-in-the-loop workflows with compatible frontends.
AG2 supports tracing and instrumentation for local and remote A2A agents, including LLM-level token usage and cost.
Behavior and default changes 2
Adds a User-Agent header to Anthropic API calls.
The Anthropic V1 client adds streaming and non-beta support, improving response handling and compatibility.
Tooling 1
A new command-line interface supports building, running, testing, and deploying multi-agent applications with AG2.
Fixes and other changes 24
Anthropic usage tokens and cached token usage observation were fixed.
Handling of empty tool call arguments in message mappers was fixed.
Anthropic pause_turn handling was fixed.
Message platform tools now initialize sent_message_id before the loop.
Three bugs in ToolCallEvent and ToolErrorEvent event handling were fixed.
Three bugs in ToolCallEvent and ToolErrorEvent event handling were fixed.
ClientTool.register now correctly sends ClientToolCall events to the stream.
The Gemini client now handles messages without a content key.
Tool events were refactored into dedicated types for cleaner runtime handling across all providers.
Fixes handling of LLMConfig objects in AgentOptimizer.
Fixes Gemini thought signature handling.
Fixes an IndexError when last_message() is called on an empty conversation.
Adds missing model entries to token_count_utils.
Fixes the tool call type field concatenating during streaming.
Fixed Gemini structured output when using additionalProperties.
Fixed awaiting awaitable tool results during async execution.
Fixed RandomAgentTarget validation in ensure_handoff_agents_in_group.
Replaced bare except statements with except Exception.
Preserved the async wrapper during context variable injection in the group tool executor.
Fixed handling of empty string content in the OpenAI Responses client.
Fixed support for parallel tool calls in the Gemini client.
Improves the error message shown when Docker is not running.
Fixes a TypeError on the ToolCall return type.
Anthropic and OpenAI clients now support messages without a role for Agent-to-Agent communication.
ag2 0.1054 changes
Breaking changes 2
GroupChat now validates that agent names are unique to prevent conflicts.
LLM configurations were restructured, which may affect how developers configure LLMs.
Security 3
Addressed multiple CVEs to improve security posture.
Group chats now provide comprehensive, fine-grained security control.
Policy-guided safeguards now support the initiate_group_chat API.
New APIs and options 25
Added support for OpenAI's GPT 5.2 Codex models, bringing enhanced coding capabilities to agents.
Added an async reply handler to support async workflows.
Added a code executor for research paper execution, expanding support for scientific and research workflows.
The Responses API now supports the shell tool, enabling agents to interact with command-line interfaces.
Supports provider-specific model request fields, enabling advanced features such as Claude 3.7 Sonnet's Thinking Mode.
The Bedrock client now supports exponential backoff and retries to address throttling on the Bedrock Converse API.
Adds step-through execution for group chats, allowing developers to pause and inspect execution event by event.
Adds step-through execution for agent workflows, allowing developers to pause and inspect execution event by event.
The Responses API supports the apply_patch tool with V4A diff format for structured, multi-file code editing.
Added support for OpenAI GPT-5.2 models.
Extended thinking and reasoning configuration is supported for Google Gemini models, allowing control over reasoning depth and latency.
Added support for thought signatures in functions for Gemini 3 models, improving reasoning-trace capture and downstream processing.
Added the xhigh reasoning effort level for enhanced performance on complex tasks.
A2A Client interceptors are supported.
AG2 supports Anthropic’s Structured Output API, enabling schema-guaranteed responses via constrained decoding.
Bedrock clients support structured output through the response_format API.
Events for handoffs were added.
OpenAICompletionsClient supports Pydantic structured outputs.
ThinkingBlock extracts text for Anthropic clients, enabling better reasoning-trace capture and downstream processing.
An A2A Card was added to Agent builder.
A2A human-in-the-loop support was added.
A new FunctionTarget lets a function determine the target in group chats.
GPT-5.1, Codex, and search model configurations were added.
A new V2 OpenAI client architecture provides a foundation for multimodal messages and access to thinking and reasoning tokens, while remaining compatible with agents using V1 clients.
AG2 supports remote agents using the Agent2Agent (A2A) protocol, enabling agents across platforms, frameworks, and vendors to discover, communicate, and collaborate.
Behavior and default changes 3
Event printing now routes through the logging system, giving developers more control over agent output and debugging.
404 errors now include address information.
Two-agent chat and group chat APIs now accept list[dict] for message content.
Fixes and other changes 21
Fixed import issues for Anthropic beta blocks.
Fixed support for A2A messages without a role.
Fixed shell tool parsing for Windows paths.
Prevented double
using_auto_replyevents when using asyncrun.Handles A2A tasks when task start events are missing.
Group chat costs are now aggregated from all participating agents instead of potentially tracking only the manager or last agent.
Avoids Pydantic deprecation warnings on import.
Group chat runs now set agents on RunResponse.
Corrected tool formatting for Anthropic Beta APIs to make tool calling more reliable.
Resolved a validation error when using async default_auto_reply.
Gemini FunctionDeclaration parameters now use proper Schema objects, improving function calling reliability.
Corrected async processing issues for long-running agent tasks.
Fixed tool call extraction from message_retrieval in the OpenAI V2 client.
Fixed handling of img tags in MultimodalConversableAgent.
Fixed tool choice handling for Bedrock structured outputs using the response_format API.
Fixed missing awaits on async calls.
Fixed a Bedrock key error.
Fixed a failure when using structured outputs and streaming with the OpenAI client.
A fix addresses empty A2A messages.
A fix addresses an UnboundLocalError in FunctionTarget.
Fixes tool detection for OpenAI o1 and merging of LLM tools and functions.