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:
| Envelope | Version | Semantics |
|---|---|---|
createSurface | v1.0 | Initialize a surface (surfaceId, catalogId, root, optional inline components and dataModel, optional sendDataModel). |
updateComponents | v1.0 | Upsert flat component nodes ({ id, component, ...props }) into an existing surface. |
updateDataModel | v1.0 | Patch dataModel at an RFC 6901 JSON Pointer path with op: "replace" | "add" | "remove". |
deleteSurface | v1.0 | Remove a surface and its local state by surfaceId. |
surfaceUpdate | v0.9 compat | Upsert nested ({ id, component: { Card: { ... } } }) or flat component nodes. |
dataModelUpdate | v0.9 compat | Apply typed contents arrays (valueString, valueNumber, valueBoolean, valueMap, valueList) or plain objects. |
beginRendering | v0.9 compat | Set 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.
- Allowlisted catalog only. Renderers MUST ONLY instantiate components
present in the active allowlisted catalog (
defaultA2UICatalogmerged with explicitly audited host extensions). Unknown component types MUST be ignored safely by default unless the host explicitly opts into a diagnostic fallback. - 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 inTextMUST use a safe structured parser rather than raw HTML rendering. - Safe URL validation.
Imageand any link-bearing component MUST validate URLs (isSafeImageUrl) and MUST rejectjavascript:,vbscript:, and untrusteddata:URIs. - Prototype-pollution prevention. Two-way
@pathbindings use RFC 6901 JSON Pointers (including~1and~0escapes and relative paths insideListtemplates). Pointer validation (isSafePointer,isSafePointerSegment) MUST reject__proto__,constructor, andprototypesegments, and pointer writes (setPointer,deletePointer) MUST be immutable. - Pure allowlisted
@callexpressions. Computed bindings MAY invoke only pure functions registered inA2UI_BUILTIN_FUNCTIONS:formatCurrency,formatDate,formatNumber,join,concat,coalesce,not,eq,neq,gt,gte,lt,lte,and,or,if,len,upper, andlower. Unregistered function calls MUST fail closed. - Input validation checks. Interactive inputs MAY declare
checks(required,minLength,maxLength,regex,min,max,email), evaluated byvalidateChecks/validateSurfacebefore non-cancelling actions dispatch. - Scoped
action.event.contextsubmission. Clicking an interactive control MUST resolve (resolveA2UIAction) and emit only the keys explicitly declared inaction.event.context, yielding{ surfaceId, name, context }. PrivatedataModelfields (tokens, secrets, internal IDs) MUST NOT leave the client unless the surface explicitly setssendDataModel: trueand host policy permits it. - 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(--*)):
| Category | Components |
|---|---|
| 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:
- 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/uiTSX pane. - Deterministic TSX codegen (
compileA2UIToJSX). Both@hanzo/ui/a2uiand@hanzo/ui/a2ui/protocolMUST exposecompileA2UIToJSX, which deterministically compiles any validatedA2UISurfaceStateinto clean, reviewable@hanzo/uiTSX source code with zeroevalor unsafe raw HTML. - 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-0528persistence, review, undo, and audit mechanisms (never a competing generative-UI store), pinningcatalogId, component schema version, and provenance. Reloading a saved surface MUST re-validate the payload against the active allowlisted catalog and MUST NOT bypassHIP-0528/ IAM host authorization on action submission. - Agent MCP emission (
hanzoai/gen). Agents emit A2UI 1.0 surfaces through therender_uiMCP tool (gen __a2ui,HIP-0010) targetingHANZO_A2UI_CATALOG_ID. Prompt contracts MUST source the canonical catalog description and envelope rules fromHANZO_A2UI_SYSTEM_PROMPTandA2UI_CATALOG_DESCRIPTIONexported by@hanzo/ui/a2uirather 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
@callenforcement, validationchecks, and privatedataModelexclusion whensendDataModelis unset orfalse); - all 19 Basic Catalog components rendered exclusively with
@hanzo/designsemantic tokens across dark and light themes; - deterministic
compileA2UIToJSXoutput with valid@hanzo/uiTSX; 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
- HIP-0010 — Model Context Protocol (MCP) Integration Standards
- HIP-0504 — Unified Cross-Platform Design System
- HIP-0506 — Hanzo Studio — Agentic Multi-Modal Creative Runtime
- HIP-0528 — Mods: The App SDK
- HIP-1062 — Tasks: The Durable Run
- HIP-1406 — Hanzo Creative — Shared Standard Library
- HIP-1413 — Hanzo Audio — Real-Time DSP and Synchronization
- HIP-1414 — Hanzo OS — Native and Web Runtime
Copyright
Released under CC0 1.0 Universal Public Domain Dedication.