Skip to content

Permissions

Federico Conticello edited this page Mar 24, 2026 · 1 revision

Permissions

Command Permissions

Plugins must declare which commands they need in plugin.toml:

[permissions]
execute = ["ruff", "pyright"]

Approval Flow

  1. Plugin calls api:run_command("ruff", ...)
  2. FerrisPad checks if ruff is in the plugin's execute list
  3. If not approved yet, a dialog asks the user: "Allow {plugin} to run ruff?"
  4. User chooses Allow or Deny
  5. The decision is stored in settings and remembered

Per-Plugin Isolation

Each plugin has its own permission set. Plugin A being allowed to run ruff does not grant Plugin B the same permission.

Filesystem Permissions

Filesystem access is implicitly granted within the project root — no additional approval needed. There is no way for a plugin to access files outside the project root.

Project Root Detection

The project root is determined by walking up from the current file's directory, looking for these markers (in order):

  1. .git
  2. Cargo.toml
  3. package.json
  4. pyproject.toml
  5. setup.py
  6. .ferrispad

If no marker is found, the file's parent directory is used.

What Plugins Cannot Do

  • Access files outside the project root
  • Run commands not in their execute list
  • Use os, io, debug, or require Lua modules
  • Load external Lua files
  • Execute shell pipelines or use shell metacharacters in arguments
  • Run for more than 1M instructions per hook call
  • Use more than 16 MB of memory

Clone this wiki locally