Worked Examples

Apply tenant isolation — Sustainable Catalyst Platform Core

Tenant isolation restricts each organization's private research records to authorized users and services. This guide covers enforcement across reads, writes, and exports, including how to verify that cross-tenant requests fail without revealing whether a record exists.

ProductSustainable Catalyst Platform CoreUpdatedNovember 20, 2026Reading time22 minutes

Application: Sustainable Catalyst Platform Core
Component: Identity, Authorization & Governance → Tenant Isolation
Reading time: Approximately 18 minutes
Source baseline: 59b8444365525a58fd4f6a7e29a20d712769e1a2 (November 7, 2026)
Verification level: Repository inspection and isolated synthetic tests; deployed enforcement pending
Intended audience: Platform operators, developers, security reviewers, research-system owners

Tenant isolation is established at the resource boundary: each private operation must be tied to a verified identity, an active institutional membership and the organization that owns the data. The safeguards apply equally to direct URLs, queries, exports, background processing and public-release projections.

1. Goal

Enforce organization-specific boundaries on every private read, mutation, search, export, derived artifact, and asynchronous handoff. A successful control must deny a request from another tenant without revealing whether the target record exists, while leaving the other tenant’s state unchanged.

A tenant is an explicit institutional security boundary, not a product name, API plan, project title, organization label in arbitrary JSON, or visibility flag. The desired state is server-verified principal → active organization membership → resource ownership → action-specific permission → scoped database operation.

2. Requirements

  • An isolated, approved staging environment with a disposable database, two independent synthetic organizations, and separately authenticated identities. Do not use live research data.
  • An inventory of the actual resource owners and entry points: Platform Core, Workspace, Research, Library, Lab, export and background workers.
  • Current deployment commit and policy enforcement mode, migration state, read/write middleware configuration, and evidence of a working rollback.
  • A definition of organization membership, project ownership, allowed collaborator actions, public-release eligibility, and revocation semantics approved by the system owner.
  • A trusted identity assertion from the server-side authentication layer. Never trust client-supplied orgId, principalId, or role as authority.

Verified documentation baseline: repository main at commit 59b8444365525a58fd4f6a7e29a20d712769e1a2 (November 7, 2026). Current deployed revision and access-control mode were not independently verified.

3. Current source: what Platform Core actually provides

Implementation Source-backed behavior Tenant-isolation interpretation
Read/write dependencies dependencies.py exposes require_read (checks global public_reads) and require_write (checks X-SC-API-Key, with production writes disabled if the key is absent). These controls do not establish a verified human, institution, or object owner.
Governance evaluator governance service evaluates principal, product, resource type/action and visibility; records decisions and hash-linked audit events. A policy decision is not proof the protected route enforced the decision.
Enforcement mode v2.16 documentation states default audit; configuration also accepts enforce. Confirm the running mode and route-level enforcement before any isolation claim.
Research-project bundle unified research router provides GET /v1/research/projects/{project_id}/bundle guarded by require_read. The inspected route does not supply a trusted tenant identity to its bundle service.
Public research bundle GET /api/v1/research/projects/{project_id}/bundle requires a public API data:read scope and calls the service in public-only mode. Public API scope does not itself authorize access to private organizational materials.

4. Source-level isolation gaps to treat as release blockers

The following are code-inspection findings, not confirmed production exposures. They define the work required before reporting that Platform Core enforces organization-level isolation:

  1. The inspected unified project private bundle route calls svc.bundle(db, project_id) without authenticated principal or organization context. A global read gate cannot distinguish two tenants.
  2. The unified project service resolves project data by project entity ID and filters child rows by that ID. It does not receive an authenticated tenant ID or verify a membership record in the inspected functions.
  3. The governance decision endpoint accepts principal_type and principal_id in its request body; the authenticated caller must not be inferred from these values. The endpoint uses a service-key write dependency.
  4. Policy matching checks principal, product, resource type, action, and visibility; resource_id is recorded in decisions but is not used by the inspected matcher to resolve an organization or owner.
  5. The public bundle verifies that the entity and unified profile are both marked public. Its returned child collections require separate examination for private notes, snapshots, embedded credentials, or nonpublic provenance; this is not an independently verified complete disclosure filter.

