Generate screens safely
NewThe assistant wants to build a screen for the person. How do you keep that safe?
The assistant picks parts from an approved list. The app draws them in its own look.
Try it
Trip budget
How to design it
- 1
Approved parts, app's look
Give the assistant a list of parts it may use and ignore anything else. The app decides colors, spacing and type.
- 2
Fall back to text
If a screen is invalid or fails, show the same answer as plain text.
- 3
Ask before big actions
A button that sends, pays or deletes asks the person first, in the app's own words.
- 4
Label it, keep the frame closed
Say who made the screen. A page that runs its own code stays in a closed frame that asks before each step.
Do and avoid
Do
- Show who made the screen.
- Offer Regenerate and a way to report a problem.
- Keep the frame closed unless a person allows a step.
- Give people the plain-text answer when the screen fails.
Avoid
- Do not let the assistant set colors or styles.
- Do not show a broken screen with no explanation.
- Do not run a generated page with access to the rest of the app.
- Do not skip the question before a consequential action.
Why it works
Google's A2UI and Vercel's json-render both let an assistant ask only for parts from an approved list, and the app does the drawing. The sources agree that the app, not the assistant, should own the look. One study found that the best models pass about 75% of single turns but only 37% of five-turn runs, so a safe fallback matters.