Skip to main content
Early pricing is live. Start free for up to 3 AI systems — no card, no time limit.Early pricing is live. Free for up to 3 AI systems.
All docs
Explanation

How a request stays inside your organization

The three layers that scope every read and write to one organization, and why another organization’s record answers 404.

5 minFor: Engineer, Finance reviewer

Three layers

Every read and write is scoped to one organization three times over, by three mechanisms that do not share code. A bug in one is caught by the next.

LayerWhat it doesCatches
Query scopeAdds the organization predicate to every query the application builds, plus a business-unit or owned-systems predicate for roles with a narrower scope.The normal case.
SQL guardInspects the SQL text at run time and refuses any query on an organization-scoped table that carries no organization predicate.A handler that forgot the scope, for example an update by id alone.
Database row securityRow-level security in the database limits every statement to one organization’s rows.Anything that reaches the database another way.

One request, end to end

another org's idRequestsession token or ingest keyWho is this?organization, role, scopeQuery scopeorganization predicate, plusbusiness unit or owned systemsSQL guardno org predicate: refusedDatabase row securityrows of one organizationYour rows only404 Not found
three layers between a request and a row; a record that belongs to another organization answers 404, never 403 · source tenant-scoped-request.mmd
  1. The request carries a session token (a person) or a source ingest key (a machine). Both resolve to exactly one organization.
  2. A session also resolves a role and its scope: whole organization, assigned business units, or owned AI systems.
  3. The query is built with those predicates. The SQL guard checks the text before it runs.
  4. The database applies row security on the same organization.
  5. Only rows of that organization come back, and only those within the role's scope.

Another organization's record

A request that names a record belonging to another organization answers 404 Not found, never 403. A 403 would confirm the record exists; a 404 confirms nothing. The same rule holds inside an organization for a role's scope: a use case outside a Team lead's business units is not found, and linking a benefit to another organization's claim is not found.

Note

The few paths that legitimately read across organizations (seeding the demo workspace, platform operations) wrap themselves in an explicit bypass that names its reason, and every use of it is logged.

Keys and sessions

  • A source ingest key embeds the organization it belongs to, so every lookup it drives is organization-scoped by construction. Only its SHA-256 digest is stored; the key is shown once.
  • A key opens one receiver. A collector key at the gateway receiver answers 403 and names the right door; a revoked or unknown key answers 404.
  • Practice is a separate process with its own database and its own session secret. It never accepts a production token, and production refuses to start with Practice settings present.
  • Magic-link pages (sign-up access, cost report, check-in) carry their key in the URL fragment, which no browser sends to any server.

Where each key is accepted: Receivers.

Previous

The audit chain

Last documented 2026-11-18 against master fb17e1c5. Live release 0.3.1.