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.
| Flag | Lets Studio |
|---|---|
--allow-read | Read generated file contents |
--allow-read-ast | Read the parsed spec (the Kubb AST) |
--allow-write | Write generated files to disk |
--allow-config-edit | Change plugin options in kubb.config.ts |
--allow-install | Install extensions with kubb add. Needs --allow-config-edit. |
--allow-update | Update extensions with kubb update, leaving the config as is |
--allow-remove | Remove extensions with kubb remove. Needs --allow-config-edit. |
--allow-save-input | Save the spec it sends and point input at it. Needs --allow-config-edit. |
--allow-exec | Run the formatter, the linter, and output.postGenerate |
npx kubb studio connect --allow-read --allow-writeWhat 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 inoutput.pathon connect, so you can browse them before you select Generate. --allow-config-editcovers plugin options. Studio cannot change thesecurityoption with any permission.--allow-save-inputsaves the spec Studio sends and pointsinputat it. A pasted document goes toopenapi.yaml, oropenapi.jsonfor JSON (openapi-<entry>for a later config entry). A URL or git file goes intoinputas is, unless its host is not public, such aslocalhost.- The agent keeps recent generations up to the
KUBB_AGENT_MAX_GENERATIONScaps, 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.