Do not claim tenant isolation merely by setting the governance mode to enforce; object-aware route enforcement and scoped storage queries must first exist and be tested.

5. Trust model and decision semantics

Model the request as (verified subject, active organization, active membership, project owner, object visibility, action, revision). Permit a private operation only when all relevant conditions hold; the service must obtain the first three from trusted server context, not from a request payload.

# Illustrative rule, not a currently verified Platform Core function.
allow_private = (
    subject_is_authenticated
    and active_membership(subject, organization_id)
    and object_owner_org_id == organization_id
    and action in effective_capabilities(subject, organization_id, object_id)
    and not access_revoked(subject, organization_id)
)
# DENY unless every term is supported by authoritative evidence.

Distinguish authentication (who is calling), membership (which institution and role), authorization (action on a specific object), publication (approved public projection), and data rights (which content may lawfully be shared). None substitutes for another.

6. Procedure

A. Inventory all tenant-bearing routes

  1. Create a route register of single-object reads, lists/searches, writes/deletes, historical revisions, data previews, downloads/exports, and public projections. Include cron jobs, queues, internal RPCs, report generation, and backups.
  2. For each route, record principal derivation, organization source, resource owner source, scope predicate, action policy, response projection, and audit location.
  3. Classify each as enforced, audit-only, unverified, or public by explicit release. Do not use a single platform-wide pass/fail label before every route is covered.

B. Bind identity and membership at the server

  1. Authenticate the caller using the platform’s approved identity authority, verify issuer/audience/expiry/session revocation, and resolve the stable internal subject.
  2. Resolve active organization membership from an authoritative account-and-membership store; constrain active tenant selection to one of those memberships.
  3. Pass an immutable trusted request context to downstream services. Ignore or reject mismatching client-controlled owner and organization identifiers.

C. Enforce on the resource operation

  1. Look up the object using a tenant-scoped predicate, or join membership and owner in the same database query.
  2. Perform action-specific checks on every read, write, export, copy, and background task; enforce the revision precondition for mutations.
  3. Use a uniform not-found response for absent or unauthorized private records. The service may record a detailed internal denial reason, but must not reveal it publicly.

D. Verify independently

  1. Create synthetic organizations A and B, with a private project in each. Use separate authenticated users and one user with no membership.
  2. For all routes, run owner success, same-organization least-privilege success/denial, foreign-organization denial, revoked membership denial, and nonexistent-ID denial.
  3. Compare response status, body shape, headers, timing distribution, cache and download links, and post-request revision/fingerprint state. Re-run after a fresh session and service restart.

7. Tenant-scoped data model (proposed design)

The current unified project service inspected above does not establish this organization-scoped schema. The following PostgreSQL example is an implementation recommendation, not a claim about existing migration tables:

CREATE TABLE organization_memberships (
  organization_id TEXT NOT NULL,
  subject_id TEXT NOT NULL,
  role TEXT NOT NULL,
  active BOOLEAN NOT NULL DEFAULT TRUE,
  PRIMARY KEY (organization_id, subject_id)
);
CREATE TABLE tenant_projects (
  organization_id TEXT NOT NULL,
  project_id TEXT NOT NULL,
  revision BIGINT NOT NULL DEFAULT 1,
  visibility TEXT NOT NULL DEFAULT 'private',
  public_release_approved BOOLEAN NOT NULL DEFAULT FALSE,
  payload JSONB NOT NULL,
  PRIMARY KEY (organization_id, project_id)
);
-- Every child table must carry or prove equivalent immutable tenant ownership.
-- Add foreign keys, unique constraints and row-level rules as appropriate.

If identifiers are globally unique, still require the owner predicate. If project IDs repeat across organizations, use a composite tenant/project key throughout foreign keys, URLs, revision tables and audit records. Migrations must preserve existing canonical project identity and provenance relationships.

8. Read and list operations

