Agent Experiences

Generative UI & context design

Screens an AI model builds on the spot, and how to keep them predictable.

Definition

Generative UI is an interface an AI model puts together while someone is using it, in response to their specific request, instead of a layout a designer drew in advance. Rather than showing a fixed screen and filling it with data, the system decides for each reply which components to show, how to arrange them, and which controls to offer. Designing for it is mostly about setting limits: what the model can choose from, what it must never choose, and how people keep a steady sense of a screen that is different every time.

What makes it different from dynamic UI

Screens have always changed while people use them. A dashboard changes with the data, a personalized feed changes with the user, and a form shows an extra field when someone ticks a box. All of that is variation inside a design a person made. Every version existed before the user arrived, and somebody decided each one was acceptable.

With generative UI, the model decides what goes on screen at the moment it answers, and nobody listed the possible versions beforehand. A lot follows from that. Nobody can review every possible screen. The same request can produce different layouts on different tries. And the qualities designers usually guarantee (clear hierarchy, consistency, accessibility, and controls that do what they look like they do) now have to be enforced by the system around the model, because you can no longer check them in the finished design.

The spectrum of generative UI

“Generated interface” covers approaches with very different levels of risk. It helps to place any system on a scale of how much control the model has over what ends up on screen.

1. The model picks from ready-made components

The model chooses from a fixed library of components and fills in their settings: show a flight-results card, a confirmation control, a chart of these figures. A person designed, reviewed, and tested everything that appears. The model only decides which piece fits and what data goes in it.

The Vercel AI SDK (a code library for building AI apps) made this popular: the model asks for a component by name and the app shows a pre-built one. MCP (Model Context Protocol, a shared standard for connecting agents to tools) UI patterns work the same way, with a tool sending back a piece of interface that the app shows inside its own frame. It is the least glamorous end of the scale, and we think it is where most live products sit.

2. The model arranges the layout

The model puts known components together in new arrangements. This comparison needs three panels side by side; this answer needs a table, a map, and some filters. The pieces can still be trusted, but the arrangement can’t. The risk moves from what appears to whether the result has a clear hierarchy, sensible spacing, and an order that makes sense to read in. Layout rules, fixed slots for content, and a few approved page templates are there to keep that in bounds.

3. The model writes the whole screen

The model writes its own HTML, styles, or code, and the screen shows whatever it wrote. This is what the side panels in AI assistants do when they display an app or document the model made. That suits one-off requests, and the risk is why those panels are walled off from the rest of the app, clearly framed as generated, and kept away from anywhere the app takes an action that matters.

The design advice is simple. Give the model the least control that gets the job done, and never let a generated screen be the place where someone confirms an important action. A button the model wrote that says “Confirm transfer” comes with no guarantee about what it does. Approvals belong in the app’s own fixed controls, which the model can’t change.

What it means for design

Predictability is a feature, not a limitation

It’s tempting to treat flexibility as the main benefit. We think predictability matters more: people work faster on a screen whose layouts they recognize. If the same kind of question always produces the same kind of view, people learn where to look. If every reply invents a new layout, every reply has to be read from scratch, and that effort lands on people at exactly the moment they are trying to judge whether the answer is any good.

So define a small set of layouts and tie each to a type of request. Let the model choose a layout, not invent one. Keep the parts that are always there (the input box, the controls for running a task, the history, the stop button) in the same place in every generated view, so at least the frame stays steady while the contents change.

Helping people understand a screen that keeps changing

People learn what to expect through repetition, and a generated interface undermines that unless the system gives them something steady to hold on to. Three things help. Use the same name for the same thing in every view. Make the link between the request and the layout obvious, so the screen feels like a response rather than a random change. And remember what people did: if they pinned, filtered, or edited something, the next generated view should keep it instead of quietly resetting.

People also can’t tell what the system can do by looking at a generated screen, because what they see reflects this one request, not everything the system is capable of. You have to show what is possible somewhere else, with suggestions, examples, or a page that lists what it can do.

Accessibility can’t be left to the model

Ask a model for an interface and you will get something that looks right in a screenshot. Heading order, where the keyboard focus goes, labels tied to the right fields, color contrast, and whether everything can be reached by keyboard are not reliably kept when a model generates a screen. They are also invisible in the quick visual review most teams do.

  • Build accessibility into the components, not the prompt. When the model only picks from a library, the library carries the meaning for screen readers, the focus behavior, and the contrast, and the model can’t make them worse.
  • Let your app own the page structure. Have the app set heading levels and landmarks (the labeled regions screen readers use to jump around a page). Base them on where each piece sits, not on whatever the model wrote.
  • Handle focus and screen reader announcements in your app’s own code when content streams in. A screen that rewrites itself while someone is reading it is hostile to screen reader and keyboard users unless someone decided where the focus goes.
  • Run automated accessibility checks on the generated output as part of testing, as well as on the components by themselves.

Testing when the output changes every time

You can’t compare a screen against a saved picture of it when it’s different every time, but you can test everything around it. One way to split the work:

  • Components get the usual tests. The fixed library that people built is where normal visual, code, and accessibility testing applies, which is a good reason to keep that library small and fixed.
  • Measure the model’s choices instead of expecting one right answer. Build a set of typical requests, note which component or layout each should get, and track how often the model gets it right every time the model or prompt changes.
  • Check everything the model hands over. Treat its output like input from a stranger. Check that its settings are the right type, reject components that don’t exist, cap list lengths and text sizes, and plan a fallback for broken output instead of showing whatever arrives.
  • Some things must always be true. Whatever the model put together, the stop button is there, the source of the content is shown, the layout fits the screen, and no important control appears inside generated content.
  • Unusual cases break layouts. No results, one result, five hundred results, missing fields, very long text, and several languages cause trouble more often than the tidy example that gets shown in demos.

Trust and provenance

A generated interface looks just as official as a designed one, and the look of software suggests that someone checked it. People need to be able to tell what was generated, from what, and how far to trust it.

  • Make generated areas look different from the app’s own controls. A consistent visual style for anything the model put together does more than a disclaimer, because it works every time without anyone having to read it.
  • Credit the data as well as the answer. A generated table should say where its rows came from (which tool, which source, and when it was fetched) and let people click through to the original record.
  • Show when a view is out of date. Generated views are snapshots. If the data behind one has changed, the screen should say so rather than presenting an old view as current.
  • Never turn untrusted content into interface. Text pulled from a web page or document is something to display, not instructions to build a screen from. Where fetched content affects what appears, show that it did. This is the same reasoning that makes prompt injection (hidden instructions in content an agent reads) a design problem as well as a security one.
  • Let people look under the hood. They should be able to see the data or the request behind a view, and correct it.

The short version

We think most generative UI failures in live products come down to giving the model more say over the layout than the job needed.

See the path on your own site

The Agent Visualizer follows an AI agent through one of your pages and shows where it arrives, where it reads, where it gets stuck, and everything past that point it never reaches.

Further reading from Field Notes

Posts with more on this topic, each with its date.

All Field Notes

Stay Updated

A monthly email about AI search, AI crawler policy (the rules for the AI bots that visit websites), and new standards for agents. It includes every Field Note published that month, and you can unsubscribe at any time.

We store your email address only to send you this newsletter. See our privacy policy.