Join our Newsletter — 33% off our NHI Course
Agentic AI & Autonomous Identity

AG2

← Back to Glossary
By NHI Mgmt Group Updated November 26, 2026 Domain: Agentic AI & Autonomous Identity

AG2 is an open-source framework for building multi-agent AI applications, evolved from the AutoGen project. Agents can call tools and execute code, so each becomes a non-human identity with its own reach. Defenders run generated code in isolated sandboxes, give each agent narrowly scoped credentials, and log inter-agent messages and tool calls.

What AG2 Is in Practice

AG2 is best understood as an execution framework for multi-agent AI systems, not just a convenience layer for prompt orchestration. Its significance is that agents can act, call tools, and run code, so the framework has to be treated as part of the system’s trust boundary, not only its developer ergonomics.

Because AG2 evolved from AutoGen, it inherits the practical problem of coordinating multiple semi-autonomous components while keeping their authority bounded. That makes the term useful to people designing agentic applications where delegation, tool access, and runtime containment matter more than simple chat flow.

Why AG2 Changes the Security Model

Once an agent can invoke tools or execute code, its permissions become security-relevant. The question is no longer only what the model says, but what the agent is allowed to do, which resources it can reach, and how far a compromised prompt or tool chain could extend that reach.

That is why AG2 deployments are commonly designed with narrow credentials, isolated execution environments, and explicit logging. Those controls reduce the blast radius of an errant or manipulated agent, and they also create evidence for later review when behaviour needs to be explained or contained.

For this kind of system, the core security issue is delegated authority. The more directly an agent can touch infrastructure, data, or other tools, the more important it becomes to constrain tool scope, separate duties across agents, and avoid giving every component the same ambient access.

How AG2 Relates to Agent Coordination

AG2 is most useful when work can be split across specialised agents that collaborate through messages, tool calls, and code execution. That coordination pattern can improve quality and speed, but it also creates more places where a bad instruction, a poisoned input, or an unsafe tool result can propagate across the workflow.

Inter-agent messaging deserves the same care as any other control plane because messages can carry instructions, data, and state changes. In practice, the attack surface is not limited to one model response, it includes the hand-offs between agents and the actions those hand-offs trigger.

The strongest operational benefit of AG2 is therefore not just automation, but explicit structure. When teams define which agent owns which step, which tools are permitted, and what each agent may pass to the next, they make the system easier to reason about and safer to audit.

Where AG2 Sits in the Broader Agentic Stack

AG2 sits in the middle of an agentic application stack: above the model, below the business workflow, and alongside the tools and services the agents use. That position matters because failures can originate in any layer, from unsafe code execution to overbroad tool credentials to unreviewed messages between agents.

For defenders, the practical reading is that AG2 is not a substitute for identity controls, sandboxing, or logging. It is the orchestration layer that makes those controls necessary and, when configured well, makes them more effective.

For builders, the term also signals architectural intent. If a team says it uses AG2, they are usually choosing a multi-agent design with runtime delegation, not a single-turn application with a thin wrapper.

Risk and Threat Considerations

AG2 systems concentrate risk in the places where delegation becomes execution. If an agent can call tools, run code, or relay instructions to other agents, a prompt injection, malicious tool output, or compromised integration can turn a limited mistake into broader system access.

Failure mechanism: Unsafe or overprivileged agent actions can cascade through tool chains and inter-agent messages, especially when execution is not isolated and permissions are not tightly scoped. Attackers do not need to “break” the model in a traditional sense, they can abuse the authority the agent already has.

Impact: The result can be data exposure, unauthorized actions, credential misuse, or a wider compromise of connected systems and workflows. Logging and sandboxing reduce this risk, but only if they are enforced consistently across every agent and tool boundary.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-05 — Overprivileged NHIAG2 agents act with scoped authority that can be overextended.
Recommendation — Limit each agent to the minimum credentials and tool reach it needs.
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseAG2 multi-agent systems rely on delegated authority and tool use.
Recommendation — Constrain agent identity and privilege boundaries for every tool-using agent.
NIST SP 800-53 Rev 5IA-9 — Service Identification and AuthenticationAG2 agents and tools authenticate as non-human runtime actors.
AU-2 — Event LoggingAG2 needs logging of inter-agent messages and tool calls for review.
SC-39 — Process IsolationAG2 code execution is safer when each agent runs in an isolated sandbox.
Recommendation — Apply IA-9 to authenticate agent and service interactions with bounded trust. Log agent messages, tool calls, and execution events for traceability. Isolate agent execution to contain code and limit lateral impact.

Practitioner Guidance

Why practitioners should care: AG2 is only as safe as the authority you grant to each agent. Treat each agent as a constrained runtime actor, not as a conversational abstraction, and design the system so that a single compromised component cannot freely expand its reach.

What to watch for: The most common failure mode is scope drift, where an agent slowly accumulates more tools, broader data access, or reusable credentials because it is convenient. That pattern often looks harmless until one prompt, tool call, or downstream action crosses a trust boundary you never intended to expose.

Practitioner takeaway: Keep agent permissions narrow, execution isolated, and message flow observable, because those three controls determine whether AG2 behaves like a controlled workflow or an open-ended delegation layer.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 26, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org