Skip to content

Trust and privilege boundaries

A trust boundary is crossed when an operation moves into a context with different authority or can expose a new audience or external effect. Toolora establishes identity, company/resource scope and operation permission at those boundaries. A trusted service credential or a successful previous read does not authorize every later action.

Caller authority and API policy own the detailed predicate chain. This concept connects those checks to SQL, portals, AI context and providers without defining another permission model.

Boundary Authority that must be established A fact that is insufficient
Browser → PostgREST/Storage Accepted user session, database grants, RLS/function/object policy Hidden controls, tenant cache key or public anon key
Browser/client → privileged API Verified caller, current operation policy and exact resource A supplied company ID or capability without resource scope
API → service-role query/RPC Authorized target and domain constraints before business work The service role bypasses RLS; it does not supply business authority
SQL caller → owner-executed function Explicit function grants and internal scope checks A function name containing API or its generated type
Internal record → portal projection Exact actor/resource admission plus publication/audience policy Project admission alone does not publish every field/file
Source text → model/tool context Authorized bounded source selection; text remains untrusted data An instruction embedded in a message or document
Tool proposal → business mutation Owning confirmation/version contract or explicit supported action authority Tool metadata or model confidence
Local intent → provider command Exact destination, authorized effect and recoverable operation identity A queued row or a successful local editor save

Shared identity and dedicated resource scope

Section titled “Shared identity and dedicated resource scope”

The API accepts the issuer/GoTrue-verified token and resolves live authority through the shared SQL projections. Its accepted app_metadata.active_tenant_id selects the internal company; stored preference is not a fallback for that request. Current memberships/capabilities and the target record still need checking.

Customer project admission uses exact live non-worker company/person pairs and the shared resource projection. Direct project contact admits one project, not customer-wide recipient administration. Worker assignments, UE commitments and public quote tokens use different rules. Reusing a component or account email must not collapse them.

Platform authority requires the operator-designated selected platform tenant and live capability outside impersonation. Editable tenant classification or an administrator label does not create that authority. Resource checks remain necessary after capability exceptions.

Preserve the caller or replace it deliberately

Section titled “Preserve the caller or replace it deliberately”

Not every API database call uses the service role for business data. Reports validates configuration and forwards the accepted caller JWT with the public API key to report_query, retaining source-capability/RLS checks. Replacing that with an unrestricted service-role read would change its security contract.

Conversely, a service-role portal helper must return a safe admitted projection instead of assuming browser RLS scopes it. Shared complete-read helpers and runtime JSON shape checks solve different problems and do not make an unfiltered query safe.

The public MCP boundary retains concrete audience/bearer/quota limitations. Current identity verification must not be described as resolving the independent resource-audience validation gap. Tool annotations describe intended effects; they do not enforce permission or prove confirmation.

A synthetic staff user holds invoice-update capability in Company A and submits a Company B invoice ID. The route must refuse the scoped lookup before the allocation RPC or provider call. A test that only removes the capability never exercises that target boundary.

For a customer, admission to a project must still refuse an internal attachment or customer-wide edit without the stronger condition. For a source document, text that asks an agent to export records remains data, not a new mandate. Data handling and AI context preserve those audience limits.

Declarative route metadata is inventory; its decorator only sets attributes. Structural checks and deterministic no-effect denial tests complement real local token/RLS suites. None establishes every endpoint or external provider outcome. This review records the inspected boundaries and remaining limits rather than claiming a complete security certification.