Concepts

Actions and risk levels

Rendel can only do what you register, and risk decides the ceremony.

An action is a typed capability you register in code: name, description, parameter schema, risk level, and a handler that runs inside your app. An action registered in your app gives us no credentials and no elevated privileges: your handler uses the same session and backend calls the rest of your app uses. Actions you add in the console are different. The server calls your API itself, either with a key or account you give it (read only) or with the signed-in person's own token. See Actions from the console.

See what it looks like to your customers and your team: Actions.

The five ways a confirmation ends: succeeded, failed, declined, expired and timed out. Only the first one means the action happened.The model proposesrefund_orderThe server builds the cardfrom your template and validated paramsThe user taps Confirmthe only path that runs anythingYour handler runsin your app, as your userIt ends in exactly one of thesesucceededYour handler returned okfailedYour handler returned an errordeclinedThe user said no, or a result arrived unconfirmedexpiredTen minutes passed. Decided on the servertimed_outYour handler passed its own timeoutA result posted without confirmed: true is recorded as declined, whoever sent it.
A write or destructive action has five endings and only one of them means the thing happened. expired is the one apps forget: it is decided on the server, ten minutes on, to a card the user may still be looking at.

Risk levels

LevelBehavior
readExecutes immediately. The handler runs, the result flows back, the answer renders.
writeA confirmation card renders first. The handler only runs after the user confirms. Expires after 10 minutes if ignored; a person who left it unanswered is told it is waiting (Notify when done). A write that names the action that undoes it (undo, such as remove_from_cart for add_to_cart) runs at once instead, and the answer says what it did with an Undo for ten minutes (action_done). confirm: "always" in your code, or Asks first under Before it runs on the action's page, keeps its card.
destructiveExplicit, unambiguous confirmation with a stricter UI affordance: the card raises its edge to full ink, says the action cannot be undone, and fills its confirm button in danger. Mark one undoable when the user can still take it back afterwards (an order that can be cancelled while it is packed): it is asked like a write, without the warning. Expires after 10 minutes if ignored.

The console can make an action's risk stricter than declared, never looser, and can disable any action with immediate effect. An endpoint on your server that was saved as a change can be set to ask less only after you confirm what that changes, and the audit log records who did it.

The server records the confirmation itself: the SDK sends the tap to POST /v1/invocations/:id/confirm before your handler runs, and the device's own claim is not taken as the answer. This is on for every app. See Security. A write or destructive action that asks first is always proposed alone: never in the same turn as another action, though it can share the turn with the page that shows it.

Values the user can change on the card

A write or destructive action can name parameters the user may change on its confirmation card before they confirm: editable on the action in the Flutter and Web SDKs, or Changeable on the card beside a parameter of a console action. The model proposes "2 tickets", the user wants 3: they change it on the card instead of asking again. A value the user gave in their own words ("switch me to the complete routine") is not drawn as a control: the card asks only for what they have not said, and shows the rest with its two buttons.

The card draws each one as a control that fits its type: a stepper or a number field for a number, a text field for text, a picker for one of a list, a switch for yes or no. A changed value goes to the server, which checks it exactly as it checks the model's proposal (type, enum, bounds, length) and redraws the card with it, so the question on the card always shows what will run. A value that fails is refused with the reason. Your handler, or your endpoint, receives the values as confirmed.

Mark what a user would reasonably change: a quantity, a note or message they might reword, one of a few choices (where a refund goes), a yes or no flag. Never an id, and never an amount your app computes, like a price or a total: the card is the user's last chance to say what they want, not a way to change what the app decided.

Choices as your app shows them

