app object it receives. When it succeeds, your app is online at /apps/<workspace slug> and /p/<workspace slug>, and its buttons trigger your workspace automations.
The page hosting the app sends every call with the user’s session. Isolated means the app embeds its own libraries and styles, not that its code is sandboxed: in its page it runs in the platform’s origin, with the visitor’s session, like any other app of the platform.
Before you begin
- Who: a workspace builder with edit access to the workspace in Builder.
- Where: Builder, Pages section of the workspace.
- Requires: a workspace without a page. The starter adds four automations (
_auth,on-app-greeting-requested,v1/status,mcp) and keeps any automation that already has one of these slugs. - Impact: the deployed app is visible to signed-in users of the platform, or to anyone if you make it Public.
Create the app
1
Start from the isolated starter
In Builder, open the workspace and select + next to Pages. The preview shows the starter home page with the Isolated badge, and the four automations appear in the sidebar.
2
Run the examples in the preview
The home page, Learn how your app works, offers one tile per mechanism. Select a tile to try it: Your backend shows
{"status":"ok", ...}, Real time shows Hello World from the automation!, Shared tools shows Hello <name>!. See all the steps lists every mechanism with the file and the code it uses.3
Edit the code
Open
src/pages/Home.tsx and change the title. The preview updates within a second. The app entry is src/App.tsx; its default export receives { app }.4
Deploy
Select Deploy in the header, then Deploy in the dialog. An isolated app has no App format choice: it always deploys as isolated. The dialog confirms
Deployed v<version>.Call the workspace from your code
Each call below matches a starter example. Replace the slugs and event names with your own automations.app object offers the following methods. Each namespace is available when the host announces it: check app.hasCapability('<name>') before using it in a view that can also run elsewhere.
Open the app’s agent
Your app can open the chat of an agent floating over its page, so the user asks questions about what the app shows without leaving it.1
Pick the agent
In the Deploy dialog, select an agent under Agent of the app, then select Deploy. The list shows the agents you can use. Under When the page opens, choose how its chat shows when a user opens the page: Closed (a chat button, the default), Open over the app, or Side by side, a column next to the app. On a page too narrow for both, side by side opens the chat over the app.
2
Open the chat from your code
Call
app.agent.open(), for example from a button. Check app.hasCapability('ai.prisme/agent') first: the page offers it only to a user who can use the agent.3
Share what the user sees
Call
app.updateModelContext({ content: [{ type: 'text', text: 'Selected month: March' }] }). The context goes with the user’s next question.app.agent.close() reduces it to that button.
Start a new conversation
app.agent.close() folds the chat but keeps its conversation. To start over without reloading the page, call app.agent.open({ newConversation: true }): the chat opens empty, on a new conversation. Without the option, app.agent.open() keeps the conversation in progress. The user can do the same from the New conversation button in the chat’s header.
app.hostCapabilities.experimental?.['ai.prisme/agent']?.newConversation is true. A page that does not announce it opens the chat on the conversation in progress.
React to a button in the agent’s answer
When the agent answers with buttons (an A2UI surface), a click reaches your app at once, in the user’s browser: open a form, show a record, without a round trip through the workspace.1
Give the agent an interactive surface
Use an A2UI tool with
wait_for_action: true and a Button whose action names what to do, for example action: open_form. Without wait_for_action: true, the buttons are disabled (see Interactive surfaces).2
Listen in your app
Subscribe to
agent.action on the page scope. The event carries the action’s name and the values of the surface in data.Use the provided libraries
An isolated app can import only its own files and the libraries the platform provides. The build copies them into the app, so a platform upgrade never changes a deployed app. To get a fix the platform ships in these libraries, deploy the app again: the Deploy dialog says when a redeployment is advised.reactandreact-dom18.3.1@prisme.ai/mcp-apps(theappobject and its React helpers)@radix-ui/react-*: alert-dialog, avatar, collapsible, dialog, dropdown-menu, label, popover, scroll-area, select, separator, slider, slot, switch, tabs, tooltiplucide-react,clsx,tailwind-merge,class-variance-authority
@/lib/..., @/hooks/..., @prisme.ai/sdk), stops the deployment with the file and line of the import.
To use another npm package, build the app locally (next section).
Build locally
The open-sourceprismeai/starter-spa repository builds the same isolated app outside Builder, in your IDE, with any npm package. It holds the same starter, plus a view the hello tool shows in the chat.
- Build: one self-contained bundle per view (
src/App.tsx, then eachsrc/views/<Name>.tsx), with React, your npm packages and the@prisme.ai/mcp-appskit inside. The kit and its types ship in the repository (vendor/);npm run sync-kittakes the kit your platform serves under/vendor/. No public registry is needed beyond your npm mirror. - Deploy:
npm run releasepushes the automations and the sources (the app opens in Builder with the same code), uploads the views as workspace assets with the app’s sharing (PRISMEAI_SHARING) and sets the app in the workspace configuration: format, views, agent (PRISMEAI_APP_AGENT). It refuses to replace an app in the shared format. - Builder round trip:
npm run checklists the imports Builder cannot compile (packages not listed above). An app that has some still builds and deploys from the repository, but its Builder preview and Deploy fail.
legacy-shared branch.
Verify the result
- Open
/p/<workspace slug>#/dashboardin a new tab, then select the browser’s back button. The route stays in the address bar and the back button returns to the home page. - Optional: in the Deploy dialog, set access to Public and deploy again. In a private browser window, the home page loads without a session and shows Sign in to open the live demo.
Troubleshooting
... is a platform module, not available in isolated apps
Cause: the code imports a platform module, for example code copied from a shared app.
Owner: the workspace builder.
Resolution: replace the import with the matching app method. See Migrate a shared app to isolated for each replacement, then deploy again.