HIPsHanzo Proposals
Back to HIPs
HIP-1415DraftStandards TrackInterface

Generative UI Protocol (A2UI 1.0)

Hanzo AI
Created: 2026-11-28
Requires: HIP-0504, HIP-0528, HIP-0010

HIP-1415: Generative UI Protocol (A2UI 1.0)

Abstract

This proposal specifies Hanzo's normative generative UI protocol based on the Google A2UI 1.0 wire specification, implemented natively over @hanzo/ui/a2ui (public repository: hanzoai/ui), @hanzo/gui, and @hanzo/design semantic tokens (HIP-0504), and emitted by agents via the render_ui MCP tool in hanzoai/gen (HIP-0010). Agents propose declarative, allowlisted component trees and data models over JSON/JSONL rather than raw HTML or executable code. Surfaces render natively across web, desktop, and mobile shells, compile deterministically to @hanzo/ui TSX via <A2UIWorkbench />, and bridge to real-time creative and audio engines strictly through lock-free parameter rings.

The core @hanzo/ui/a2ui renderer, 19-component Basic Catalog, <A2UIWorkbench />, compileA2UIToJSX compiler, and hanzoai/gen emitter exist in hanzoai/ui and hanzoai/gen; domain-extensible creative/audio catalogs and workspace surface libraries below are normative targets whose availability MUST be proven per product before being declared shipped.

Motivation

Agents working inside chat, research, code, and creative applications frequently need structured interactive controls — parameter inspectors, approval dialogs, comparison matrices, batch render sheets, and live rack controls — that plain markdown cannot express. Allowing agents to stream raw HTML, iframes, or arbitrary JavaScript introduces XSS, credential exfiltration, visual drift, and unmaintainable one-off widgets.

A single declarative protocol mapped onto @hanzo/ui and @hanzo/design guarantees that every agent-generated panel inherits Hanzo's typography, dark and light themes, accessibility, keyboard navigation, and zero-trust action boundaries while remaining inspectable, compilable to TSX, and reusable across every Hanzo product.

Specification

The key words MUST, MUST NOT, SHOULD, SHOULD NOT and MAY are to be interpreted as in RFC 2119.

1. Wire protocol and catalog identity

The canonical Hanzo catalog identifier is:

HANZO_A2UI_CATALOG_ID = "https://hanzo.ai/a2ui/catalog/v1"

Conformant renderers MUST accept HANZO_A2UI_CATALOG_ID as well as the standard A2UI v1.0, v0.9, and v0.8 catalog identifiers (STANDARD_A2UI_CATALOG_IDS).

Payloads are encoded as newline-delimited JSON (JSONL) or a JSON array of message envelopes carrying "version": "v1.0". Renderers MUST support the four A2UI 1.0 envelopes and the three v0.9 compatibility envelopes:

EnvelopeVersionSemantics
createSurfacev1.0Initialize a surface (surfaceId, catalogId, root, optional inline components and dataModel, optional sendDataModel).
updateComponentsv1.0Upsert flat component nodes ({ id, component, ...props }) into an existing surface.
updateDataModelv1.0Patch dataModel at an RFC 6901 JSON Pointer path with op: "replace" | "add" | "remove".
deleteSurfacev1.0Remove a surface and its local state by surfaceId.
surfaceUpdatev0.9 compatUpsert nested ({ id, component: { Card: { ... } } }) or flat component nodes.
dataModelUpdatev0.9 compatApply typed contents arrays (valueString, valueNumber, valueBoolean, valueMap, valueList) or plain objects.
beginRenderingv0.9 compatSet root and catalogId on a surface populated via surfaceUpdate.

