Trust model
This page covers who a napplet acts for, what it can reach in each scope, when Flotilla asks the user, and what Flotilla withholds so that a leak reveals less. Every other area page implements a part of it.
Parties#
| Party | Trusted with |
|---|---|
| The user | Their keys, through Flotilla's signer |
| Flotilla | Everything the user does, as the shell |
| The space's relay and its admins | Everything posted in the space, which they already store |
| A napplet's author | Whatever the napplet reads, since the sandbox can't stop a napplet from leaking data it holds |
| Other members | What they can already read in the space |
The sandbox keeps a napplet away from keys and from Flotilla's storage, and it can't stop the napplet from leaking what it reads (see the research page). Opening a napplet in a space therefore shares the space with its author. The question for each napplet is who decides to do that.
Scopes#
Each napplet instance runs in one scope, which the shell enforces.
| Scope | Opened from | Reads | Writes | Storage partition |
|---|---|---|---|---|
| Global | A link or card outside any space | Normal outbox routing | The user's outbox relays, by request | Napplet and user |
| Space | The space menu, the directory or a content surface | The space relay. Public profiles and relay lists through normal routing. | The space relay only | Napplet, user and space |
| Room | An app room, or a content surface inside a room | The space relay with the room's #h | The space relay, with the room's h added | Napplet, user and space |
A scoped napplet can't name another relay. NAP-RELAY's optional relay field and NAP-OUTBOX's relays and toOutbox options are refused outside the scope. The napplet learns where it runs from the proposed context NAP, which returns the space's relay URL or the room's url'h.
Who decides#
Admins decide for the apps they install, and members decide for everything else.
| Action | Admin-installed, in its space | Other app, in a space | Any app, global scope |
|---|---|---|---|
| Read events in the space | Allow | Ask once | Ask once |
| Read public profiles and relay lists | Allow | Allow | Allow |
| Publish a declared kind to the space | Allow, with undo | Ask per kind | Not available |
| Publish an undeclared kind to the space | Ask per kind | Ask per kind | Not available |
| Publish to the user's outbox relays | Refuse | Refuse | Ask per kind |
| Publish kinds 0, 3, 5 or 10002 | Ask every time | Ask every time | Ask every time |
| Read or send DMs | Not offered | Not offered | Not offered |
| Upload to the space's Blossom server | Allow | Ask per upload | Not available |
| Storage | Allow | Allow | Allow |
| Open a Flotilla page through an intent | Allow | Allow | Allow |
An admin's install covers the space where they installed it, and only actions that stay in that space. The same napplet opened from a chat card in another space, or from a link, gets the normal prompts. Admins already hold the space's content, so installing an app vouches for one more party, as adding a bot does in a Discord server. Users can still turn off any app for themselves in Settings → Apps.
The first-open prompt for a non-installed app says what sharing means: "This app can read messages in Makers Guild. Anything it reads can be sent to its author."
Posting as the user#
Publishing without a prompt is the riskiest grant, because an app could post as the user without the user noticing. Every napplet publish goes through PublishBuilder.withDelay, with a toast that names the app and offers undo: "Wiki posted as you · Undo". Flotilla also limits how fast one app can publish. With a NIP-46 signer, the bunker may prompt as well.
Pinned versions#
A pin names an exact artifact hash. An update from the author doesn't run in a space until an admin accepts it, so prompt-free grants always cover bytes an admin chose. The hosting panel shows what an update changes: its domains, kinds and intents.
Grants a user gives are keyed by napplet address, artifact hash and scope, so an update asks again. Storage is keyed by napplet address, user and scope, so an update keeps its data and two spaces never share it.
Withholding data#
Flotilla gives a napplet less than the protocol allows, so a leak proves and reveals less.
- No signatures. Events reach napplets without
sig, and keep theiridfor references. A leaked event can't be proven to come from its author. This matches thepolicy_strip_signaturessetting hosted relays already have. It limits proof, not disclosure, and a signed copy leaked elsewhere still matches. Napplets that repost ask the shell to do it. - No resource prefetching. Sidecar pre-resolution stays off, as NAP-RELAY requires by default.
- No DMs. The
dmdomain andpublishEncryptedaren't offered.
Residual risks#
| Risk | Status |
|---|---|
| A napplet leaks what it reads through its own navigation or WebRTC | Inherent. The host page applies Kehto's WebRTC and nested-frame locks. |
| An admin installs a malicious app | The admin is responsible for the space, members see who installed it, and members can turn it off |
| A napplet hides data in content it publishes | Undo and rate limits narrow it. Content inspection is heuristic. |
| Side channels between frames in one process | Outside NIP-5D's guarantees. Capacitor runs every frame in one WebView process. |