A correct query does not fetch by project_id and then assume a caller has access because a global API key was accepted. Scope the query to the authenticated active organization and independently validate the membership. Apply the same predicate to pagination, search, count endpoints and aggregation:

-- Parameters are resolved by authenticated middleware and authorization service.
SELECT p.project_id, p.revision, p.payload
FROM tenant_projects AS p
JOIN organization_memberships AS m
  ON m.organization_id = p.organization_id
WHERE p.organization_id = :trusted_organization_id
  AND p.project_id = :project_id
  AND m.subject_id = :verified_subject_id
  AND m.active IS TRUE;

For absent and foreign-tenant resources, prefer one public error contract (for example 404 {"detail":"Resource not found."}). Do not return separate “belongs to another organization,” owner names, row counts, or project titles.

9. Write, delete and revision preconditions

Authorize before mutation, but also encode the tenant and expected revision in the atomic update predicate. A separate preflight check followed by an unrestricted update creates a time-of-check/time-of-use gap.

UPDATE tenant_projects
SET payload = :validated_payload,
    revision = revision + 1
WHERE organization_id = :trusted_organization_id
  AND project_id = :project_id
  AND revision = :expected_revision
RETURNING revision;
-- 0 rows: inspect internally for 404 vs 409 without leaking object existence.

The same principle applies to deletes and changes to child objects. Preserve append-only research revisions and independent scientific evidence according to retention policy. A denied foreign-tenant operation must leave the target project revision, source hashes, review records, and audit evidence unchanged.

10. Export, snapshots, portable packages and signed URLs

  • Authorize both discovery and download under the same trusted organization, including after exporting data to object storage or a temporary job workspace.
  • Bind expiring download tokens to permitted tenant, object, action, and revision; invalidate or deny after revocation to the extent supported by the delivery mechanism.
  • Inspect nested references, notebook attachments, figure assets, CSV extracts, charts, structured provenance, hidden metadata, and cached search excerpts. One foreign object in a bundle fails isolation.
  • Return a distinct public release projection containing only approved fields; a general data:read API credential is not sufficient to publish private research.
  • Do not treat a snapshot hash as permission to release its contents. Verify publication and rights gates separately.

11. Public-release checks in existing source

In the source-inspected unified project service, bundle(..., public_only=True) requires both the entity and unified profile to have visibility="public". The function then collects components, relationships, provenance records, handoffs, and snapshots for that project. Review whether every included field is eligible for public release; top-level visibility does not by itself prove child-level rights clearance.

See bundle() and public_only. The public API wrapper requires a public data:read credential scope. This is a public-data API access requirement, not organization membership.

12. Governance control plane: useful but insufficient alone

Existing policy records support principal/product/action/visibility matching, role bindings, deny-on-tie precedence, decision logging and SHA-256-linked audit events. These are valuable controls only when every sensitive route calls enforcement with a trusted principal and resolves the target object’s organization correctly.

Existing contract Verified source meaning What remains to prove
POST /v1/governance/decisions/evaluate Authenticated service key allows a caller to submit a principal and target fields for evaluation. The evaluated principal matches a verified actor and each resource route actually enforces the decision.
GET /v1/governance/readiness Returns the configured audit/enforce mode and migration readiness when reads are permitted. The deployed environment reports enforce and targeted routes are fail-closed.
GET /v1/governance/audit/verify Checks the internally hash-linked audit chain. Denied requests were blocked at the data boundary; hashes alone do not prove prevention.
POST /v1/governance/roles Binds an existing governance role to a declared principal, optionally product-scoped. The binding represents real organization membership; product scope is not an institutional tenant.

13. Read-only staging inspection

Operators can inspect the staging governance readiness endpoint without changing policy. Use a test hostname, and do not paste tokens into the article, logs or public tickets. This command is not a tenant-isolation test:

# STAGING_ORIGIN should be an authorized test deployment, not production.
: "${STAGING_ORIGIN:?Set the test origin first}"
curl --fail-with-body --silent --show-error   "$STAGING_ORIGIN/v1/governance/readiness" | python3 -m json.tool
# A 403 may mean global public_reads is disabled; do not bypass it.

