Back
A2UI: how an agent describes a UI without writing code
SiTech AI Team2 წთ. საკითხავი

A2UI: how an agent describes a UI without writing code

The core idea behind A2UI is simple: the model never writes an interface, it only describes which component shows which values. A walkthrough published on dev.to follows one request from the agent's decision to the screen.

A2UI is a protocol that lets a language model assemble a user interface without emitting a line of executable code. Instead of JSX or HTML, the model returns a small JSON object naming a component the client already has and the values it should show. A walkthrough published on dev.to follows one request from the agent's decision to the screen.

Why not just send code

The tempting alternative is to let the model write the UI and mount whatever comes back. It works in a demo but carries three costs: the response is untrusted code running with the page's privileges, nothing enforces one design system, and nothing can be cached, since the text differs every time. A2UI moves that line: the model produces data, the client owns every line of code that executes, and the model only picks names off a menu and points at the numbers.

Two approaches compared

Three roles, five messages

The agent is server code and decides what to show: which components, filled with which values. The protocol is the wire format that decision travels in, and only five message types exist. Four go from agent to client: createSurface registers a surface against a catalog, updateComponents adds or replaces component records, updateDataModel writes values into a per-surface JSON tree, and deleteSurface removes it. The fifth, action, is the only client-to-agent message; transport is left out of the spec entirely.

The trust boundary

The security guarantee fits in one sentence: an agent can only name a component that already exists in the client's catalog, and every value it fills in is treated as data, never as instructions. It can fail quietly in one place, a catalog implementation that turns a value back into executable content, such as raw HTML injection or an unchecked href path. The protocol cannot see a component's code, so extending a catalog deserves the scrutiny of running code.

A dashboard, and the road to v1.0

The write-up points to a2ui-mutual-fund-dashboard, an open-source Next.js app where a natural-language question about an Indian mutual fund produces a dashboard: a stat card, a NAV chart and a summary. Its catalog is fixed at five components, and the model only picks which appear where, never a number. Everything is pinned to v0.9.1, a2ui.org's current production version, while v1.0 is a release candidate; its one substantive addition is actionResponse, a sixth message that lets an agent answer a specific action synchronously instead of in a later batch.

SSiTech

SiTech — AI-powered web development

We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.