Skip to content
Reference

Permissions

Reference for the permissions a Kubb Studio agent grants. Each --allow flag of kubb studio, what it lets Studio do, how to turn one off, and what a sandbox removes.

A permission lets Kubb Studio do one thing on the machine that runs kubb studio. You grant each one with a flag, per machine. The agent reports its permissions when it connects and enforces them itself, so Studio cannot turn one on.

Which files and hosts a spec may read is a separate topic, set in kubb.config.ts. See Security.

Flags

Each permission is off by default. The CLI asks once per project for each one you do not pass. Outside an interactive terminal, it skips the questions, so pass the flags the run needs.

FlagLets Studio
--allow-readRead generated file contents
--allow-read-astRead the parsed spec (the Kubb AST)
--allow-writeWrite generated files to disk
--allow-config-editChange plugin options in kubb.config.ts
--allow-installInstall extensions with kubb add. Needs --allow-config-edit.
--allow-updateUpdate extensions with kubb update, leaving the config as is
--allow-removeRemove extensions with kubb remove. Needs --allow-config-edit.
--allow-save-inputSave the spec it sends and point input at it. Needs --allow-config-edit.
--allow-execRun the formatter, the linter, and output.postGenerate
npx kubb studio connect --allow-read --allow-write

What each one changes

  • Without --allow-read, a session still generates and reports file paths, but Studio cannot show their contents.
  • With --allow-read, Studio loads the files already in output.path on connect, so you can browse them before you select Generate.
  • --allow-config-edit covers plugin options. Studio cannot change the security option with any permission.
  • --allow-save-input saves the spec Studio sends and points input at it. A pasted document goes to openapi.yaml, or openapi.json for JSON (openapi-<entry> for a later config entry). A URL or git file goes into input as is, unless its host is not public, such as localhost.
  • The agent keeps recent generations up to the KUBB_AGENT_MAX_GENERATIONS caps, with a separate budget for the initial output. Unchanged output keeps its ID across reconnects.

Turn a permission off

Flags only add permissions, and login resets the saved ones. To turn one off, run kubb studio permissions, then restart a running connection, since it keeps the old permissions. Restart with the same --url and --config, but without that permission's --allow-* flag, which would grant it again.

Sandbox and managed agents

A shared (sandbox) agent has no project, so it never writes files, edits the config, or installs, updates, or removes extensions, whatever its flags say. A hosted (managed) agent keeps the permissions it was started with.