Awesome Cohub
中文
Playbooksintermediatecohub.bp.minimal-scopes2 min

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 sourceWho supplies itScope boundary
App scopesPublisher at publish timeBounded direct grants on the App's home Space
Viewer grantViewer, through runtime consentAny 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.execute

generation.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

  1. List the features the App actually implements.
  2. Map each feature to the smallest direct App scope or user-gesture viewer grant.
  3. Publish only direct scopes needed for reads on the App's home Space.
  4. Request actions or another Space only after a clear user gesture, with a useful reason.
  5. Re-test as a fresh viewer. Grants are per Space, last 14 days, and are revalidated against current membership and role.
  6. Render state from client.context().permissions; let the host own grant caching and renewal.

Common sets

App typeDirect App scopesRuntime viewer grant
Static sitenonenone
File readerspace.view, file.viewnone
LLM chat on home Spacespace.view, session.viewmatching session.prompt.*
Image generationspace.view, taskrun.viewgeneration.create
Task Browser - Minenone or home-Space readsuser.taskrun.list
Cross-Space readerhome-Space scopes as neededauth.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 fullaccess or user.* “just in case”
  • Treating allowedViewerScopes as 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