Current model
The product now calls the published surface an App. client.apps and appScopes are canonical; client.works and workScopes remain compatibility aliases for older clients.
| Grant source | Who supplies it | Scope boundary |
|---|---|---|
| App scopes | Publisher at publish time | Bounded direct grants on the App's home Space |
| Viewer grant | Viewer, through runtime consent | Any permission the viewer currently holds on a selected Space |
allowedViewerScopes is deprecated and no longer gates viewer consent. Do not use it as a new security boundary.
Direct App scopes are limited to:
space.view session.view file.view file.edit
taskrun.view session.prompt.readonly session.prompt.fullaccess command.executegeneration.create, account-level user.*, and other management permissions require a viewer grant. generation.create is also separate from taskrun.view: creating a task does not grant permission to poll its result.
Steps
- List the features the App actually implements.
- Map each feature to the smallest direct App scope or user-gesture viewer grant.
- Publish only direct scopes needed for reads on the App's home Space.
- Request actions or another Space only after a clear user gesture, with a useful
reason. - Re-test as a fresh viewer. Grants are per Space, last 14 days, and are revalidated against current membership and role.
- Render state from
client.context().permissions; let the host own grant caching and renewal.
Common sets
| App type | Direct App scopes | Runtime viewer grant |
|---|---|---|
| Static site | none | none |
| File reader | space.view, file.view | none |
| LLM chat on home Space | space.view, session.view | matching session.prompt.* |
| Image generation | space.view, taskrun.view | generation.create |
| Task Browser - Mine | none or home-Space reads | user.taskrun.list |
| Cross-Space reader | home-Space scopes as needed | auth.requestSpace() with file.view / session.view |
Done when
- [ ] Every grant corresponds to a visible feature
- [ ] No authorization wall appears on first paint
- [ ] Generation creation and result polling both work
- [ ] A static App carries no prompt, generation, or account-wide scope
Avoid
- Asking for
fullaccessoruser.*“just in case” - Treating
allowedViewerScopesas a current security boundary - Assuming a viewer grant on one Space transfers to another
- Copying another App's scope set without checking its API calls