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.
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.
| Layer | What it does | Catches |
|---|---|---|
| Query scope | Adds 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 guard | Inspects 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 security | Row-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
- The request carries a session token (a person) or a source ingest key (a machine). Both resolve to exactly one organization.
- A session also resolves a role and its scope: whole organization, assigned business units, or owned AI systems.
- The query is built with those predicates. The SQL guard checks the text before it runs.
- The database applies row security on the same organization.
- 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.