This release is a pre-release and may not be stable for production use.
Get Started with Microsoft Agent Framework A2A
Please install this package via pip:
pip install agent-framework-a2a --pre
A2A Agent Integration
The A2A agent integration enables communication with remote A2A-compliant agents using the standardized A2A protocol. This allows your Agent Framework applications to connect to agents running on different platforms, languages, or services.
A2AAgent (Client)
The A2AAgent class is a client that wraps an A2A Client to connect the Agent Framework with external A2A-compliant agents.
from agent_framework.a2a import A2AAgent
# Connect to a remote A2A agent
a2a_agent = A2AAgent(url="http://remote-agent/a2a")
response = await a2a_agent.run("Hello!")
Breaking change: HTTP clients created by A2AAgent no longer persist response cookies. This prevents
one run's cookies from being reused by another run through the same agent.
Connection pooling and cleanup of internally created clients are unchanged.
If the remote service requires cookies for authentication, sessions, or load-balancer affinity, explicitly supply an
httpx.AsyncClient using http_client=. Its cookie behavior is preserved.
Scope that client to the intended authenticated user or security context and
manage its lifetime; do not share a user-specific cookie jar across users.
Supplied HTTP clients remain caller-owned even when client= is also provided.
Applications that previously relied on the agent closing a supplied HTTP client
in that combination must now close it explicitly.
A2AExecutor (Hosting)
The A2AExecutor class bridges local AI agents built with the agent_framework library to the A2A protocol, allowing them to be hosted and accessed by other A2A-compliant clients.
For this hosting example, install the A2A SDK HTTP server extra:
pip install "a2a-sdk[http-server]>=1.0.0,<2"
from agent_framework.a2a import A2AExecutor
from a2a.server.request_handlers import DefaultRequestHandler
from a2a.server.routes import create_agent_card_routes, create_jsonrpc_routes
from a2a.server.tasks import InMemoryTaskStore
from starlette.applications import Starlette
# Create an A2A executor for your agent
executor = A2AExecutor(agent=my_agent)
# Set up the request handler and server application
request_handler = DefaultRequestHandler(
agent_executor=executor,
task_store=InMemoryTaskStore(),
agent_card=my_agent_card,
)
app = Starlette(
routes=[
*create_agent_card_routes(my_agent_card),
*create_jsonrpc_routes(request_handler, "/"),
]
)
Basic Usage Example
See the A2A agent examples which demonstrate:
- Connecting to remote A2A agents
- Hosting local agents via A2A protocol
- Sending messages and receiving responses
- Handling different content types (text, files, data)
- Streaming responses and real-time interaction
Security considerations
The hosting example above focuses on protocol wiring and does not add authentication or authorization by itself. Production A2A hosts should protect their HTTP or JSON-RPC entry points with the deployment's normal auth layer and verify that each caller is allowed to access the requested agent, task, or session.
Task, thread, context, and session identifiers used by an A2A host are routing handles, not bearer credentials. Do not rely on client-supplied identifiers alone to select or mutate persisted state; bind them to authenticated user, tenant, or workspace context first.
Metadata
Release files for agent-framework-a2a 1.0.0b261112
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_framework_a2a-1.0.0b261112.tar.gz | 23.6 kB | Without provenance | Details for agent_framework_a2a-1.0.0b261112.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_framework_a2a-1.0.0b261112-py3-none-any.whl | Python 3 | none | any | Details for agent_framework_a2a-1.0.0b261112-py3-none-any.whl |
Total release size: 47.7 kB
Release files / agent_framework_a2a-1.0.0b261112.tar.gz
| Download URL | agent_framework_a2a-1.0.0b261112.tar.gz |
|---|---|
| Size | 23.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c15ca92ddbfb7b7902057fb6b0dc37eb98c13f96fe2a05e17157288a0234288
|
|
BLAKE2b-256 checksum How to use checksums |
598d99a9237154e036943ad655285edd9e960b768a7c48feffe2f76a1ac68e27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / agent_framework_a2a-1.0.0b261112-py3-none-any.whl
| Download URL | agent_framework_a2a-1.0.0b261112-py3-none-any.whl |
|---|---|
| Size | 24.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e868d0ca3a2660503e77ad203be834c266aa7903b3b84c9818d6315eb783b2a
|
|
BLAKE2b-256 checksum How to use checksums |
cd392825d1b2853131c8f06c377c8bfc6c1245aa6cee6ce3984ccfe4c2c361a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Security for agent-framework-a2a 1.0.0b261112
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.