Retain an evidence receipt with the deployment digest, migration status, observed governance mode, UTC timestamp and who conducted the test. Never assert that enforce means every route is covered.

14. Authenticated test matrix

Case Required result Evidence
Owner A reads project A 200, exact authorized project revision and permitted fields Response digest and audit correlation
Member A with viewer role exports A Allowed only for approved least-privilege export Manifest and scoped references
User A reads project B Uniform not-found; no B metadata Status/body/headers/timing and unchanged B revision
User A updates or deletes B No mutation, same nondisclosure policy Before/after B revision and fingerprint
Unassigned user reads A Uniform not-found No response leakage
Revoked A member reads or exports A Denied on all sensitive channels Fresh-session and cached-token coverage
Existing A identifier is guessed by B Same outward response as nonexistent identifier Comparative error contract
Valid public release Only whitelisted public projection Field-level inspection and rights receipt
Private object marked public by mistake No exposure without separate publish approval Private nested content omitted
Stale revision write Conflict without overwriting accepted content 409 and unchanged canonical head
Mixed-tenant export/research package Entire unsafe export refused or foreign elements excluded by approved contract Manifest-level tenant assertions
Background retry after membership revoke No new forbidden mutation; prior evidence preserved Worker identity, policy re-evaluation, receipt

15. Runnable isolated reference model

The accompanying ZIP includes tenant_isolation_reference.py and test_tenant_isolation_reference.py. They implement a small SQLite tenant-scoped project store with active membership, owner-scoped reads/updates/exports, uniform not-found responses, revisions, approved public projections, and sanitized audit records.

# From the extracted package directory (Python 3.10+; stdlib only):
python3 -m unittest -v test_tenant_isolation_reference.py

The model is deliberately independent of the Platform Core repository and service. Its passing tests are design-reference evidence, not proof that Core’s live endpoints, database, caches or identity provider are configured safely. It has no live connector or credentials.

16. Response-equivalence and information leakage

The primary acceptance condition requires cross-tenant requests to fail without revealing object existence. Compare absent-versus-foreign responses for the same method, content type, JSON keys, redirects, cache headers and error messages. Do not rely on exact timing equality: instead flag stable, statistically meaningful timing differences in repeated bounded test samples without stress-loading a service.

Do not accidentally disclose through GraphQL errors, autocomplete, search counts, pagination tokens, generated thumbnails, object storage ETags, CDN caches, telemetry, archive filenames, exception logs, or result-set size. In a production design, cache keys must include verified organization scope and applicable policy/publication version.

17. Membership revocation and existing artifacts

Revoking membership must block new reads, writes, exports, and asynchronous work associated with that identity. Confirm identity/session revocation separately from project membership revocation; previously downloaded data cannot be technically recalled. Short-lived URLs, cached data, and independently issued service credentials require explicit invalidation or expiry policies.

Historical research records should not be deleted merely because a collaborator is removed. Preserve signed review decisions, submission revisions, provenance links and regulatory audit evidence as authorized, while removing ongoing privileges.

18. Symptoms

Observed symptom Likely boundary failure
Valid service key reads another institution’s private project Service authentication is being mistaken for tenant authorization.
Governance evaluator says deny but bundle still returns 200 Audit-only mode, missing route integration, or wrong principal/owner mapping.
Foreign project gives distinguishable 403 or validation details Object existence or ownership is exposed in errors.
Public bundle includes private notes or snapshot fields Top-level visibility was not applied to nested content.
Old collaborator can still download an export Cached artifact, independent download credential, stale membership or missing revocation check.
A list endpoint hides records but direct URL works Scope filter exists only in the list implementation.

19. Cause

Common causes include using global service keys as a substitute for individual identity, accepting organizationId or owner from client JSON, failing to propagate owner scope into repository calls, omitting a tenant predicate from an individual read or update, and enabling public API scope without content-release checks.

A governance policy that matches product and resource type is not automatically an organization-specific row authorization rule. Audit records describe a decision; they do not prove execution was prevented unless enforcement evidence is attached.

