Capabilities and restrictions
Declare only the capabilities your plugin uses. The sandbox client and host both enforce grants, which are confirmed together with the code hash.
| Capability | Available services |
|---|---|
| storage | Plugin-private JSON get/set/delete |
| settings | Manifest-defined preference get/set |
| ui | Dialogs, panels, overlays, composer actions, sandbox views, theme snapshots, notices |
| patcher | Serialized transforms at registered named hooks |
| messages | Validated embeds in the current channel |
| styling | Validated, disposable selector rules |
| inspection | Sanitized element events, optionally intercepting inspected clicks |
| shortcuts | Host keyboard shortcut registrations |
| images | Restricted public HTTPS PNG resources |
| clipboard | User-action-associated text writes |
| attachments | Posted-file context actions and bounded metadata lookup |
| external_links | User-authorized public HTTPS browser navigation |
Check a grant
Section titled “Check a grant”if (api.capabilities.has("storage")) { const previous = await api.storage.get<string>("last-view"); api.logger.debug("Stored view available", { available: previous !== undefined, });}A capability check does not replace error handling: the current context, input, resource limits, and instance lifetime can still make an operation fail.
Unavailable privileges
Section titled “Unavailable privileges”There is no general network API. The current manifest capability enum does not include network. Legacy references to it are not a way to enable arbitrary requests.
Plugins have no Node/Electron APIs, filesystem, parent DOM, top navigation, popups, or remote scripts. Direct fetch/connect is blocked. The supported image service, attachment lookup, and browser navigation each have narrower rules.
Core owns credentials and transport. Handles belong to a plugin instance and cannot be transferred. New privileged operations require a bounded core extension; see extending the SDK.
