Workspace-isolated contract
A workspace is a hard boundary, not a filter. Every operation resolves its organization from the trusted auth context — never from the request payload — and every query carries a workspace predicate.
- The organization id comes from the token, never from the body: a payload cannot select a workspace
- Server functions derive context from the Better Auth organization role; the API derives it from the token hash, scopes, and integration source
- Both boundaries converge on the same shared operations, so the UI and the API cannot drift apart in behaviour
- Source-scoped resources additionally verify the integration source that wrote them