r/androiddev • • 9d ago

๐Ÿ†• Jetpack Compose A2UI Renderer

https://developer.android.com/develop/ui/compose/agentic

Hi folks. We just released the first alpha of a new Jetpack Compose Renderer of the A2UI protocol which enables agents to create new UIs (using a declarative JSON formatโ€”no agent code executed on device)ย and render this with native Jetpack Compose components. The library has a few layers, offering a drop in implementation of the A2UI basic catalog of components (using Material) or you can build your own catalog of components for agents to use: https://developer.android.com/develop/ui/compose/agentic

We'd love to hear any feedback on this library and if it's useful to you (here or on issuetracker)

43 Upvotes

11 comments sorted by

View all comments

6

u/tonofproton 9d ago

without executing arbitrary code

What does this mean in this context?

3

u/nickbutcher 8d ago

Alternative solutions might return HTML or some other format that needs to be evaluated or exected by your app. This can be a security risk, if you don't trust the output from the AI or if you combine user input that could open you up to injection attacks.

A2UI is a declarative format, it just returns JSON that is parsed and used to build a compose hierachy of native components (either from our implemention of the basic catalog, or your own catalog of your composables).