AG2 is an open source Python framework for building AI agents and getting several agents to cooperate on a task, maintained by a volunteer community that forked Microsoft's AutoGen at version 0.2.35. Search results mix three things under the AG2 name: the original AutoGen-style framework (now called AG2 Classic), the rewritten AG2 1.x framework imported as ag2, and the AG2 commercial products such as AgentOS. This page separates them, sets out which package and import you need, what changed at version 1.0, which models and protocols the framework supports, and what the licence and support position is. It is written for developers, architects and the people who approve frameworks for a team. Every fact comes from AG2's own repositories, documentation, release notes and website. Last checked: 2026-11-15.
This is an independent guide from NHI Mgmt Group, based on AG2's public documentation as of November 2026. It is not sponsored or reviewed by AG2. Product features change, so confirm settings against AG2's current documentation.
Key takeaways
- Two frameworks share the name. AG2 Classic keeps the
autogenimport andConversableAgent,GroupChatand swarms; AG2 1.x is imported asag2and is built aroundAgentand the Network. - Version 1.0 is not a drop-in upgrade. The v1.0.0 release notes (27 July 2026) say so directly: the agent model, orchestration and imports all changed, and the classic code moved to the
ag2-classicrepository. - Classic is in maintenance mode. The classic repository states it receives security and critical bug fixes only, with no new features, so new projects start on 1.x.
- Apache 2.0, with MIT heritage. Both repositories carry the Apache License 2.0; the NOTICE file says portions that came from the original AutoGen repository remain under the MIT licence.
- Protocol support is broad. AG2 1.x ships optional extras for MCP, A2A, AG-UI, A2UI and ACP, plus OpenTelemetry tracing and Prometheus metrics.
What is AG2?
The AG2 README describes the project as "an open-source programming framework for building AI agents and facilitating cooperation among multiple agents to solve tasks", with support for tool use, many model providers, autonomous and human-in-the-loop workflows and multi-agent conversation patterns. The project's tagline is "Open-Source AgentOS for AI Agents". The ag2.ai website calls it "the open-source Python framework for building, orchestrating, and scaling multi-agent AI systems".
Where it came from: the NOTICE file states that the project is a fork of microsoft/autogen, created from version v0.2.35 of the original project. The classic repository's announcement for 11 November 2024 reads that AutoGen was "evolving" into AG2, with a new GitHub organisation, AG2AI, created "to host the development of AG2 and related projects with open governance". Project administrators named in the README are Chi Wang and Qingyun Wu, and the MAINTAINERS file lists volunteers from organisations including Penn State University, Meta, Google, IBM and airt.ai. The ag2.ai website describes the team as "from the creators of AutoGen".
The 2026 split: in version 1.0 the protocol-driven framework that had been developed as autogen.beta became the mainline package, imported as ag2. Everything built on the original agent classes moved to a separate repository with its own documentation site.
| Item | AG2 Classic | AG2 1.x |
|---|---|---|
| Repository | ag2ai/ag2-classic | ag2ai/ag2 |
| Documentation | classic.docs.ag2.ai | docs.ag2.ai |
| Import | import autogen | import ag2 |
| Core agent class | ConversableAgent (also AssistantAgent, UserProxyAgent) | Agent |
| Multi-agent model | GroupChat and GroupChatManager, swarms, nested and sequential chats | Network: a Hub plus typed channels |
| Python requirement | 3.10 or later | 3.11 or later |
| Status | Maintenance mode: security and critical fixes only | Actively developed |
As of 15 November 2026, from the two repositories' README files.
Key facts at a glance
As of 15 November 2026, from the AG2 repositories, documentation and ag2.ai.
| Field | Value |
|---|---|
| Owner | AG2ai open source project; copyright line "AG2ai, Inc., AG2ai open-source projects maintainers and core contributors" |
| Type | Open source multi-agent framework (library, runs in your own process) |
| Language | Python |
| PyPI package | ag2 (1.x); classic install is ag2-classic according to the AG2 README, and the classic repository says it publishes to PyPI as autogen |
| Python requirement | 3.11 or later (1.x); 3.10 or later (Classic) |
| Licence | Apache-2.0 (both repositories); MIT applies to code originating from microsoft/autogen |
| Forked from | AutoGen v0.2.35 |
| Version 1.0.0 | 27 July 2026 |
| Version on the main branch | 1.3.1 in pyproject.toml on 15 November 2026 |
| Core dependencies | pydantic, httpx, anyio, pyyaml, fast-depends; everything else is an optional extra |
| Programming model | Async throughout: Agent.ask() returns an AgentReply; run() returns an observable AgentRun |
| Price | Free and open source |
| Commercial products | AG2 AgentOS and AG2 Space, offered through request-access and early-access forms on ag2.ai |
| Contact | [email protected] |
Plans and pricing
The framework costs nothing to use. Both repositories are Apache-2.0 licensed and installed from PyPI. Running agents costs what the chosen model provider charges, plus any sandbox or hosting you add.
The ag2.ai website also describes two commercial products, with the line "Open source at the core. Enterprise-ready at scale.":
- AG2 AgentOS: described as a runtime for coordinating agents built in different frameworks, with three areas named Orchestrator, Studio and Applications.
- AG2 Space: a macOS app that places people and their agents in shared rooms for context sharing, handoffs and approvals; the site says it "Works with Claude Code or Codex".
Availability: as of 15 November 2026 the ag2.ai website offers these products through request-access and early-access forms. Prices, plans and a hosted tier are not stated by AG2.
Models available
AG2 does not ship a model. Each provider has a configuration class in ag2.config and a matching install extra, and each class reads the provider's standard environment variable so keys do not need to be written into code. The Models and Providers page lists these classes as of 15 November 2026:
| Config class | Provider or API | Environment variables named in the docs |
|---|---|---|
AnthropicConfig | Anthropic Claude | ANTHROPIC_API_KEY |
BedrockConfig | Amazon Bedrock | AWS_BEARER_TOKEN_BEDROCK, AWS_DEFAULT_REGION and standard AWS credentials |
DashScopeConfig | Alibaba DashScope (Qwen) | Not stated; the example passes api_key |
GeminiConfig | Gemini Developer API | GOOGLE_API_KEY (takes precedence) or GEMINI_API_KEY |
MistralConfig | Mistral | MISTRAL_API_KEY |
OllamaConfig | Ollama, local or hosted (default http://localhost:11434) | Not stated |
OpenAICompletionsConfig | OpenAI Chat Completions and compatible endpoints | OPENAI_API_KEY |
OpenAIDecisionsConfig | OpenAI Decisions API (public beta) | OPENAI_API_KEY |
OpenAIResponsesConfig | OpenAI Responses API | OPENAI_API_KEY |
TypeSafeConfig | TypeSafe Jev | TYPESAFE_API_KEY, TYPESAFE_BASE_URL |
VertexAIConfig | Gemini on Vertex AI | GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION, GOOGLE_APPLICATION_CREDENTIALS |
XAIConfig | xAI Grok | XAI_API_KEY |
ZAIConfig | Z.AI GLM | ZAI_API_KEY, ZAI_BASE_URL |
Self-hosted and compatible servers: the docs point vLLM, LM Studio and similar servers at OpenAICompletionsConfig with a custom base_url, and use extra_body for provider-specific request fields. VertexAIConfig accepts a service account key file, Application Default Credentials or a credentials object, and the docs name the Vertex AI User role (roles/aiplatform.user).
Deprecation to note: OpenAIConfig is a deprecated alias for Chat Completions, and the docs say that in 1.4.0 it is scheduled to become an alias for OpenAIResponsesConfig, which means renaming parameters such as max_completion_tokens to max_output_tokens.
A remote A2A agent can also stand in for a model: A2AConfig plugs into a local Agent so it talks to a remote A2A endpoint as if it were a provider.
Features and modes
The README groups AG2 1.x around a small set of concepts. The table lists them with the classes the documentation uses.
| Concept | What it does | Main names |
|---|---|---|
| Agent | Talks to a model, calls tools and returns a reply; calling ask() on a reply continues the same conversation | Agent, ask(), run(), AgentReply |
| Tools | Plain Python functions the model can call; AG2 runs the whole tool-calling loop | @tool, @agent.tool, ToolResult, toolkits |
| Human in the loop | A tool pauses the run to ask a person; the application decides how the question is answered | context.input(), hitl_hook, approval_required() |
| Network | Coordinates several agents through a hub that owns the registry, write-ahead log and audit trail | Hub, channels, TransitionGraph |
| Harness | Opt-in memory and context management layered onto an agent | KnowledgePlugin, DiskKnowledgeStore, SummarizeCompact, AssemblerMiddleware |
| Middleware | Wraps turns, model calls, tool calls and human input | LoggingMiddleware, RetryMiddleware, HistoryLimiter, TokenLimiter, ConditionalMiddleware |
| Observability | Spans and metrics for each turn, model call and tool call | TelemetryMiddleware, ag2[tracing], ag2[metrics] |
Network channel types
The README describes four channel shapes. conversation is free-form between two parties and never closes on its own. consulting is one question and one reply, then closes. discussion is round-robin across several agents with no turn cap. workflow is driven by a declarative TransitionGraph with a hard turn cap, and the README calls it the closest analogue to a classic GroupChat. Graphs are JSON-serialisable and survive Hub.hydrate(), according to the migration guide.
Moving from GroupChat to the Network
The group chat migration guide maps the classic names to their 1.x equivalents. The most common ones:
| Classic | AG2 1.x |
|---|---|
GroupChat(agents=[...]) | A workflow channel with the agents as participants |
GroupChatManager | WorkflowAdapter plus Hub |
Agent.handoffs | A TransitionGraph defined per channel, not per agent |
Terminate() | TerminateTarget(reason=...) |
OnCondition, OnContextCondition | A registered custom TransitionCondition |
max_round=N | TransitionGraph(..., max_turns=N) |
Protocols
- MCP:
MCPToolkitconnects to local stdio servers (MCPStdioServerConfig) and remote streamable HTTP servers (MCPServerConfig), withallowed_tools,blocked_toolsandtool_name_prefix. Themcpextra requires the MCP SDK 2.x (mcp>=2.3.0,<3). AG2 can also serve MCP, MCP-UI and MCP Apps. - A2A:
A2AServerexposes an agent over JSON-RPC, REST or gRPC and publishes its card at/.well-known/agent-card.json;ag2.a2a.securityoffers bearer, API key, OAuth2, mTLS, HTTP and OpenID Connect schemes, and the docs cover card signing. - AG-UI and A2UI: serve agents to front ends, including human input and approvals as client interrupts.
- ACP: serve AG2 agents to, and drive, CLI coding agents through the Agent Client Protocol.
- NLIP: listed among the new protocols in the v1.0.0 release notes.
Supported IDEs and platforms
- Runtime: any environment with Python 3.11 or later; the README gives install commands for Windows, Linux and macOS.
- Installation:
pip install ag2installs minimal dependencies; provider extras such asag2[openai],ag2[anthropic],ag2[gemini],ag2[ollama]andag2[bedrock]add model clients, and protocol extras adda2a,ag-ui,a2ui,acp,mcpandmcp-ui. - Code execution environments: the Sandbox Shell docs name
LocalEnvironment,DockerEnvironment,DaytonaEnvironmentandTenkiEnvironment. - Coding assistants: the user guide has an "AI Coding Assistants" section, and the ACP integration lets CLI coding agents work with AG2 agents.
- Learning resources: the AG2 Playground, the
build-with-ag2examples repository and the documentation's code examples.
Enterprise and admin controls
AG2 is a library, so there is no admin console: controls are set in code by the team that builds the agent. The documented ones:
- Approval-required tools:
@tool(middleware=[approval_required()])asks a person before the tool runs. Without ahitl_hookthe turn ends withHumanInputNotProvidedErrorand the tool does not run.allow_alwaysdefaults toTrue, so a user can approve a tool for the rest of the conversation;timeoutdefaults toNone(wait indefinitely). Over A2A and AG-UI the reserved approval keys are stripped in both directions so remote callers cannot pre-approve tools. - Sandbox Shell policy:
allowed,blocked,ignoreandreadonly=Trueswitch the tool into restricted mode, where commands run without a shell. Defaults are a 60 second per-command timeout and 100,000 characters of output. - MCP tool filtering:
allowed_toolsandblocked_toolslimit which server tools the agent sees;MCPAnswerPolicycontrols which server input requests are answered. - A2A authentication: the
require()builder declares the schemes an agent card requires, and signed cards can be verified on the client. - Network audit trail: the
Hubkeeps a write-ahead log that can be replayed withread_wal(). - Task lifecycle:
ask()andrun()acceptttl_seconds, and the Tasks guide covers cancellation.
Data handling and privacy
Agents run inside your own process, and prompts go to whichever model provider you configure, under that provider's terms. AG2 does not describe a hosted service for the framework, so retention and training use for the open source library are not stated by AG2. Three documented behaviours matter for data handling:
- Trace content is captured by default.
TelemetryMiddlewareemits OpenTelemetry spans following the GenAI semantic conventions (invoke_agent,chat,execute_tool,await_human_input), and includes message content, tool arguments, tool results and human input unless you passcapture_content=False. The docs warn that captured content appears in the tracing backend. - Persistent memory is opt-in.
DiskKnowledgeStorekeeps what the agent remembers after the process exits, so it needs the same care as any other data store. - Middleware descriptions hide values. The middleware docs say descriptions must not expose credentials and that option values are not reported.
The ag2.ai products have their own access forms; data terms for them are not stated on the pages checked.
Release history
As of 15 November 2026, from the classic repository announcements, the NOTICE file and the GitHub release notes.
| Date | Event |
|---|---|
| Not dated by AG2 | Fork created from AutoGen v0.2.35 (NOTICE); the classic README says the project adopted Apache 2.0 from v0.3 |
| 11 November 2024 | Announcement that AutoGen is evolving into AG2, with the AG2AI GitHub organisation and open governance |
| 27 July 2026 | v1.0.0: the former autogen.beta framework becomes the mainline ag2 package; classic code moves to ag2-classic; adds NLIP, ACP and MCP-UI, Prometheus metrics and network tracing; previously swallowed errors now surface |
| 29 July 2026 | v1.0.1: pins mcp<2 pending MCP 2.0 support; adds a Mistral provider |
| 15 August 2026 | v1.0.2: serve agents over ACP; signed A2A agent cards and gRPC TLS |
| 28 August 2026 | v1.0.3: port to MCP 2.0 (breaking, requires mcp>=2.0.0,<3) |
| 7 September 2026 | v1.0.4: support for Anthropic SDK 1.x and OpenAI SDK 3.x |
| 24 September 2026 | v1.1.0: TypeSafe Jev decision-only agents; fix so reserved context variables do not cross the wire |
| 29 September 2026 | v1.1.1: Bedrock moves to aiobotocore (breaking); restricted shell mode runs without a shell |
| 3 October 2026 | v1.1.2: MCP output schema fixes; AG-UI 1.0 serving (breaking); fix for shell command-filter bypasses |
| 15 November 2026 | Main branch pyproject.toml shows version 1.3.1 |
Limits and known constraints
- Breaking upgrade path: moving from Classic to 1.x means rewriting agent definitions and orchestration; the README tells Classic users to pin the classic distribution rather than
ag2>=1.0. - Breaking changes inside 1.x: releases 1.0.3, 1.1.1 and 1.1.2 each carry changes marked breaking (MCP 2.0, Bedrock client, AG-UI 1.0), so pin versions and read release notes before upgrading.
- Async only: AG2 1.x is "async throughout", so synchronous code bases call it through an event loop.
- Shell filters have limits: the docs state that
blockedcannot stop programs that launch other programs (such assh -c,envorxargs) and recommendallowedor an isolated backend for a hard boundary. - Default local shell: with no arguments the Sandbox Shell uses
LocalEnvironment, which the docs say gives the agent direct access to the file system and the ability to run arbitrary commands. - Some channels never stop on their own:
conversationanddiscussionchannels need the application to bound and close them.
Security guidance
This page describes what AG2 is and how it is packaged. The wider discipline is in the Securing Agent Frameworks Guide. In AG2 terms, start with the controls the framework documents: gate irreversible or sensitive tools with approval_required(), and consider allow_always=False and a finite timeout where a standing approval would be too broad. Run shell and code tools in DockerEnvironment or another isolated backend rather than LocalEnvironment, and use allowed or readonly=True when prompts may be untrusted; the AI Agent Sandboxing and Code Execution Guide covers the isolation choices. Limit MCP servers with allowed_tools and see the MCP Security Guide. Require authentication and signed cards on A2A endpoints, as covered in the Multi-Agent and A2A Security Guide. Keep provider keys in environment variables or a secrets store, and set capture_content=False or restrict tracing backend access where traces would carry sensitive data. Apply AG2 security updates promptly: several 2026 releases include security fixes.
Practitioner checklist
- Search code for
import autogen,ConversableAgentandGroupChatto find which services are on AG2 Classic. - Pin Classic services to the classic distribution and plan any move to 1.x as a rewrite, using the group chat migration guide.
- Confirm Python 3.11 or later before adopting
ag21.x, and pin exact versions in lock files. - Read release notes for every 1.x upgrade, since several minor releases are marked breaking.
- Wrap sensitive tools in
approval_required()and decide deliberately whetherallow_alwaysstays on. - Run shell and code tools in an isolated environment and set
allowedorreadonlyfor untrusted input. - Decide on telemetry content capture per environment and restrict who can read traces.
- Record the Apache 2.0 licence and the MIT-licensed portions from AutoGen in your open source register.
Standards and references
- AG2: ag2ai/ag2 repository and README
- AG2: NOTICE (fork and licence history)
- AG2: ag2ai/ag2-classic repository and README
- AG2: GitHub releases
- AG2: Models and providers
- AG2: Migrating from group chat
- AG2: Approval required tools
- AG2: Agent telemetry
Related NHI Mgmt Group resources: Securing Agent Frameworks Guide · AI Agent Sandboxing and Code Execution Guide · Multi-Agent and A2A Security Guide · Human-in-the-Loop for AI Agents Guide · OpenTelemetry GenAI Semantic Conventions for Security Teams