Streaming parsers (parseA2UI) MUST ignore incomplete trailing JSONL lines during live token streaming and MUST preserve local user edits across incoming non-conflicting updates. Mixed prose/UI turns MUST extract fenced ```a2ui blocks via extractA2UIBlocks and round-trip user actions via formatA2UIActionMessage.

The protocol layer (@hanzo/ui/a2ui/protocol) MUST remain pure TypeScript with zero DOM or React client runtime dependencies so server routes, React Server Components, CLI tools, and conformance harnesses can parse, validate, resolve, and compile surfaces without a browser.

2. Security and zero-trust execution model

Agent-generated UI payloads are untrusted data, never executable code.

  1. Allowlisted catalog only. Renderers MUST ONLY instantiate components present in the active allowlisted catalog (defaultA2UICatalog merged with explicitly audited host extensions). Unknown component types MUST be ignored safely by default unless the host explicitly opts into a diagnostic fallback.
  2. Zero dynamic code or raw HTML. Renderers MUST NOT execute eval, new Function, inline scripts, untrusted HTML injection, or arbitrary CSS injection from A2UI payloads. Inline text formatting in Text MUST use a safe structured parser rather than raw HTML rendering.
  3. Safe URL validation. Image and any link-bearing component MUST validate URLs (isSafeImageUrl) and MUST reject javascript:, vbscript:, and untrusted data: URIs.
  4. Prototype-pollution prevention. Two-way @path bindings use RFC 6901 JSON Pointers (including ~1 and ~0 escapes and relative paths inside List templates). Pointer validation (isSafePointer, isSafePointerSegment) MUST reject __proto__, constructor, and prototype segments, and pointer writes (setPointer, deletePointer) MUST be immutable.
  5. Pure allowlisted @call expressions. Computed bindings MAY invoke only pure functions registered in A2UI_BUILTIN_FUNCTIONS: formatCurrency, formatDate, formatNumber, join, concat, coalesce, not, eq, neq, gt, gte, lt, lte, and, or, if, len, upper, and lower. Unregistered function calls MUST fail closed.
  6. Input validation checks. Interactive inputs MAY declare checks (required, minLength, maxLength, regex, min, max, email), evaluated by validateChecks / validateSurface before non-cancelling actions dispatch.
  7. Scoped action.event.context submission. Clicking an interactive control MUST resolve (resolveA2UIAction) and emit only the keys explicitly declared in action.event.context, yielding { surfaceId, name, context }. Private dataModel fields (tokens, secrets, internal IDs) MUST NOT leave the client unless the surface explicitly sets sendDataModel: true and host policy permits it.
  8. Authorization remains server/host-authoritative. An A2UI action event is a user request, not a bypass of IAM, workspace tenancy, consent, or budget checks. Hosts MUST validate permissions on every dispatched command.

3. Basic Catalog (19 components) and token conformance

@hanzo/ui/a2ui defines a 19-component Basic Catalog mapped directly onto @hanzo/ui / @hanzo/gui primitives and @hanzo/design semantic CSS tokens (var(--*)):

CategoryComponents
Layout (7)Card, Column, Row, List, Tabs, Modal, Divider
Content (5)Text, Image, Icon (inline SVG paths, zero remote requests), Badge, Progress
Interactive (7)Button, TextField, DateTimeInput, CheckBox, Switch, ChoicePicker, Slider

All Basic Catalog components MUST style exclusively via @hanzo/design semantic tokens (HIP-0504), adapt automatically to dark and light themes and brand overlays (@hanzo/ui, @luxfi/ui, @zooai/ui), support keyboard navigation and accessible labels, and function both inside and outside <GuiProvider>. Button MUST default to an outlined/secondary visual hierarchy and render primary emphasis only when primary: true is declared.

4. Domain-extensible catalogs

Host applications MAY register domain-specific components on top of defaultA2UICatalog via the catalog merge prop without altering the A2UI 1.0 wire format. Domain extensions MUST obey all §2 zero-trust rules and HIP-0504 token conformance. Planned domain catalog families include:

  • Creative and visual editors (HIP-0506, HIP-1406–HIP-1410): layer and mask parameter sheets, color grading/curve inspectors, timeline trim and marker controls, render preset selectors, and visual before/after comparators.
  • Audio, Sound, and DJ (HIP-1411–HIP-1413): DAW rack parameter strips, rotary/fader controls, EQ/dynamics inspectors, deck cue/stem strips, automix transition previews, and MIDI/HID learn dialogs.
  • Research and platform surfaces: side-by-side experiment comparators, evidence/approval cards, and structured deployment checklists.

Unknown domain components encountered on a host that does not register that extension MUST degrade safely per §2.1 without crashing the surface.

5. Live review, compilation, and reuse contract

To ensure generated interfaces are auditable and reusable rather than disposable:

  1. Interactive review workbench (<A2UIWorkbench />). Surfaces MAY be opened in <A2UIWorkbench />, which pairs live <A2UISurface /> preview and a zero-trust Action Inspector ({ surfaceId, name, context }) with an editable A2UI 1.0 JSON/JSONL pane (carrying live parse/validation diagnostics) and a compiled @hanzo/ui TSX pane.
  2. Deterministic TSX codegen (compileA2UIToJSX). Both @hanzo/ui/a2ui and @hanzo/ui/a2ui/protocol MUST expose compileA2UIToJSX, which deterministically compiles any validated A2UISurfaceState into clean, reviewable @hanzo/ui TSX source code with zero eval or unsafe raw HTML.
  3. Workspace save, load, and run library. Workspaces MAY persist validated A2UI JSONL payloads (and optional compiled TSX snapshots) as versioned layer patches or signed mods through the HIP-0528 persistence, review, undo, and audit mechanisms (never a competing generative-UI store), pinning catalogId, component schema version, and provenance. Reloading a saved surface MUST re-validate the payload against the active allowlisted catalog and MUST NOT bypass HIP-0528 / IAM host authorization on action submission.
  4. Agent MCP emission (hanzoai/gen). Agents emit A2UI 1.0 surfaces through the render_ui MCP tool (gen __a2ui, HIP-0010) targeting HANZO_A2UI_CATALOG_ID. Prompt contracts MUST source the canonical catalog description and envelope rules from HANZO_A2UI_SYSTEM_PROMPT and A2UI_CATALOG_DESCRIPTION exported by @hanzo/ui/a2ui rather than hand-copying divergent schemas.

6. Real-time creative and audio thread isolation

Generative UI parsing, schema validation, React/GUI reconciliation, <A2UIWorkbench /> codegen, and agent MCP/LLM round-trips MUST execute asynchronously on the UI or background worker thread.

When an A2UI surface controls a real-time engine — including Hanzo Audio (HIP-1413), Hanzo Sound (HIP-1411), Hanzo DJ (HIP-1412), or GPU/WebGPU compositing and playback pipelines (HIP-1407–HIP-1410):

  • Parameter updates and action events MUST cross into the real-time engine strictly through bounded, preallocated lock-free parameter or command rings, applied at safe DSP or frame boundaries with smoothing where required.
  • Audio DSP callbacks and real-time frame render threads MUST NEVER wait on A2UI surface reconciliation, DOM/UI mutexes, durable task queues (HIP-1062), network I/O, or LLM inference.
  • Agent disconnect, invalid JSONL payloads, or UI errors MUST fail cleanly in the UI layer without interrupting audio playback, transport synchronization, or local hardware controls.

7. Conformance

A conformant A2UI 1.0 implementation MUST pass automated verification for:

  • v1.0 (createSurface, updateComponents, updateDataModel, deleteSurface) and v0.9 compatibility envelopes, including partial-line streaming resilience;
  • all §2 security invariants (unknown component suppression, raw HTML/script rejection, unsafe URL blocking, RFC 6901 prototype-pollution rejection, allowlisted @call enforcement, validation checks, and private dataModel exclusion when sendDataModel is unset or false);
  • all 19 Basic Catalog components rendered exclusively with @hanzo/design semantic tokens across dark and light themes;
  • deterministic compileA2UIToJSX output with valid @hanzo/ui TSX; and
  • non-blocking lock-free ring isolation when bridged to a real-time audio or GPU engine.

8. Operating environment interoperability

A generated interface remains a declarative view regardless of whether it is rendered in the web, desktop, native OS or authorized remote session. HIP-1414 owns runtime placement and compatibility guests; HIP-0528 owns persisted layer patches, mod approval, workspace switching and grants; HIP-0504 owns the component substrate. HIP-1416 owns design documents and their editable export. A generated view MUST NOT bypass those boundaries, invent a second catalog, or require the optional Linux guest to render first-party components. Verify local/native rendering, accessibility and action-denial behavior for each supported profile.

Rationale

Rendering agent UIs through an allowlisted declarative catalog on @hanzo/ui instead of sandboxed HTML/iframe blobs eliminates an entire class of injection and cross-origin bugs, removes iframe resize and theme-mismatch friction, keeps bundle and memory footprints small, and allows every generated panel to be compiled deterministically into first-class @hanzo/ui TSX when a team decides to graduate it into permanent product code.

Security Considerations

The primary threat model is prompt-injected or compromised agent output attempting to execute script, spoof trusted chrome, exfiltrate secrets from client state, pollute JavaScript prototypes via JSON Pointers, or trigger unauthorized side effects. Strictly declarative component allowlisting, safe URL filtering, immutable RFC 6901 pointer validation, pure @call functions, explicit action.event.context allowlists, and host-side IAM/consent enforcement on every dispatched action mitigate these risks in depth. In real-time audio and performance applications, strict lock-free thread isolation additionally prevents untrusted UI payloads from causing denial-of-service audio dropouts or unsafe output level jumps.

References

Copyright

Released under CC0 1.0 Universal Public Domain Dedication.