Trust & scopes
A plugin is trusted through two layers. For the jail: an admin consents to each
capability at install (POST /api/plugins/install → /confirm, admin-gated), and
the Deno sandbox enforces exactly the granted set — see
Sandboxed packages. For the declarative seams: a
closed scope taxonomy plus a per-installation scoped token gate every HTTP
call a seam makes. There is no marketplace; the host is the trust boundary — a plugin
runs under one operator’s host, scoped to its projects. (Web install is admin-gated;
a manifest-only plugin can also be sideloaded by an operator with host access.)
This page covers the scope/scoped-token layer; capability consent is documented with
the jail. The two coexist — a package that ships a main.ts and declares seams is
gated by both.
The scoped token
Section titled “The scoped token”Each plugin installation — a (pluginId, projectPath) pair — gets its own token
(the GitHub-Apps model). It is the capability gate over every seam.
Lifecycle — minted lazily after enable, never listed. Dropping a directory into a
plugins root only makes the plugin discovered (disabled by default); confirming a
web install enables it at once. The per-install token is minted the first time the
enabled plugin is launched into an agent’s MCP environment or an operator asks for
it, and is then stable until rotated. GET /api/plugins never carries it: the
listing is readable by every project member, and the token is not theirs. An
instance operator (a signed-in person, not a turn) can fetch it with
POST /api/plugins/installation-token { projectPath, pluginId } for a plugin whose
own server needs to call back into Lowkey. A tunnel surface
does not receive it in the frame; the surface route never accepts it. An agent’s
MCP launch never receives it either: LOWKEY_PLUGIN_TOKEN in a shipped MCP server’s
environment is a launch credential (lkm_…, see below), not the installation’s
lkp_, so a member’s turn can never carry the installation’s authority away.
Direct surfaces get a viewer grant instead. For a direct panel plugin the web
client mints a per-viewer grant (POST /api/plugins/viewer-grant, lkpv_…, at
most one hour, bound to the viewing member, the installation and its consent) and
passes that into the mounted iframe as the lowkey_plugin_token query parameter
(see surfaces). The plugin’s service presents
it on calls back to Lowkey exactly like an lkp_; the scoped routes accept both.
A viewer grant is denied once the member leaves the project, the consent epoch
changes, or it expires, and it never authorizes webhooks or MCP.
MCP servers get a launch credential. When an enabled plugin’s shipped MCP server
is launched into an agent turn, LOWKEY_PLUGIN_TOKEN is an lkm_… credential minted
for that launch: process-local to the daemon, bound to the installation, its consent
epoch and the person the turn acts on behalf of, and revoked the moment the turn
ends. The scoped routes that accept viewer grants (cards, session-read, prompt) accept
it the same way, re-checking enablement, scope, consent epoch and that person’s
current membership on every call, and treat that person as the actor (a worker or
scheduled pass has none, so private sessions stay out of reach). It is not a
webhook credential and not an installation credential: a server that needs to post
webhooks or introspect must be run by an operator with the lkp_ from
installation-token. Disabling the plugin revokes every launch credential at once.
Disable = revoke; re-enable = rotate. The scoped-token guard re-checks
enablement on every request: a call made with the token of a now-disabled
installation is denied (plugin_disabled, 403). Re-enabling mints a fresh lkp_
before the plugin is published as enabled, so a value copied while the plugin was
off never comes back to life, not even for an instant; if the rotation cannot be
stored the plugin stays disabled and the enable call fails (500). Removing a member
from a project also rotates every installation in it (and in nested projects),
before the membership change is written: a rotation failure fails the removal and
the member stays listed, never the reverse. Routes that read a request body
(cards, prompt, webhook) re-authorize after the body has arrived, so a request held
open across any of these changes is refused rather than completed.
- Format:
lkp_+ random. The service authenticates back to Lowkey by sending it asAuthorization: Bearer lkp_…orX-Lowkey-Plugin-Token: lkp_…(header). A direct-surface iframe receives a viewer grant (lkpv_…) as thelowkey_plugin_tokenquery param; the service sends whichever it holds as a header. - Scope of authority: the token authorizes calls only for its plugin, only in its project, and only against the scopes its manifest declares.
- Isolation: a plugin cannot read another plugin’s token or a provider’s secrets. Provider-credential access is refused outright in v1.
- Per request: every scoped route checks the token, the
projectPathmatch, that the installation is registered and enabled, the manifest’s declared scope, and (where relevant) credential access — in that order.
The lkp_ token is bound to the installation, not to a person: a call made with it
carries no actor, so it can never read or write a private session. A viewer grant
is bound to the member it was minted for and carries them as the actor.
Scope taxonomy
Section titled “Scope taxonomy”The closed set (also in the manifest reference):
| Scope | Grants | Trust tier |
|---|---|---|
cards |
Emit closed cards into the feed. | Third-party OK. |
mcp |
Register an MCP server, injected per project. Runs unsandboxed on the host. | Consent-worthy: listed with a warning in the install consent panel. |
webhook |
Inbound trigger + turn-completion subscription. | Consent-worthy: listed in the install consent panel. |
focus |
Mount a surface in the main pane. | Third-party OK. |
side-panel |
Mount a surface in the side panel. | Third-party OK. |
session-read |
Read a session’s transcript + lineage. | Consentable third-party. |
agent |
Contribute an AgentDef (prompt, mode, translator, runtime). |
Consent-worthy privilege: listed with a warning in the install consent panel. |
Not scopes (deferred):
media— camera/mic delegated to a surface’s iframe via Permissions-Policy. When it lands it is first-party / trusted only; the highest-stakes scope.storageas a scope — a filesystem/storage-provider seam, deferred. This is unrelated to the livestorage.plugincapability, which gives a sandboxed package private durable storage (see Sandboxed packages).
Consent
Section titled “Consent”For a web-installed package the admin consents at install, in one panel that lists
the capabilities (what the sandboxed main.ts may use) and the declared
seams: each surface with its transport, path and identity fields (including
whether member email is shared), the mcp command and arguments, the agent
contribution and the webhook source. The mcp, agent and webhook seams run
outside the sandbox and are not limited by the capability list; the panel says
so. Downloads from plugin surfaces are marked as coming from Lowkey. Three trust
distinctions matter when you design a plugin:
mcpruns a host process. The command is spawned unsandboxed at agent launch, with the credentials described under MCP registration. An admin who approves the install approves that command.agentis a privilege, not just an API scope. A plugin that only contributes anAgentDefcalls no API, yet it runs on the operator’s provider credential, speaks to users, and (viaplatformPromptMode: minimal) can lower the safety floor. It is consent-worthy on its own.session-readis consentable for third parties — it reads the session’s own transcript + lineage, not platform internals — but it is still a deliberate grant a user makes knowingly.
First-party-only seams
Section titled “First-party-only seams”Some seams are reserved for first-party / trusted plugins and are not granted to third parties in v1:
mediadelegation (deferred; first-party-only when it lands).platformPromptMode: none— not exposed at all in v1; a first-party-only trapdoor if/when it returns, behind a no-tools-attached guarantee.
Everything else in the closed scope set is available to third parties, subject to consent.
Deny reasons
Section titled “Deny reasons”Scoped routes return a JSON body { "error": "unauthorized" | "forbidden", "reason": "<reason>" }:
| Reason | Status | Cause |
|---|---|---|
missing_token |
401 | No token on the request. |
invalid_token |
401 | Token not recognized. |
missing_project |
403 | No projectPath supplied. |
project_mismatch |
403 | projectPath ≠ the token’s installation project. |
plugin_not_registered |
403 | No manifest resolves for the installation. |
plugin_disabled |
403 | The installation exists but is disabled for the project (revoked access). |
plugin_mismatch |
403 | Resolved manifest id ≠ the token’s plugin id. |
undeclared_scope |
403 | The route’s scope is not in the manifest’s scopes. |
credential_forbidden |
403 | The route asked for credential access the token may not have. |
Signing
Section titled “Signing”The manifest carries signing (publicKey, signature). Designed-for but
unenforced in v1 — integrity verification lands with the catalog. Include the
fields; do not rely on enforcement yet.