Skip to main content

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: The A2uiSchemaManager handles loading specification schemas, managing catalogs, and generating system prompts for LLMs.
  • validator.py: Implements A2uiValidator for validating A2UI messages against JSON schemas and protocol rules.
  • catalog.py: Defines A2uiCatalog and CatalogConfig for 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 of BasicCatalog for 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 of SendA2uiToClientToolset to enable agents to send UI to clients via tool calls.

Running tests

  1. Navigate to the directory:

    cd agent_sdks/python
    
  2. 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

a2ui_agent_sdk-0.1.1.tar.gz (228.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a2ui_agent_sdk-0.1.1-py3-none-any.whl (71.5 kB view details)

Uploaded Python 3

File details

Details for the file a2ui_agent_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: a2ui_agent_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 228.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux rodete","version":null,"id":"rodete","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for a2ui_agent_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a347e9d4bfa90611f1f7b5c9a2ad65e1dab0501377f1eb916962a5722b2df6c9
MD5 bdde4536dab2606357320008f5e1d3a8
BLAKE2b-256 08a84094c52e8e5bea73cc80263bd004a85aa63be661ad1f10a86573296e30b0

See more details on using hashes here.

File details

Details for the file a2ui_agent_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: a2ui_agent_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 71.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux rodete","version":null,"id":"rodete","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for a2ui_agent_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79d99cb46c2b709c42a1368a27996691d2a6fb8b7cc4f4efb73a04d002acc5e7
MD5 6a1cb0876e28c46a4c6c3055106c3ead
BLAKE2b-256 ac3309a66b7581987b4ce1a479a9f1eeef91261ccb8ef5ebd4745f64ee414092

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page