Skip to content

Permissions

Stina uses a permission system to control what extensions can access. Permissions are declared in your extension’s manifest.json under the permissions array. Users see the list of requested permissions before installing an extension, so only request what your extension actually needs.

{
"permissions": ["tools.register", "storage.collections", "network:*"]
}

Permissions gate API access at runtime. If you don’t declare a permission, the corresponding property on context will be undefined.

Control outbound network requests via the Network API.

PermissionDescription
network:*Full network access to any host
network:localhostOnly localhost connections
network:localhost:8080Only localhost on a specific port
network:example.comOnly a specific domain

Use the most restrictive permission possible. For example, an extension that connects to OpenAI should declare network:api.openai.com rather than network:*. If users might configure a custom endpoint (like a remote Ollama instance), network:* is acceptable.

These permissions control which contribution types your extension can register at runtime. Each one unlocks a corresponding property on the ExtensionContext passed to your activate function.

PermissionAPI AccessDescription
provider.registercontext.providersRegister AI model providers
tools.registercontext.toolsRegister tools for AI use
actions.registercontext.actionsRegister UI action handlers
settings.registercontext.settingsRegister and access user settings
commands.registerRegister slash commands
panels.registerRegister right-side panel views
scheduler.registercontext.schedulerRegister scheduled jobs
background.workerscontext.backgroundWorkersRun background tasks

Permissions for persisting data and managing secrets.

PermissionAPI AccessDescription
storage.collectionscontext.storageAccess document collections for persisting extension data
secrets.managecontext.secretsAccess encrypted secret storage (API keys, tokens, etc.)

Permissions for reading information about the user and their conversations.

PermissionAPI AccessDescription
user.profile.readcontext.userRead user profile (name, language, timezone)
user.location.readRead user location
chat.history.readRead past chat conversations
chat.current.readRead current conversation context

Permissions for interacting with the runtime environment.

PermissionAPI AccessDescription
events.emitcontext.eventsEmit events (used for UI refresh triggers)
chat.message.writecontext.chatAppend instructions or messages to the conversation

Permissions for interacting with the operating system.

PermissionDescription
files.readRead files from the filesystem
files.writeWrite files to the filesystem
clipboard.readRead from the clipboard
clipboard.writeWrite to the clipboard

These examples show typical permission sets for different kinds of extensions.

["tools.register"]

The minimum for a tool that doesn’t need storage or network access.

["tools.register", "storage.collections", "actions.register"]

For tools that need to save and retrieve data. The actions.register permission is included so the extension can register UI actions (e.g. opening a detail view).

["network:*", "provider.register"]

Connects to an external AI service and registers as a model provider.

[
"tools.register",
"actions.register",
"storage.collections",
"secrets.manage",
"settings.register",
"scheduler.register",
"background.workers",
"events.emit",
"chat.message.write",
"network:*",
"user.profile.read"
]

An extension like the Mail Reader that needs network access, persistent storage, encrypted secrets, scheduled background jobs, and the ability to inject messages into conversations.

  • Principle of least privilege — Only request permissions your extension actually needs. Fewer permissions means users are more likely to trust and install your extension.
  • Use specific network permissionsnetwork:api.openai.com is better than network:* when your extension only communicates with a known host.
  • Document your permissions — Users see the permission list before installing. Consider explaining why each permission is needed in your extension’s README.
  • Permissions gate API access — If you don’t declare a permission, the corresponding context property will be undefined. Use optional chaining (?.) when calling APIs to handle this gracefully.