A2UI Agent SDK
Project description
A2UI Agent implementation
The agent_sdks/python/src/a2ui directory contains the Python implementation of
the A2UI agent SDK.
Core Components (src/a2ui/core)
The src/a2ui/core directory contains the base protocol logic, version
management, and schema operations.
Schema Management (src/a2ui/core/schema)
manager.py: TheA2uiSchemaManagerhandles loading specification schemas, managing catalogs, and generating system prompts for LLMs.validator.py: ImplementsA2uiValidatorfor validating A2UI messages against JSON schemas and protocol rules.catalog.py: DefinesA2uiCatalogandCatalogConfigfor handling component libraries.payload_fixer.py: Utilities to automatically correct common LLM output issues in A2UI payloads.
Basic Catalog (src/a2ui/basic_catalog)
provider.py: Implementation ofBasicCatalogfor handling the basic A2UI components.
A2A (src/a2ui/a2a)
a2a.py: Utilities for creating A2A Parts with A2UI data and managing the A2UI extension URI.
ADK Extensions (src/a2ui/adk)
Support for the Agent Development Kit (ADK) and A2A protocol.
send_a2ui_to_client_toolset.py: Implementation ofSendA2uiToClientToolsetto enable agents to send UI to clients via tool calls.
Running tests
-
Navigate to the directory:
cd agent_sdks/python
-
Run the tests
uv run pytest
Building the SDK
To build the SDK, run the following command from the agent_sdks/python
directory:
uv build .
Formatting code
To format the code, run the following command from the agent_sdks/python
directory:
uv run pyink .
Disclaimer
Important: The sample code provided is for demonstration purposes and illustrates the mechanics of A2UI and the Agent-to-Agent (A2A) protocol. When building production applications, it is critical to treat any agent operating outside of your direct control as a potentially untrusted entity.
All operational data received from an external agent—including its AgentCard, messages, artifacts, and task statuses—should be handled as untrusted input. For example, a malicious agent could provide crafted data in its fields (e.g., name, skills.description) that, if used without sanitization to construct prompts for a Large Language Model (LLM), could expose your application to prompt injection attacks.
Similarly, any UI definition or data stream received must be treated as untrusted. Malicious agents could attempt to spoof legitimate interfaces to deceive users (phishing), inject malicious scripts via property values (XSS), or generate excessive layout complexity to degrade client performance (DoS). If your application supports optional embedded content (such as iframes or web views), additional care must be taken to prevent exposure to malicious external sites.
Developer Responsibility: Failure to properly validate data and strictly sandbox rendered content can introduce severe vulnerabilities. Developers are responsible for implementing appropriate security measures—such as input sanitization, Content Security Policies (CSP), strict isolation for optional embedded content, and secure credential handling—to protect their systems and users.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file a2ui_agent_sdk-0.1.2.tar.gz.
File metadata
- Download URL: a2ui_agent_sdk-0.1.2.tar.gz
- Upload date:
- Size: 230.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd95171f685349a492dd8958b0962377d94d295bd32c554a8e27e99adcc7f70b
|
|
| MD5 |
a48d69585e67f6953e3c8e1149a7ae0b
|
|
| BLAKE2b-256 |
317f89ff7c4e1e88cab8d1b9a82fa8eb63e34770324689d72807e0ccab0ad1bd
|
Provenance
The following attestation bundles were made for a2ui_agent_sdk-0.1.2.tar.gz:
Publisher:
a2ui-py@oss-exit-gate-prod.iam.gserviceaccount.com
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
a2ui_agent_sdk-0.1.2.tar.gz -
Subject digest:
bd95171f685349a492dd8958b0962377d94d295bd32c554a8e27e99adcc7f70b - Sigstore transparency entry: 1219222329
- Sigstore integration time:
-
Token Issuer:
https://accounts.google.com -
Service Account:
a2ui-py@oss-exit-gate-prod.iam.gserviceaccount.com
-
Statement type:
File details
Details for the file a2ui_agent_sdk-0.1.2-py3-none-any.whl.
File metadata
- Download URL: a2ui_agent_sdk-0.1.2-py3-none-any.whl
- Upload date:
- Size: 72.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7be8e7c2f109eedc53786571e125162920ca78907d0c8a030f729f01abaa86b
|
|
| MD5 |
b6f3f34815904205f13fdcdd19357eef
|
|
| BLAKE2b-256 |
ccd01e562247e5ec267e3d07c8706f290c62554ca0abd3168fd06e68fb130a0a
|
Provenance
The following attestation bundles were made for a2ui_agent_sdk-0.1.2-py3-none-any.whl:
Publisher:
a2ui-py@oss-exit-gate-prod.iam.gserviceaccount.com
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
a2ui_agent_sdk-0.1.2-py3-none-any.whl -
Subject digest:
b7be8e7c2f109eedc53786571e125162920ca78907d0c8a030f729f01abaa86b - Sigstore transparency entry: 1219222326
- Sigstore integration time:
-
Token Issuer:
https://accounts.google.com -
Service Account:
a2ui-py@oss-exit-gate-prod.iam.gserviceaccount.com
-
Statement type: