Security and privacy
Morph is built so that adding it doesn't widen what can reach your users or your data.
What Morph stores#
| Stored | Not stored |
|---|---|
A description of each page (sync): section names, layout, the types of your data, action names |
Your source code files |
| Each user's saved page versions: the page code the AI wrote and its CSS, and their app-wide look (theme CSS) | Your data, or anything your pages show |
| Your users' ids, and any attributes your token endpoint returns (e.g. a name) | Passwords, sessions, emails (unless you return them) |
| Your app's name, allowed websites, and a hash of its secret key | The secret key itself |
Values a user types into features Morph built for them (a goal, notes, a checklist), per user, up to 16 KB each. Turn off with savedValues: false in morph.config.ts |
Your app's own records: pages read those live from your data |
What the AI sees#
When a user asks for a change, the AI gets: the page description, the user's current page code, the request, the attributes your token endpoint returned, and a compact copy of how the page looks in their browser right now (its HTML elements and class names, its visible text, and your theme's colours and fonts), so new parts match your app. That copy is sent only when the user asks for a change and isn't stored. To send the structure without the text, use <MorphProvider pageText={false}>.
The AI never gets your data values directly or the rest of your app. Text that's visible on the page is in the copy unless you turn it off.
What npm init usemorph@latest sends#
If you let Morph's AI plan the setup (it asks first; --no-ai skips it), init sends once, over HTTPS: your page files, the layouts above them, the components a page renders (two levels deep), and files that look auth-related (e.g. auth.ts, middleware.ts, session helpers), each trimmed. Never .env files or node_modules. They're used to plan the setup and not stored. The AI returns decisions only; init applies them on your machine and shows you the full diff before writing anything.
Keys and tokens#
- Secret key (
sk_…): belongs to your app and is used only from your server. Morph refuses it from a browser. Stored as a hash. - User token: what your token endpoint hands the browser. Valid for one user of one app, for an hour, and only from the websites you allowed.
- Developer sign-in (
usemorph login): a GitHub sign-in that lets the CLI create and list your apps. Stored on your machine, readable only by you;logoutrevokes it.
Checks on every page#
Before a page is saved:
- On Morph's server, the code is checked: it may only import
react, your sections and Morph's helpers. Network requests, storage,eval, access to the rest of the document and similar browser APIs are rejected. - In the user's browser, the page is rendered and your rules are checked on screen (
keep,aboveFold…), and any part that can't be shown fails the check. - Actions only run if you listed them, and only right after the user clicks or types.
Saved pages are checked again each time they load; a page that no longer passes falls back to your original.
Good to know#
AI-written pages run inside your app's page, not in a separate sandbox, so the code checks above are the main safeguard. Only pass data you're comfortable showing to that user, and keep permission checks in your own actions and APIs, as you would anyway.
Found a problem? Please open an issue on GitHub, or for anything sensitive, contact the maintainer through GitHub privately rather than in a public issue.