What generative UI means in an app
In a generative UI, a model produces part of the interface instead of a designer drawing every state in advance. The idea is simple. The hard part is control: a model that can draw anything can also hide the price, drop the legal links or invent text your team never approved.
TweakLane answers that with a narrow definition. The model never writes screens from nothing. It proposes a change to the layout, theme, navigation or named designs your app already has, using only the components, text and values you registered. The result is a generative interface that behaves like the rest of your product.
From one sentence to a previewed change
In edit mode the tray gets a "Describe the change" field. The user writes a request in their own language. The hosted backend asks the model for a change, validates the answer against your catalog and locks, and returns a proposal. The SDK draws it as a preview with a list of what changes. The user taps Apply or Discard. Apply is validated again on the device, saved, synced to the user's other devices and recorded as one undo step.
What the AI can change
Three routes cover the whole app. One screen: layout, theme, options and style, and on a user's own screen it may place portable parts and generic pieces. The navigation: entries, menus and the start screen. Named designs: create, switch, rename, duplicate, delete, restore and undo. The model behind it is Claude by Anthropic.
Why a generated change cannot break your app
Everything the model returns is treated as untrusted input and passes the same checks as a manual edit:
- A size cap, then a JSON object of at most 50 operations. Unknown fields are dropped.
- No URL-like strings that are not already in the layout or your catalog.
- AI policy: no new components on your own screens, none removed, swaps only within the alternatives you declared, props only set to values the app already uses.
- The full server validator: catalog, locks, structure and limits. Any failure returns a rejection with its reasons and nothing is applied.
- Proposals carry only your app's own text. Any string that is not in your catalog, the current document or the theme is refused.
Locks cannot be talked around. A request to hide the prices or drop Restore Purchases comes back rejected or as a safe substitute with a note, because locks are read only from your catalog and default documents. See Locks and Catalog.
Dynamic UI generation, on your catalog
Dynamic UI generation means the interface is assembled at runtime instead of fixed at build time. In TweakLane the assembly happens per user, from one sentence, and every result is a layout made of the components you registered. Nothing is generated as code, so there is nothing to review after the fact: a proposal is data, validated on the server and again on the device before it is applied.
Safety screening before the model sees a request
Every request is screened first. Deterministic checks normalise the text, strip invisible characters, limit it to 1 to 500 characters and refuse requests for the system prompt, keys or secrets and rule-override phrases. A classifier then reads the request and the names users typed into the screen, and returns allowed or a category such as violence, scam, off-task or injection. A refused request answers HTTP 422 and the SDK shows "TweakLane can only change how this app looks and is arranged." in the user's language.
Consent, limits and visibility
Before the first request leaves the device, a sheet names the provider, says what is sent and asks for permission. Consent is stored per user on the device and on the server, and the server refuses prompts without it. App Review guideline 5.1.2(i) asks for exactly this disclosure and permission. Per-user and per-app limits apply by the minute, hour and day, users with repeated refused requests are paused, and owners can block AI for a single user from the dashboard. Every request is logged for the whole team to read, with prompt retention you set. The details are in How AI works.