---
title: Permissions
summary: Every permission string an extension can declare, what it unlocks, how it is granted and checked, what happens on update, what the store shows about where an extension's data can go, which people on a server may use an extension, who may create extensions and widgets (`server:extensions`, `server:widgets`), and what a paid extension that isn't paid for may still do.
audience: both
stability: stable
since: protocol 1
---

# Permissions

An extension lists what it needs in `ExtensionManifest.permissions`. The type is `Permission` (`packages/sdk/src/index.ts`). People see the list in the extension store before they install, and the host checks it on every call the frame makes.

This page describes the behavior of protocol 1 as the code implements it today, including the places where a permission is declared but not yet checked.

## How permissions are granted

| How the extension arrives | What is approved |
|---|---|
| Someone with `server:extensions` installs it from the registry | Everything its manifest declares, at install. |
| The owner installs a Studio build or a package file (**Install on this server**, **Import from file**, `npm run extensions:install`; `source: "local"`) | Everything its manifest declares. |
| Someone with `server:extensions` installs their own build (**Install on this server**; `source: "local"`; see [What a member may install](#what-a-member-may-install)) | Everything its manifest declares, on every install and update, but it runs only for its builder until the owner approves it for the team (see [How far a member's build reaches](#how-far-a-members-build-reaches)). |
| A build on this machine (`source: "dev"`, see `SPACEMIX_DEV_EXTENSIONS`) | Everything its manifest declares, on every rebuild. |
| Someone with `server:extensions` installs the essentials (the registry's defaults, **Settings → Extensions**) | Everything its manifest declares. Only the essentials that person may use are installed; the rest are skipped. |
| Studio preview (`studio:<project>` frame) | Every permission, whatever the manifest says (see [Studio previews](#studio-previews)). |

Installing from the registry, updating, approving or skipping an update, uninstalling and [deleting](#deleting-your-own-build) need the `server:extensions` permission and access to that extension (`extension:<id>` or `extension:*`); the owner has both. An unsigned package (a Studio build, a package file) is different: the owner can install any, and someone else with `server:extensions` only a new id or their own earlier build. See [Who can use an extension](#who-can-use-an-extension) and [Who may create extensions and widgets](#who-may-create-extensions-and-widgets). The approved list is stored in the installed record (`InstalledRecord.permissions`), not in the package. The frame and the host use the approved list, so `host.manifest.permissions` is what was approved, which can be less than what a newer package asks for.

## What owners see before installing

The store reads an extension's permissions and tells the people installing it where its data could go (`apps/desktop/src/lib/dataRisks.ts`, shown by `apps/desktop/src/shell/store/DataRisks.tsx`). It only reports: nothing it finds changes what the extension may do. It appears in three places:

- Under the extension's heading on its page in **Extensions** and on its Marketplace listing: one sentence on where it can send data, and how many warnings and high risks are under **Technical details**.
- **Data and risks**, at the top of **Technical details** on its page in **Extensions**: the level's badge, the hosts it may reach (its `net:<host>` and `net:*.<domain>` entries, then the hosts people allowed for `net:*`), and the list of risks.
- An install confirmation (**Install** in **Extensions**, **Get** in the Marketplace) for an extension that declares any `net:` permission, `git`, `ai:invoke` or `tools`, listing its warnings and high risks.

| Level | When | Badge |
|---|---|---|
| `sandbox` | None of `net:`, `git`, `ai:invoke`, `tools`. | No network permission |
| `declared` | Any of `net:<host>`, `ai:invoke` or `tools`, and none of the `open` ones. | Declared hosts, or Through SpaceMIX when it names no host |
| `open` | `net:*`, any `net:*.<domain>`, or `git` (which reaches any address). | Any host, Whole domains, or Any git remote |

Each risk is a note, a warning or a high risk. `net:*` and `git` are high risks. A `net:*.<domain>` wildcard, MCP servers on its hosts (any port), `tools`, and the sandbox gaps every extension has are warnings: its view can load images, media and nested pages from any address (see [Content Security Policy](protocol.md#content-security-policy)), WebRTC isn't blocked (see [Known gaps](../contract.md#known-gaps-in-protocol-1)), and `host.shell.openUrl` opens any web address without a permission. Named hosts, hosts people allowed, and `ai:invoke` are notes.

The requests the server makes for an extension (`host.net` and `host.git`) are in the egress log, and its network can be switched off, in **Settings → Extensions → Data leaving** (see [What the server logs](host/net.md#what-the-server-logs-and-the-network-switch)). What its view loads or opens directly, its MCP calls (the window makes them) and its `host.ai` prompts are not logged.

## Updates

Once it [uses the Hub](hub-optional.md#what-uses-the-hub-means), the server checks the registry for updates at startup, every ten minutes, and whenever someone with `server:extensions` opens the store's Updates list. Before that it doesn't ask on its own, and **Check now** in that list checks when someone asks. With the Hub off there is no check.

- By default updates from the registry never install on their own. Each newer version is **held** as a `PendingUpdate`, with `added` listing the permissions it asks for that the approved list doesn't cover (empty when it asks for nothing new). Everyone who has `server:extensions` and may use the extension (a build withheld from them doesn't count) gets a notification that opens that extension's page. The installed version keeps running with its old permissions.
- **Update** (one, or Update all) downloads the held version again and installs it only if it asks for nothing beyond `added`. Otherwise it fails with "`<id> <version> now asks for <permissions> too. Check for updates again.`" Updating approves the new manifest's permissions, so an update that asks for **fewer** shrinks the approved list. Everyone who may use the extension gets a notification ("<Name> was updated to <version>").
- With **Update extensions automatically** on (**Settings → Extensions → Updates**, off by default), a newer version whose `added` is empty installs at the check instead of being held, and everyone who may use the extension gets the same notification as for **Update**. One that asks for more is still held. Turning it on also installs, at the next check, held versions that ask for nothing new.
- **Skip this version** turns that version down. It is offered again only when a newer version appears.
- A paid version this server hasn't bought (`UpdateInfo.paid`) is held with `paymentRequired: true` and no `added` list, since it wasn't downloaded; the notice says `<Name> <version> is available. It's paid: buy it for this server in the Marketplace to update.` It can be updated once the server's purchase covers it (see [Marketplace](market.md#what-a-server-does)).
- The server's own notices about a paid extension's purchase (it lapsed, it was turned off, it is on again) go to the owner only, from source `core.extensions` with the target `license/<extension id>`, which opens that extension's page in **Extensions**. A build made on this server, turned off because a paid listing has its id, says `<Name> is a build made on this server, and a paid extension in the Marketplace has the same id, so it's turned off. Its data is kept. See Updates in Extensions.` See [Turned off until it's paid for](#turned-off-until-its-paid-for).
- Dev builds are never updated from the registry on their own. A local install whose id came from the registry before is offered a registry update only when the registry has a higher version; once updated it is a registry install. A local install itself applies at once and never waits for approval, also when it asks for more. Someone's own build then runs only for them until the owner [approves it for the team](#how-far-a-members-build-reaches).
- A listing under the id of a build made on this server is held at any version, for the owner alone, whatever the settings above say (see [When a listing takes a build's id](#when-a-listing-takes-a-builds-id)).

"Covered" means (`added_permissions` in `src-tauri/src/registry.rs`, `addedPermissions` in `lib/extensions.ts`):

- the exact same string is approved, or
- the new one is `net:<host>` and `net:*` is approved, or
- the new one is `net:<host>` and `net:*.<domain>` is approved and `<host>` ends with `.<domain>`.

Nothing else covers anything: `widgets` does not cover `widgets:view`, `camera` does not cover `screen`.

## How calls are checked

Three places check permissions:

1. **The runtime** (`packages/sdk/src/runtime.ts`) builds `host` from the approved list. Optional APIs (`host.fs`, `host.git`, `host.chat`, `host.net`, `host.widgets`, `host.tools`, `host.ai`) are `undefined` without their permission. Test for them: `if (host.net) …`.
2. **The bridge** (`apps/desktop/src/lib/extensionHost.ts`) checks every request against the approved list before it runs. A request without the permission rejects with:

   ```
   <Extension name> doesn't have the "<permission>" permission.
   ```

   For any `net:` need the message names `net:`; for camera, microphone and screen it names `camera`.
3. **The core** (Rust) checks `net.fetch` again against the installed record (`src-tauri/src/net.rs`), on every request and every redirect hop.

## Permissions that need nothing

Every extension has these, without declaring anything:

- its own `host.storage` and `host.collection(name)` (see [`storage`](#storage) below)
- `host.notifications` (`send`, `people`, `markRead`)
- `host.events.emit`
- `host.shell` (`open`, `openUrl`, `copy`, `save`)
- `host.view` and `host.env`
- the `host.mcp` object (its calls need a `net:` permission; see [`net:`](#net))

## The permissions

| Permission | Unlocks | The store says |
|---|---|---|
| `storage` | Nothing is checked today | "Store its own data on this server" |
| `fs` | `host.fs`, the `fs` and `dragdrop` subscriptions | "Read the files and folders you've added" |
| `git` | `host.git`, the `git` subscription | "Read the git repositories you've added" |
| `chat` | `host.chat`, the `chat` subscription | "Read and send the team's chat messages" |
| `widgets` | All of `host.widgets` | "See and arrange your widgets and dashboards" |
| `widgets:view` | `host.widgets` limited to `WIDGETS_VIEW_METHODS` | "See the team's widgets, show them, and change the data of widgets it shows" |
| `events` | `host.events.catalog`, `list`, `claim`, `subscribe` | "See every extension's events, including their contents" |
| `tools` | `host.tools` (`list`, `call`) | "Use any extension's tools on your behalf, without asking each time" |
| `ai:invoke` | `host.ai` (`complete`, `available`) | "Use your connected model" |
| `camera` | Video capture through `navigator.mediaDevices.getUserMedia` | "Use your camera (you can turn it off in Settings)" |
| `microphone` | Audio capture through `getUserMedia` | "Use your microphone (you can turn it off in Settings)" |
| `screen` | `navigator.mediaDevices.getDisplayMedia` | "Ask to share your screen or a window (you pick what, each time)" |
| `net:<host>` | `host.net`, `host.mcp` calls, MCP tools, to that host | "Connect to <host>" |
| `net:*.<domain>` | The same, for subdomains of `<domain>` | "Connect to *.<domain>" |
| `net:*` | The same, for any host, asked once per host | "Connect to servers you name; asks the first time for each" |
| `data:<ns>:read` | Nothing today | "Read your <ns>" |
| `data:<ns>:write` | Nothing today | "Change your <ns>" |

In the `Permission` type the patterns are spelled `` `net:${string}` ``, `` `data:${string}:read` `` and `` `data:${string}:write` ``.

The bridge groups permissions into "needs" (`Need` in `extensionHost.ts`). A method's need is met by:

| Need | Met by |
|---|---|
| `fs`, `git`, `chat`, `widgets`, `events`, `tools` | the permission of the same name |
| `widgetsView` | `widgets` or `widgets:view` |
| `net` | any permission starting with `net:` |
| `ai` | `ai:invoke` |
| `media` | `camera`, `microphone` or `screen` |

Any other string is accepted by the registry and by install (they only check that `permissions` is a list of strings), shown in the store as written, and grants nothing. The `Permission` type rejects unknown strings at compile time.

### `storage`

```ts
permissions: ["storage"]
```

Declare it when the extension keeps data in collections or in `host.storage`. **The host does not check it today:** `host.storage.*`, `host.collection(name)` and the `stored` subscription work without it. It is what people see approved in the store. Whether a later protocol enforces it is an [open question](../contract.md#open-questions-before-we-freeze); within protocol 1 an extension without it keeps working.

Storage and collections are scoped to the extension's own id and shared by everyone on that server who may use the extension (see [Who can use an extension](#who-can-use-an-extension)). See [Storage](host/storage.md) and [Collections](host/collections.md).

### `fs`

Unlocks `host.fs` and the `fs` and `dragdrop` subscription channels. Every path is relative to the server's files folder (`files` in its data directory); the core refuses paths that lead outside it. See [Files](host/fs.md).

### `git`

Unlocks `host.git` and the `git` subscription: read-only access to remote repositories the user adds by URL. See [Git](host/git.md). The server connects to any address a repository is added from; those connections are in the egress log and stop while the extension's network is switched off (see [What the server logs](host/net.md#what-the-server-logs-and-the-network-switch)).

### `chat`

Unlocks `host.chat` and the `chat` subscription. Every call acts as the signed-in person; the core checks membership and stamps the author. See [Chat](host/chat.md).

### `widgets`

Unlocks every method in `WIDGETS_METHODS` and the `widgets` and `widget-data` subscriptions. `widgets.widgets` returns the full widget records, Studio drafts and history included. See [Widget reference](widgets.md).

### `widgets:view`

Unlocks only `WIDGETS_VIEW_METHODS` (`widgets`, `frameUrl`, `refresh`, `purge`, `call`, `reportError`, `openGallery`, `save`) plus `subscribe` and `watch` (the `widgets` and `widget-data` channels). `widgets.widgets` returns saved widgets only, without `draft` and with an empty `history`. Every other `widgets.*` method rejects with the permission error. `save` writes a saved widget's store (see [The widget's store](widgets.md#the-widgets-store)), and with only `widgets:view` only the store of a widget the frame shows right now, one it is watching (`watch`, the `widget-data` channel); any other id rejects with `<Name> can change a widget's data only while it shows that widget.` With `widgets` it may save any widget's store. It never changes the widget itself. The type for this subset is `WidgetsViewApi`; `host.widgets` is still typed `WidgetsApi`.

### `events`

Unlocks receiving events: `host.events.catalog`, `host.events.list`, `host.events.claim` and `host.events.subscribe` (the `events` channel). Emitting needs no permission. With `events`, the extension sees every installed extension's events and their payloads, and the events scripts and services send with an API key (`source: "api"`, see [SpaceMIX API](api.md#events)). SpaceMIX starts the frame of every extension with `events` in the background when someone signs in, so it hears events while its view is closed; that goes for a [member's build](#how-far-a-members-build-reaches) too, for everyone with access to it. See [Events](host/events.md).

Without the permission, `host.events.subscribe` does not throw: the subscription fails and the runtime logs `[spacemix] couldn't subscribe to "events": …` to the console.

### `tools`

Unlocks `host.tools.list` and `host.tools.call`. A call runs any installed extension's tool as the signed-in person **without the approval prompt** the assistant would show. The approval is the permission itself, which for a [member's build](#how-far-a-members-build-reaches) only its builder gave. Meant for extensions that act for the user (automation, agents). See [Tools](host/tools.md).

### `ai:invoke`

Unlocks `host.ai.complete` and `host.ai.available`: one non-streamed completion at a time from the user's default model. See [AI](host/ai.md).

### `camera`, `microphone`, `screen`

Unlock capture through the standard browser APIs inside the frame: `getUserMedia` with `video` (`camera`) or `audio` (`microphone`), `getDisplayMedia` (`screen`), and `enumerateDevices` (lists `videoinput` with `camera`, `audioinput` and `audiooutput` with `microphone`). The bridge methods are `media.open`, `media.answer`, `media.stop`, `media.constraints` and `media.devices`, plus the `media` subscription; any one of the three permissions opens the bridge, and each capture is checked for the specific one:

- video without `camera`, audio without `microphone`, or display capture without `screen` fail with `NotAllowedError`: `<Name> doesn't have the "<permission>" permission.`
- the per-extension switch in **Settings → Extensions → Media access** turned off: `NotAllowedError`, and running tracks end.
- not a secure page (the desktop app, https or localhost): `NotSupportedError`.

The browser still asks the person, once, for SpaceMIX's own origin. Stability: **experimental**: the capture proxy (`lib/mediaBridge.ts`, `packages/sdk/src/media.ts`) has not been tested with real devices in every browser. See [Media](host/media.md).

### `net:`

**Known limits.** An extension's frame can load images and media, and nest http(s) pages, from any http(s) URL without a `net:` permission, which sends the request's address, and so whatever is put in it, out of the server's control. A permission list without `net:` therefore doesn't mean a sealed extension. See also [the widget frame's known gaps](widgets.md#known-gaps).

```ts
permissions: ["net:api.github.com", "net:*.example.com"]
```

Any permission starting with `net:` makes `host.net` present and allows `net.fetch`, `net.allowedHosts`, `mcp.listTools`, `mcp.callTool`, and the module's `mcp` servers (the host only asks an extension for its MCP servers when it has a `net:` permission).

Which hosts a request may reach:

- **`net:<host>`**: that host, granted at install. Lower-case. For a port other than the scheme's default, include it: `net:api.example.com:8443`. The core compares `host[:port]` exactly for `net.fetch`.
- **`net:*.<domain>`**: subdomains of `<domain>`. For `net.fetch` the core requires a real subdomain: `net:*.example.com` allows `a.example.com` and `a.b.example.com`, not `example.com`. Add `net:example.com` for the bare domain.
- **`net:*`**: any host the user allows. The first time the extension reaches a host it hasn't been allowed, SpaceMIX asks "allow this host?". A yes is stored in the installed record's `netGrants` (through `POST /api/extensions/grant-host`, which needs access to the extension) and applies to everyone on that server from then on; updates keep it, and whatever replaces a [member's build](#when-a-listing-takes-a-builds-id), or a listing replacing any build made on this server, starts without it. A no is remembered in that window until it reloads; the request rejects with `Not allowed to reach <host>`.

Only `http:` and `https:` URLs can be reached. Other errors:

- from the bridge: `Not allowed to reach <host>`, `"<url>" isn't a URL.`, `Only http and https URLs can be reached, not <scheme>`
- from the core: `<Name> isn't allowed to reach <host>`, `Only http and https URLs can be fetched, not <scheme>.`, `The response is larger than 20 MB.`, `Too many redirects.`, `The request timed out.`

The server's network switch (**Settings → Extensions → Data leaving**) can turn an extension's network off for everyone on the server whatever it declares (the kv key `shell/networkBlockedExtensions`, extension ids, guarded like the media list below in `server:settings`): its `net.fetch` and MCP calls then fail as for a host that isn't allowed, and so do its `host.git` connections. The requests the server makes for it (`host.net` and `host.git`) are in the egress log. See [What the server logs](host/net.md#what-the-server-logs-and-the-network-switch).

`host.net.allowedHosts()` returns the `net:<host>` and `net:*.<domain>` entries (without the `net:` prefix) plus the runtime grants. It does not include `*` for `net:*`. See [Network](host/net.md) and [MCP](host/mcp.md).

The bridge's own host check (used for MCP, which the webview calls directly) is looser than the core's: it accepts `example.com` for `net:*.example.com` and any port for `net:<host>`. Write permissions to the stricter rule above. This mismatch is listed in the contract's open questions.

### `data:<ns>:read`, `data:<ns>:write`

```ts
permissions: ["data:tasks:read"] // grants nothing today
```

Declared in the type, accepted on install and shown in the store ("Read your tasks", "Change your tasks"). **No host API uses them in protocol 1:** `host.collection(name)` only reaches the extension's own collections. Do not declare them; read other extensions' data through their assistant tools with [`tools`](#tools) if your extension acts for the user, or not at all. How cross-extension data access should work is an [open question](../contract.md#open-questions-before-we-freeze).

## Studio previews

A Studio preview frame (`studio:<project>`) is granted `storage`, `ai:invoke`, `fs`, `git`, `chat`, `widgets`, `widgets:view`, `events`, `tools`, `camera`, `microphone`, `screen` and `net:*`, plus whatever its manifest lists, so a developer can try any API without editing the manifest. `net:*` grants made in a preview last for that window only. A preview of an extension that is installed on the server starts only for someone who may use that extension, since it reads that extension's data; for anyone else it fails with `<Name> isn't available to you.` For an uninstalled extension whose data stayed, the preview starts but the server refuses its data and network calls (see [Who can use an extension](#who-can-use-an-extension)). A preview of an installed extension that is [turned off until it's paid for](#turned-off-until-its-paid-for) doesn't start for anyone: it fails with `<Name> is turned off on this server until it's paid for.` for the people who may use it, and `<Name> isn't available to you.` for everyone else. A preview of an id that was never installed works for someone with `server:extensions`, or `extension:<id>` on that id. A preview's `net.fetch` always takes `server:extensions` (see [Without these permissions](#without-these-permissions)). **Installing asks for exactly what the manifest declares.** Code that works in the preview can fail once installed if the manifest is missing a permission; check the list before you publish.

## Who can use an extension

These are permissions people hold on a server, not ones an extension declares. They decide who on the team reaches an extension at all. The owner has all of them; a member has what is granted to them directly plus what their groups grant (`auth.rs` in `apps/desktop/src-tauri/src/`).

| Permission | Lets the person |
|---|---|
| `extension:*` | Use every installed extension, including ones installed later. |
| `extension:<id>` | Use the extension with that id. |
| `mcp:*` | Use the tools of every [MCP connection](mcp-connections.md) on the server, including ones added later. |
| `mcp:<id>` | Use the tools of the MCP connection with that id. |
| `server:extensions` | Create extensions in the Studio, install, update, approve, skip and uninstall extensions, delete builds ([Deleting your own build](#deleting-your-own-build); erasing their data: the owner only), install the essentials and change the update settings. Managing an installed extension also needs access to it. Their builds run for everyone with access, acting as each viewer. See [Who may create extensions and widgets](#who-may-create-extensions-and-widgets). |
| `server:hubModels` | Use [SpaceMIX Hub models](hub-models.md) in chats and through the [SpaceMIX API](api.md#assistant), spending the server's SpaceMIX Hub credit, and see that credit read-only in **Settings → Models**. Without it a Hub model is refused with `You don't have permission to use SpaceMIX Hub models on this server. Ask someone who manages members.` |
| `server:members` | Invite and remove people, manage groups, and change people's access, but only grant what they hold and only change people and groups whose access is all theirs too. |
| `server:settings` | Rename the server, sign everyone out, change the connected models (**Settings → Models**; the kv keys `shell/models`, `shell/defaultModel` and `shell/provider`, which the server also uses for assistant turns through the [SpaceMIX API](api.md#assistant), and `shell/studioDefaultModel`, the model Studio chats use, see [Which model a session uses](../guide/studio.md#which-model-a-session-uses)), switch the SpaceMIX API on or off (**Settings → API**; the kv key `shell/apiEnabled`, see [Switching the API on](api.md#switching-the-api-on)), and add, change and delete MCP connections and pick which of them run without asking (**Settings → MCP connections**, **Settings → Extensions → Approvals**; the kv key `shell/autoApproveMcp`, see [MCP connections](mcp-connections.md)), pick which extensions' gated tools run without asking for everyone on the server (**Settings → Extensions → Approvals**; the kv key `shell/autoApproveExtensions`, extension ids; anyone else's write is refused with `Only people who may change server settings can change which extensions run without asking.`), and turn the camera, microphone and screen back on for an extension (**Settings → Extensions → Media access**; the kv key `shell/mediaBlockedExtensions`, extension ids, which anyone with access may add to but only this permission may remove from: `Only people who may change server settings can turn the camera, microphone and screen back on for an extension.`). Turn an extension's network back on (**Settings → Extensions → Data leaving**; the kv key `shell/networkBlockedExtensions`, extension ids, which anyone with access may add to but only this permission may remove from: `Only people who may change server settings can turn an extension's network access back on.`), and read the egress log of what extensions sent out of the server (`GET /api/egress/summary`, `GET /api/egress/log`; see [What the server logs](host/net.md#what-the-server-logs-and-the-network-switch)). The whole `shell` kv namespace is the server's settings: every key in it, including ones added later, takes this permission except adding to `shell/mediaBlockedExtensions` and `shell/networkBlockedExtensions`, and a write without it is refused with `Only people who may change server settings can change this server setting.` (or the key's own message above). It also tops up the server's SpaceMIX Hub credit and changes its auto-recharge and monthly cap (see [Who may do what](hub-models.md#who-may-do-what)). |

Every server has a **Members** group with `extension:*`, `mcp:*`, `server:extensions`, `server:widgets` and `server:hubModels`, which new invites start with and which everyone who joined before permissions existed is in, so on a server nobody has changed every member can use every extension, every MCP connection and the SpaceMIX Hub models the server has added, manage extensions and create extensions and widgets (see [What every default member can do](#what-every-default-member-can-do)). A Members group made before MCP connections gets `mcp:*` once, when the server starts, and one made before SpaceMIX Hub models gets `server:hubModels` once the same way; taken off the group, either stays off. On an existing server, every `default` group and the group named Members get `server:extensions` and `server:widgets` once the same way, and they stay off when taken off. Nobody is given them directly, so a member outside those groups can't create until they're granted. Someone with `server:members` outside those groups can't change default members until they hold both, since they only change people whose access is all theirs too.

For a person without access to an extension:

- The app gives it no navigation entry, frame, assistant tools, Search results, routes or event consumer in that person's windows, and changes to its data don't reach them.
- The server refuses its records (`host.collection`), its storage (`host.storage`) and its `host.net` requests with `You don't have access to <id>.` Previews of it are refused the same way.
- This holds for every installed extension and for uninstalled ones whose data stayed. An id that was never installed is open to whoever holds `server:extensions`, which is how the Studio works on a new extension, and to someone given `extension:<id>` on that very id; anyone else is refused the same way (see [Without these permissions](#without-these-permissions)). `core.*` ids stay open to read.
- `host.notifications.people()` still lists them, and a notification sent to them still arrives.
- An installed extension's code is for those who may use it: without `extension:<id>`, reading its package returns only its manifest, readme, hash, format and build time, and packages can't be searched by anyone but the owner (`Extension packages can't be searched.`). The check is in `apps/desktop/src-tauri/src/records.rs`.

Your extension doesn't see any of this: for the people who may use it, nothing changes. Don't build your own access checks on top; the host already stops everyone else.

**Stability:** experimental: who may use an extension is new, and the people-side permissions may still change. What an extension sees (its calls work for the people who may use it) is covered by the rest of this page.

## Who may create extensions and widgets

Two permissions cover creating. `server:extensions` (**Extensions** in **Settings → Permissions**) means create, install, update and remove extensions. `server:widgets` (**Widgets**) means create and change widgets. The owner always has both. Neither gives the other, and neither gives `extension:*`. They are granted like any other permission, directly, through a group or in an invite: only by someone with `server:members` who holds them themselves. Who starts with them is under [Who can use an extension](#who-can-use-an-extension). The server enforces them (`EXTENSIONS`, `WIDGETS` and `check_extension_access` in `apps/desktop/src-tauri/src/auth.rs`, `install_package_as` in `registry.rs`, `needs_permission` in `records.rs`); the account it sends says so with `createGated: true`, also in [`GET /api/v1/me`](api.md#who-the-key-is). A newer client treats a server that sends no `createGated` as an older one and leaves creating allowed there.

### What every default member can do

Members have both permissions by default. So on a server nobody has narrowed, every member in the **Members** group, which also has `extension:*`, can do all of this for the whole team, except that what they build themselves stays private to them until the owner approves it:

- install extensions from the registry, and install the essentials
- uninstall any extension for everyone
- approve or skip ordinary updates
- change **Update extensions automatically**
- create extensions and widgets, and install their own builds

To narrow it, take the permission off the group in **Settings → Permissions**. These stay the owner's: erasing an extension's data, approving or skipping a listing that would replace a build made on this server, and installing a package file over anything that isn't the person's own build.

### How far a member's build reaches

A **member's build** is what someone other than the owner installed with `server:extensions`. It has had no review, so it stays private until the owner decides:

- **It runs only for people named on its exact id until the owner approves it for the team.** That is its builder, who gets `extension:<id>` when they install it, and anyone given that same permission. `extension:*` doesn't cover it, and neither does being the owner. For everyone else there's no frame, no tools, no event consumer, and its records, storage and `host.net` are refused with `<id> is someone's own build, and the server's owner hasn't approved it for the team.`
- **The owner is told** on every install, and on every rebuild with new code.
- **Approving and taking back are the owner's** (`POST /api/extensions/team-approval` with `{ "id": "<id>", "approved": <boolean> }`). Once approved it runs for everyone with access, as any extension: as each viewer, with that person's access. With `tools` it runs their other extensions' tools without a prompt, with `chat` it reads and sends the team's chat as them, with a `net:` permission it can send what it reads out of the server, and with `events` its frame starts in the background when someone with access signs in. Approve only what you've looked at.
- **New code starts over.** A rebuild with a different hash clears the team approval, its granted hosts (`netGrants`) and its entry in `shell/autoApproveExtensions`. So does taking the approval back. Approving clears the hosts and that entry too: they were someone's say for a build only they could use. Once it's approved, a host it reaches at runtime is asked about again, and a yes from anyone who uses it opens that host for everyone (`netGrants` is shared).
- **A new id can't be one others hold.** Installing a build under an id someone else, a group or an invite is already named on is refused.
- **Only the owner can name others on it** while it's private: giving `extension:<id>`, directly or through a group or invite, is refused for anyone else, its builder included. Others get no change feed for it and can't read its package. The rule stays on an uninstalled build while its builder is on record, so its data doesn't open up.
- **Only the owner can allow it a new host**, since one yes opens the host for everyone who uses it.
- **Its network reaches only public addresses**, whatever the approval (see [Public addresses only](host/net.md#public-addresses-only)).
- **At most 10 installed builds per person.** Installing another is refused with `You already have 10 of your own builds on this server. Uninstall one first.`

Removing `server:extensions` stops the person creating and installing. It leaves what they installed in place, and they keep access to it. To take a build away, someone with `server:extensions` and access to it, or the owner, uninstalls it. An uninstall keeps its builder on record, so they can install it again until their permission is removed, and nobody else can take the id. Removing the person's account turns their builds off for everyone, until the owner installs them again or removes them; the owner is told.

### Without these permissions

The Studio is closed with neither permission, makes only widgets with `server:widgets`, and makes only extensions with `server:extensions`. Entries for what a person can't make are hidden (the server menu, the command palette, **Create extension**, **Create widget**, **Import from file**, **Import**, **Open in Studio**, **Edit in Studio**). Reached by a link, the Studio shows **Building needs a permission**, and so does a tab of a session of the kind they can't make.

| What | Takes | Without it |
|---|---|---|
| Widgets | `server:widgets` | Creating, changing, deleting or duplicating one, and importing a widget file, are refused with `You don't have permission to create widgets on this server.` Viewing widgets, placing them on dashboards, `widget_store_set`, **Refresh** and **Purge cache** stay. |
| Studio projects of extensions | `server:extensions` | Creating and changing them is refused with `You don't have permission to create extensions on this server.`, as are writes to the old `studio` kv namespace. Reading and deleting your own stay, so nobody is stuck with their work. |
| Previews | `server:extensions` | `net.fetch` with a `preview` (Studio previews, `POST /api/ext/fetch`) is refused with that same sentence. |
| Ids never installed | `server:extensions`, or `extension:<id>` on that very id | Records, kv and `host.net` under an id neither installed nor left by an uninstall are refused with `You don't have access to <id>.`, and changes to them aren't delivered. `extension:*` doesn't open them, since it is about what's installed. |
| The assistant's tools | One each | `widget_create`, `widget_update`, `widget_delete` and `widget_guide` take `server:widgets`; the `core.studio` group takes `server:extensions`; `studio_switch` takes both. See [Widget tools](../agents.md#widget-tools). |
| Installing a package | `server:extensions` | `POST /api/extensions/install-package` answers `403` with `You don't have permission to create extensions on this server.`, before the body is read. |

`core.*` ids are the server's own signals. Reading them stays open. Writing under one that nothing installed holds is refused with `<id> is the server's own, so it can't be written to.` for everyone but the owner, holders of these permissions included (`check_core_write`).

Some kv namespaces can't be used to get around this. `extensions` is read-only (`Extensions change only through the extension commands.`), `settings` too (`These settings change only through their own commands.`), and under `widgets` every key but the flags `started` and `cacheDaily` is refused, `widgets/widgets` and `widgets/dashboards` included: with `Widgets change only through their table.` for someone with `server:widgets`, and with the sentence above for anyone else.

### What a member may install

With `server:extensions`, someone other than the owner may install a package (`POST /api/extensions/install-package`, or **Install on this server** in the Studio's **Publish** tab) only as:

- an id new to this server, or
- their own earlier build, installed or uninstalled, that nothing else has taken over.

Installing gives them `extension:<id>`, unless they already hold that exact permission (`extension:*` doesn't count). It is added to their direct permissions and taken back when the id stops being their build; with 200 direct permissions already, the install is refused with `You already have 200 permissions given to you directly, so <id> wasn't installed. Ask the server's owner to remove some.` An update applies at once for its builder, added permissions included, and starts over for everyone else: only an update from the registry waits for someone to approve it (see [Updates](#updates)). Uninstalling and [deleting](#deleting-your-own-build) follow the plain rule for everyone: `server:extensions` and access to the extension. Erasing its data stays the owner's.

Everything else answers `403` with a sentence naming the id, and nothing is written. A package that is no good answers `400`, as for anyone.

| Refused when the id | Error |
|---|---|
| Is reserved: it shares SpaceMIX's own data (`ai.spacemix.chat`, for one) | `<id> is reserved for SpaceMIX, so it can't be used for your own build. Give your build a different id.` |
| Was ever installed from the registry, or is a Marketplace extension as far as this server knows | `<id> belongs to a Marketplace extension on this server, so you can't install your own build as it. Give your build a different id.` |
| Is a listing on SpaceMIX Hub (only on a server that [uses the Hub](hub-optional.md#what-uses-the-hub-means); on any other the server doesn't ask, and the build installs) | `<id> is an extension on SpaceMIX Hub, so you can't install your own build as it. Give your build a different id.` |
| Can't be checked, because SpaceMIX Hub didn't answer (only on a server that uses the Hub, as above) | `Couldn't confirm with SpaceMIX Hub that <id> isn't one of its extensions, so it wasn't installed. Try again in a moment.` |
| Is someone else's build, installed or uninstalled | `<id> is someone else's build on this server, so you can't install over it. Give your build a different id.` |
| Is installed from the server's extension folder | `<id> is installed from this server's extension folder, so you can't install over it. Give your build a different id.` |
| Is installed and isn't their build | `<id> is already installed on this server and isn't your build. Give your build a different id.` |
| Was uninstalled earlier, wasn't their build, and its data may still be there | `<id> was uninstalled from this server and its data may still be here, so only the server's owner can install it again. Give your build a different id.` |
| Is being erased | `<id> is being erased from this server, so you can't install it now. Give your build a different id, or ask the server's owner.` |
| Has a listing [waiting for the owner](#when-a-listing-takes-a-builds-id) | `A listing on SpaceMIX Hub now uses <id>, so you can't change your build until the server's owner decides what happens to it.` |
| Has the tool prefix of another install or of an MCP connection | `Another extension on this server has tools starting with <ns>_, so you can't install <id>. Change the last part of your build's id.` or `An MCP connection on this server has tools starting with <ns>_, so you can't install <id>. Change the last part of your build's id.` |

### When a listing takes a build's id

A build made on this server never gives way to the registry on its own. That means anything installed with source `local` or `dev` and never from the registry, the owner's too. An uninstalled build stays covered until its data is erased or it is installed again. On a server that [uses the Hub](hub-optional.md#what-uses-the-hub-means), or when someone asks with **Check now**, when a Marketplace listing appears under such an id, whatever version the build says it is, that version is held as a `PendingUpdate` with `replacesBuild: true` (see [`PendingUpdate`](registry.md#pendingupdate)), and the owner is told. A dev install's hold shows as a row in the Updates list, with no notice. Automatic updates, **Install essentials** and **Update all** all leave it there. Trying to install the id, as the owner too, answers `403` `{ error, code: "held_for_owner", listingId, hint }`: `<id> is a build made on this server, so replacing it with the version on SpaceMIX Hub needs the owner's approval.` The row stays when a build is uninstalled, so it can wait for an id that isn't installed; then only people with access to the extension see it.

Only the owner approves it or skips it (`POST /api/extensions/approve` with `{ "id": "<id>", "eraseData": <boolean> }`, `POST /api/extensions/dismiss`), and approving has to choose what happens to the data the build stored:

| `eraseData` | What happens |
|---|---|
| `false` | **Keep the data.** The listing starts with whatever the build left, and may trust it. |
| `true` | **Erase the data.** All of it goes before the listing is stored ([What erasing takes](#what-erasing-takes)), so the new version never runs on it. An id this server ever installed from the registry is refused: `<id> came from the Marketplace before, so its data can't be erased.` |
| absent | Refused: `<id> would replace a build made on this server. Choose whether to keep or erase its data.` |

Anyone else is refused: `<id> would replace a build made on this server, so only the server's owner can approve it.` and `<id> would replace a build made on this server, so only the server's owner can turn it down.` `eraseData: true` on any other update is refused too. The owner approves everything the listing asks for (`asks`), whatever the build asked for.

Once it is stored, the id is a registry install and no longer anyone's build. Its builder loses the `extension:<id>` that building gave them, and what people allowed the build doesn't carry over: its `net:*` hosts are cleared and it leaves `shell/autoApproveExtensions`. The same goes for anything else that replaces a member's build, such as the owner's package or a dev build (`store_package_with`); the owner or this machine building over the owner's own build keeps what it has. If its builder tries to install it again they get the Marketplace refusal above.

If the listing is paid and this server hasn't bought it, the build is turned off like any extension under a paid id (see [Turned off until it's paid for](#turned-off-until-its-paid-for)), and its data is kept.

### Tool names

A member's build loses every tool name clash, whichever was installed first (`catalog_for` in `apps/desktop/src-tauri/src/tools.rs`, `toolsFor` and `chatTools` in `apps/desktop/src/lib/tools.ts`). Its tools come after every other extension's tools and MCP tools and after the MCP connections', and one is left out when its name is taken, when it falls under the namespace of another extension that may have MCP tools, or when it falls under an MCP connection's id, whether or not that connection could be listed. It reserves nothing: a connection may take its id. If a chat can't list the connections, the builds have no tools that turn: `Couldn't list the MCP connections, so members' builds have no tools this turn.` The connections count only in chats and on the server (the assistant, `/api/v1/tools`). `host.tools` and widget calls go through `toolsFor`, which has no connections, so there a name that is a connection's in a chat reaches the build.

### The check at upgrade

The first time a server starts on the version with this permission, every installed package has to hash to what it says it is and to what its install names (`verify_installed_packages` in `apps/desktop/src-tauri/src/registry.rs`). This runs once. A package that fails doesn't run, the failure is logged, and the owner gets a notification with the target `license/<id>`: `<id> couldn't be verified after the upgrade, so it won't run. Install it again or uninstall it.` Nothing is deleted, and installing it again or uninstalling it fixes it.

Such an extension's record has a `hash` starting with `not-verified:`. It stays in the **Installed** list in **Extensions**, and its page is made from its record, its listing and the person's own Studio project, never its package (`apps/desktop/src/shell/store/NeedsInstallAgain.tsx`). The page says what fixes it by where it came from, and offers **Uninstall** and, where it applies, [**Delete extension**](#deleting-your-own-build).

The full hash is only computed in that one check. On every read, the server and the app also compare the `hash` the stored package states with the one its install names (`stored_package` and `read_manifest` on the server, `getPackage` in `apps/desktop/src/lib/extensions.ts`), and a package that doesn't match is treated as missing, so it doesn't run.

**Stability:** experimental, like the rest of who may manage extensions.

## Deleting your own build

**Delete extension** removes one of your own builds from this server, and optionally its data and your Studio project for it. Use it to start over with a build of your own; anything from the Marketplace can only be uninstalled. **Uninstall** on its own stays a separate button.

It is offered on the extension's page in **Extensions** (next to **Uninstall**, also when the extension is broken or [can't be verified](#the-check-at-upgrade)), in **My extensions**, and in the Studio's **Settings** for a project that has been built (a project that was never built gets **Delete project** instead, which deletes only the project). Its dialog (`apps/desktop/src/shell/store/DeleteExtensionDialog.tsx`) shows only the options that apply, and asks you to type the extension's name:

| Option | Default | Shown when | What it does |
|---|---|---|---|
| **Uninstall from this server** | on | It is installed, it is one of your own builds (below), and you have `server:extensions` | Uninstalls it for everyone, as **Uninstall** does. Its data stays unless the next option is ticked. |
| **Erase its data on this server** | off | Uninstall is offered; it can be ticked only by the server's owner and only together with Uninstall | Erases what the server keeps for it (the table below), for good. |
| **Delete my Studio project** | on | You have Studio projects whose last build has this id | Deletes their sources and history from the Studio; the chat stays. Other people's projects stay. Works with nothing installed. |

### Which builds can be uninstalled this way

The uninstall part is offered, and the server allows it, only for an extension that is:

- installed with source `local` (a Studio build or a package file) or `dev` (a build on this machine), and
- never installed from the registry or the Marketplace on this server, as far as the server knows: the installed record's `everRegistry` or `license`, or the id being on the server's list of ids ever installed from the registry (kv `_server/registryExtensions`, kept past an uninstall), and
- not a `core.*` id or `ai.spacemix.chat`, whose data the core's team chat shares.

The list of ids ever installed from the registry was first filled at startup (`seed_ever_registry`) from the extensions installed then. An id installed from the registry and uninstalled before the list existed isn't on it, so an own build that reuses that id can be deleted.

It takes the same permissions as uninstalling: `server:extensions` and access to the extension. Erasing its data also takes the server's owner; anyone else is refused with `Only the server's owner can erase an extension's data.` before anything changes. Other refusals: `<id> came from the Marketplace, so it can only be uninstalled. Only your own builds can be deleted.`, `<id> shares its data with SpaceMIX's team chat, so it can only be uninstalled.`, `<id> shares its id with SpaceMIX's own data, so it can only be uninstalled.`, `<id> is reserved for SpaceMIX itself.` or `<id> isn't installed.`

### What erasing takes

Without **Erase its data on this server**, everything stays, as after an uninstall, ready if it's installed again.

| Erased (only with **Erase its data on this server**) | Kept |
|---|---|
| Its collections' tables (`<id>.<name>`) | The egress log of what it sent out |
| Its `host.storage` and kv rows | Its network and media switches (`shell/networkBlockedExtensions`, `shell/mediaBlockedExtensions`) |
| Every notification it sent, from everyone's center | Files on disk: its source folder (`SPACEMIX_EXTENSION_SOURCES`, `dist/extensions/`) and a Studio project's linked folder |
| Its events and their claims, and its claims on other extensions' events | Chats, projects and widgets that mention or reference it, including the titles and subtitles copied into project items |
| `extension:<id>` on every group, person and open invite (erased last) | |
| Its entry in `shell/autoApproveExtensions` | |

Its id stays on the server's removed list either way, as after an uninstall, so a dev build doesn't install itself again on the next rebuild. Installing it again from the store or from a file brings it back; after an erase, with no data and with access only for the owner and `extension:*` holders. Without an erase, a member's build can be installed again by its builder. An erase ends that: it is no one's build any more, so only the owner can install it again.

If erasing fails partway, the extension is already uninstalled and the erase is recorded as unfinished: the owner deleting it again with **Erase its data on this server** ticked, or the server's next start, finishes it. Installing the id again before that cancels it, and what was left becomes the new install's data.

### Where it lives

The server side is the Tauri command `extensions_delete` (`id`, `eraseData`) and `POST /api/extensions/delete` with `{ "id": "<id>", "eraseData"?: boolean }`, where an absent `eraseData` is `false` (`Registry::delete` in `apps/desktop/src-tauri/src/registry.rs`). The app calls `deleteExtension(id, { uninstall, eraseData, studioProject })` and decides what to offer with `isOwnBuild` and `studioProjectsFor`, all in `apps/desktop/src/lib/extensions.ts`; `eraseData` without `uninstall` throws `An extension's data can only be erased when it's uninstalled too.` It isn't part of the [SpaceMIX API](api.md).

**Stability:** experimental, like the rest of who may manage extensions.

## Turned off until it's paid for

On a server that [uses the Hub](hub-optional.md#what-uses-the-hub-means), a paid extension from the [Marketplace](market.md) runs only while that server's purchase covers it, or while the listing's publisher is on that server. When it doesn't (never bought there, or lapsed past its 7-day grace period), the server turns it off for everyone on it (`license` on its row in `installed_extensions`, written by `apps/desktop/src-tauri/src/market.rs`). This follows the extension's id, whether it was installed from the registry, a package file, the Studio or a build on this machine. A server that hasn't used the Hub doesn't ask, so a paid extension installed there from a file runs unchecked, and can turn off within 10 minutes of the server's first use of the Hub. Two exceptions: a server that stopped using the Hub keeps what it last heard, which still applies every 10 minutes, and an owner arriving at an extension's page from the Hub runs the purchase check, which can turn a paid file off. A licence the server already holds still expires with the Hub off (see [Hub off](hub-optional.md#hub-off)).

While an extension is turned off:

- The app gives it no frame, navigation entry, assistant tools, Search results, routes or event consumer, in any window. Its Studio preview doesn't start (see [Studio previews](#studio-previews)).
- The server leaves its tools out of the catalog (the assistant, `host.tools` and `/api/v1/tools`) and refuses everything it would do: `host.net` requests, `host.events.emit` and `host.events.claim`, `host.notifications.send`, `host.storage.set`, `host.collection(...).create`, `update` and `delete`, and the `host.fs` changes (`write`, `mkdir`, `rename`, `delete`, `import`) made for it. Each refusal is `<Name> is turned off on this server until it's paid for.`
- Reads still work, and its data (storage, records, files) is kept as it is.
- Widget sources that read its tools get that sentence as their `{ error }` (see [Widget reference](widgets.md#watch)).
- A project item of it stays in the project and can't be opened (see [Projects](projects.md#opening-an-item)).

Only people who may use the extension are told it is turned off. Everyone else sees `<Name> isn't available to you.`, as for any extension they may not use, and never learns its payment state.

It runs again, with its data, as soon as the server hears that its purchase covers it: a renewal or a new purchase, at the server's next check (about every 6 hours), or at once after a purchase in the Marketplace (the app asks the server to check with `POST /api/extensions/entitlements/refresh`, owner only, and installing or updating a paid version makes the server check too). With the Hub off there is no check, and that route answers `503` `hub_off`, so renewing needs the Hub back on. Your extension isn't told any of this; it just isn't started. Don't build licence checks into it: the server does them.

**Stability:** experimental, with the [Marketplace](market.md).

## Ask for less

Ask only for what the extension uses. Every permission is one more line people read before they install, and a later version from the registry that adds one waits for someone with `server:extensions` to approve it instead of updating on its own. A local install applies at once, and someone's own build runs only for them until the owner approves it for the team.