20. Troubleshooting

  1. Freeze affected route enablement in staging if a synthetic cross-tenant read unexpectedly succeeds; do not repeat against real content.
  2. Confirm deployed image digest and settings. Check global public_reads, configured governance mode, and whether sensitive routes use only require_read/require_write.
  3. Follow the exact request path through middleware, verified identity, role/membership lookup, service function, database predicate and serialization.
  4. Compare the same object as owner, foreign tenant, revoked member and nonexistent ID. Record statuses and sanitized response hashes.
  5. Check exports, worker jobs, caches, and public projections for parallel bypass paths.
  6. Preserve logs, trusted audit decisions and revision hashes, then repair the common authorization layer instead of adding superficial UI restrictions.

21. Resolution

A production-ready remediation requires an approved organization identity and membership authority, trusted principal binding, owner-scoped data access on every private route, action-specific policy checks, public field-level publication filters, and resource-safe export authorization. Introduce those changes behind an isolated rollout with migration, compatibility and rollback procedures.

A safe release plan has a prepared backup, staged migration, enforced negative-test suite, audit/telemetry verification, route inventory sign-off, and an explicit go/no-go decision. If a route lacks tenant awareness, keep it disabled or restricted to an operator-controlled trust boundary until repaired; toggling a policy evaluator alone is not remediation.

22. Verification

Do not label tenant isolation verified until all applicable checks below pass against the deployed candidate, using real identity/session enforcement and disposable fixtures:

  1. Two independent tenant identities, separate membership ledgers and projects with private nested content are present.
  2. All private read, write, list, count, search, export, thumbnail, revision and background routes enforce tenant scoping at the data boundary.
  3. Foreign and nonexistent identifiers produce non-disclosing outward behavior, including indirect redirects and cache responses.
  4. Every rejected cross-tenant write leaves accepted project revision, provenance and research data unchanged.
  5. Public exports contain only approved fields, with a documented rights and publication decision.
  6. Revoked membership is tested under fresh and preexisting sessions, download links, queued jobs and cached content.
  7. Deployment commit, migration, settings, test fixtures, request receipts, structured audit verification, backup and rollback exercise are attached.
  8. Independent reviewer signs off against the exact deployed image and route inventory.

Current conclusion: source inspection plus isolated demonstration tests are insufficient to pass these live release gates.

23. Failure triage, rollback and incident handling

If a synthetic test shows an unauthorized read, treat the affected endpoint as release-blocked. Do not try to fix confidentiality by deleting research or silently rewriting history. Disable the unsafe route/export job, preserve immutable evidence, isolate any generated artifacts, investigate logs for disclosures, and follow the incident-response and notification process applicable to actual data.

Roll back application and policy changes through an approved plan. A database restore must be validated against retained research revisions, audit retention obligations and current access grants; a restored snapshot must not reinstate revoked memberships or unsafe public visibility.

24. Acceptance receipt and reproducibility

A reviewable receipt should bind the run to repositoryCommit, deployment image digest, enforcementMode, migrations, synthetic organization and project IDs, expected and actual status codes, sanitized response digests, accepted project revisions before/after, public-field disclosure check, and reviewer decision.

{
  "schema": "sc-kb-tenant-isolation-acceptance/1.0",
  "environment": "isolated-staging",
  "sourceCommit": "59b8444365525a58fd4f6a7e29a20d712769e1a2",
  "deployedImageDigest": null,
  "verifiedIdentityBoundary": false,
  "organizationMembershipEnforced": false,
  "crossTenantNonDisclosure": "not-yet-tested-live",
  "foreignMutationPreservesRevision": "not-yet-tested-live",
  "publicProjectionApproved": false,
  "result": "PENDING"
}

The above is a documentation example, not an actual deployment receipt. Do not substitute synthetic test success for populated live fields.

25. Implementation anchors and technical references

Code examined: 59b8444365525a58fd4f6a7e29a20d712769e1a2. Deployed version: not independently verified. Independent security review: pending. This article is an application and verification guide, not a certification of current tenant isolation.

Scroll to Top