A confirmation card should read like your app's own screen. Four words on a parameter make it so; the setup agent fills them from your screens and translation files:

  • The app's words for each value (value_titles on a console action, valueTitles in an SDK action's schema): "$", "$$", "$$$" for budget_1 to budget_3, "4 Stars" for four_star, per language. The card shows these, never the code, and the model hears them too, so "something mid-range" picks budget_2.
  • Options that depend on another field (options_by / optionsBy): when your API keeps every type of place in one list but your screen shows a category's own, say which go with each category. The card and the model offer only those, and when the person changes the category on the card it drops a type that no longer fits and offers the new ones.
  • A field only for some choices (shown_when / shownWhen): a star rating asked only for a stay is left out of a shop's post and its card.
  • A value picked from a search (from_action / fromAction): a place your screen picks from a places search, a user from a user search. It is never a text box on the card. The assistant calls that search, the person picks, and every field the pick fills (the place's id, city, country code, coordinates) is copied from that one result; a value no result held is refused before your endpoint is called. When only your app can run the search (it calls Google Places with its own key), that search is a client action.

A file parameter shows the photos the person attached on the card itself, not their file names (Flutter 0.94.0, Web 0.69.0; an older build shows the first photo beside the card's question).

A row reads as a person reads it: a provider's key or a machine's id, however short (post_id: 146753, result_id: 342e131a), shows as the name the result gives it (a room's name, never its rate key) or not at all, while a reference written as a code (M-2021) stays, a day as "18 December 2026", an amount in the call's currency, a country code as the country, and a value with nothing in it is no row. The company your API works through, under provider or supplier (a booking supplier, a payment system), is no row either, and the assistant's own words leave it out: the person deals with your app, is never told which system is behind it, and is never asked to choose one. The model is also asked to read what the person's account already holds (their nationality, phone, address) from your profile action before the card asks for it.

Type it back, read it all

For the gravest actions the card can ask more before its confirm button works. Type it back to confirm: the user types a parameter's value exactly as the card shows it ("type the list's name to delete it"), and the server compares it again before anything runs. Read it all before confirming: a long text parameter shows whole, behind Read all, and the button works once all of it has been opened. Show the lines that change also marks what the text changes, against the current text your app hands over with setCardSource.

Set them in code (typeToConfirm and fullText in the Flutter and Web SDKs), or switch them on for one action in the console, under Stricter confirmation in the Advanced (developer) part of Before it runs on its page, for an action in your app's code or on your server. What your code sets stays on. Mobile SDK 0.50.0 and Web SDK 0.27.0 draw the first two; while one is on from the console, older builds and the console's Test page are not offered that action. Showing the changes from the console needs a newer build, and older ones show the whole text without them.

A file the person attached

When an action works on a file (a photo to post, an outfit to score, a receipt to send), give it a file parameter: RendelSchema.file() in the Flutter SDK, { type: "string", format: "attachment" } in the Web SDK. The photo the person attached in the conversation goes to that action, the card shows the photo, and your handler turns the id it is given into the file with Rendel.attachment(id). Make the parameter optional when your action can also ask for the file itself, such as opening the gallery when nobody attached one. Only a file this person attached in this conversation is accepted. From Mobile SDK 0.116.0 and Web SDK 0.91.0.

Registration

An action is a name, a description, a parameter schema, a risk level and a handler. Your agent writes it when an endpoint has to run in your app (Connect an endpoint); the API is in the Flutter SDK and Web SDK references.

  • The description steers the model. It chooses from names, descriptions and parameter types, so say when the action is the right one, in your users' words.
  • Parameters are checked before anything runs: types, enums, bounds and required keys, with anything undeclared rejected. A proposal that fails goes back to the model as a correction, never to your handler.
  • confirmTemplate words the server-built confirmation card for write and destructive actions.
  • Names are snake_case. The server rejects the whole manifest over one bad name, so the SDK asserts it where you write it.
  • A handler has fifteen seconds by default. Past it, the model is told the action failed.
  • When running it twice would be worse than not at all, the handler takes the whole invocation and uses its id, stable across a retried turn, as an idempotency key (RendelInvocation).

In app code or on server

Every action runs in one of two places, and the console's Actions page lists both, in two tabs of one list: In app code (what your app registers with registerAction, as its last build reported) and On server (endpoints Rendel's server calls). While only one of them has actions, the page shows that one alone, and the other is a link under Developer details at its foot. Each row carries where it came from: AI setup, Import or Manual.

Prefer on server wherever the call allows it: it is edited in the console without a release, and a write there goes through the server-recorded confirmation described below. Register in code only what a server cannot call. This is also the rule a setup agent follows:

The endpointMake itWhy
REST over HTTPS, reachable from the internet; no auth, or the signed-in user's tokenOn serverThe default
REST that wants a key your app sends itself (an X-API-Key, a partner or Google key), with or without the signed-in user's tokenIn app codeYour app already holds the key, so Rendel never asks you for one
A Firebase or Supabase SDK, a GraphQL client, gRPC, signed requests, certificate pinningIn app codeThe call cannot be repeated from outside the app
Only reachable on an internal network or localhostIn app codeRendel's server cannot reach it
On-device state: a cart, settings, a local databaseIn app codeIt is not on any server
It only opens a screenNot an action: a screenOpening a screen changes nothing

An action on server that runs as the signed-in user needs their token from your app: RendelConfig.userToken in Flutter, setUserToken on the web.

Actions from the console

An action does not have to be code. On the On server tab, Connect an API takes one address that already works in a browser, or reads your API's documentation — a Swagger or OpenAPI page, a YAML spec, a PDF of the reference, or a Postman collection (v2.1 .json) — lists the endpoints, and your team ticks the ones Rendel may use. The server calls them; nothing is registered in the app. Each endpoint in a spec says what calling it does: a GET, and a POST that searches, lists or says it is a preview, reads; a DELETE, and a write that charges, pays, buys or refunds, can't be undone; any other write changes data. One that hands back an API key or another secret is listed but never added, as a sign-in is, so the secret never passes through the chat.

A parameter is text, a number, yes or no, one of a list (only the values you name), a list of text or numbers, or a file the person attached in the chat (a photo, a PDF), alone or as a list. A list goes in a query string as the key repeated (tag=a&tag=b) and in a body as a JSON array. The model is told the allowed values, and the server refuses any other before your endpoint is called.

An endpoint with a file parameter is called as multipart/form-data: the file under its parameter's name, every other field of the body template beside it as a form field. That is how a photo the person attaches becomes a post, a cover or an avatar on your API, and the model only ever hands the server the file's id, never its bytes. An endpoint that takes a URL-encoded form, or a multipart form with no file, says so in its body_encoding.

What an endpoint answers is read whatever it is written in: JSON, XML (as the object it describes), CSV (as rows), HTML (as the words on the page) or plain text. Only an answer that is not text at all, such as a picture or a PDF, cannot be read as data.

When your API grows

Rendel reads your API's document again every day, at 05:00 UTC. A new endpoint in a Swagger or OpenAPI spec is connected by that read itself, by the rules of an import: one that changes something runs only as the signed-in user and behind its confirmation card, and a sign-in endpoint is never added. It is connected only on a host your actions already call: one the document now places on another host is listed for you to connect by hand, so an edited servers entry never sends a person's sign-in somewhere new. A path that moved is followed for the actions that read. An action whose endpoint is gone from the document is removed. An action whose endpoint's query parameters or body fields changed is rewritten: it stops sending one that was dropped and can send one that was added, as an optional value, and everything else you set on it stays. An added body field that is an object or a list of objects, or one that would carry a password or a code through the chat, is named in the list and not given to the action. Each of these is listed with what was done, and nothing is asked of you. When three or more actions would be removed at once and they are more than half of the ones made from that document, none is removed and the change is listed for you: a document that lost most of itself overnight is more often broken than right. A write whose path moved and a key the document newly asks for are listed for you too. One that could not be connected is listed with the reason and tried again the next morning.

Actions › On server shows what each read found, each line with its date and time, and every endpoint's row says when it was added and when it last changed.

A document is watched once it is linked with Connect an API, or named by the coding agent that set the app up (api_documents). Where the agent named none, Rendel looks for the API's spec on the API's own host, at the addresses the common servers use (/openapi.json, /v3/api-docs, /docs-json, /swagger.json and their like): the morning after the setup, then every Monday until it finds one. A spec kept somewhere else, or behind a login, is linked once with Connect an API. A page or a PDF is read daily too, but its new endpoints are only listed, for you to add.

An endpoint that wants a shared key and has none yet is shown switched off, with Add key. Enter it, and the action can be turned on.

Shared API keys

Under Provider credentials, in Developer details at the foot of the same tab, a key is kept once for one host (api.example.com) and sent in a header, a query parameter or as a Bearer token. Every endpoint on that host can use it, and Replace key changes it for all of them at once. A key entered with Add key under a waiting endpoint is kept here too, and the next endpoint on the same API waiting for the same key takes it with one press.

An endpoint sends a shared key either on its own, instead of a key of its own, or beside the signed-in user's token: the token as Authorization: Bearer (or where auth_name says), the key in its own header or parameter. That is the shape of an API that wants your app's key and the person's session together. In the endpoint's editor, choose it under Also send a shared key.

A shared key goes only to the host it was saved for, and only over https. The server checks the address it is about to call, after every value is filled in; on another host, over plain http, or where the key and the user's token would go in the same header, the call is not made and Rendel is told why. The key is stored encrypted, is never shown again after you save it, and no console session can read it back. Removing one turns off the endpoints that used it and asks for a key again.

Who the call is made as decides what it may do:

Signed in asMay
A key, a header secret, a shared key, or an account made for RendelRead only (GET, or a POST that reads). None of these says whose data it is, so none may change it.
The signed-in user (their app passes their token: RendelConfig.userToken in Flutter, setUserToken on the web), with or without a shared key beside the tokenRead, and change something: POST, PUT, PATCH or DELETE, as write or destructive.

A console write takes a confirmation, and the server, not the device, decides it happened: the card is drawn from the action's confirmation question, the tap is recorded by the confirm endpoint for the device that owns the conversation, and only then does the server call your endpoint, once, with the token of the person who tapped. The exception is a write that names another console action that undoes it: the server calls it at once, and the answer offers Undo. Retrying a continuation never sends it twice; if an answer is lost on the way back, Rendel says it does not know whether the change happened rather than trying again. Writes are not called while you import or preview them, and they are offered only to builds that can confirm them (Flutter 0.27.0 and web 0.5.0 or later).

A write also needs to know who it is for. It is offered only on a turn where your app has named the signed-in person with identify, and the card remembers them. The server runs it only if the request confirming it names the same person, so a phone that switches accounts without calling reset() cannot spend one person's confirmation on another person's account; a token refreshed for the same person still works. If you have turned on identity verification (a userHmac from your backend), the confirming request must prove the person with it. Without verification, the binding is as good as the id your app passes to identify.

What a tap can do without an action

Buttons on a page carry one of six kinds, each offered only to a build that carries it out: reply (asks the next question), open_url (https only, to an address you vouch for, see Security; external only for a maps link), navigate (calls the open of a screen you registered with registerRoute, with params the server checked against the route), call (opens the dialler with the number filled in), copy, and add_to_calendar (opens the device's own editor). None of them runs an action handler or needs a confirmation card, because the user finishes each one. That is also why the number, the value, the times and any fromActions param must come from your actions' results (see Values the server checks).

The manifest

At startup the SDK canonicalizes your action set and syncs it as an immutable, hashed manifest. Different app versions in the field coexist cleanly; every conversation records exactly which manifest it ran under. The manifest uses the MCP tool shape, so exposing your actions to other agents later is a serializer, not a rewrite.

Register as many actions as your app has: past 300, each turn is given the ones its question needs, and the assistant loads another by name when it needs it. An action that breaks a rule, such as a description over 1,024 characters or more than twelve editable fields, is left out and named in the sync's answer, and the rest are saved.

Failure is a message, not a crash

A handler that throws or times out becomes an error result the model can read. It apologizes, adjusts or retries; your app keeps running. An HTTP action your endpoint refuses for its values (400 or 422) is different: the model is given your endpoint's own reason and calls it again with values it accepts, or drops that filter, before it answers.

Show the change in your app

A change Rendel makes lands on your API, but your app's screens keep what they read before until something reloads them: a list Rendel made is not on the Lists tab until a relaunch. Add one listener right after Rendel.init and reload what each action changes:

lib/rendel_service.dart
Rendel.changes.listen((change) {
  if (change.action == 'add_to_list') savedListsCubit.load();
});
Web
Rendel.on("changed", (change) => {
  if (change.action === "add_to_cart") cartStore.refresh();
});

change.action is the action's name, change.params the values it ran with, and change.undone is true when the person took it back. When you cannot tell which store an action touches, reload every one that holds the signed-in person's data. An action you register in code reloads in its own handler. See RendelChange.