Security, Trust & Platform

Multi-tenant enterprise infrastructure —
from the ground up, not bolted on.

Account-based tenancy as the isolation boundary, separated platform and customer RBAC, Clerk-managed identity with MFA, SOC2-ready immutable audit logging on every mutating action, a governed data pipeline that refuses to fabricate a number when its source isn't wired, and a scoped partner API.

1
shared data layer · every query scoped by accountId
100%
of mutating actions write an immutable audit entry
60+
platform datasets · each with an explicit status

The problem

"Where's the isolation boundary? And are you making up the duty rates?"

"Every trade-compliance tool we've evaluated is a single-tenant app someone bolted a login onto."

Tenancy

"Who at the vendor can see our data? Can their support team just look? We need an immutable audit trail for SOC2 and CBP."

Access & audit

"Half these 'AI trade platforms' are making up sanctions data and duty rates. How do we know your numbers are real?"

Data integrity

How Qubere addresses it

The boundary is enforced in the data layer. The datasets are published.

  • One shared @qubere/db layer — every business query goes through it with accountId scoping.
  • Platform roles for Qubere internal ops are a separate system from customer account roles. Impersonation is banner'd and logged.
  • Every mutating action writes an immutable audit entry — best-effort, so a logging failure never blocks the action it records.
  • Zero-Fabrication Policy: un-wired datasets return HTTP 422 and never fake success. Legally-binding data (tariff rates) has a human publish gate.
  • Scoped partner API — per-scope, idempotent, audit-tagged source: "API".

Tenancy, RBAC & row-level security

Account is the boundary — and it's enforced in the query layer.

Not a view filter, not a middleware afterthought. Auth (identity, MFA, sessions) is Clerk; authorization (roles, permissions) is in Postgres. Within an account, a staff-tier user sees only the clients they are assigned to — and the AI assistant inherits that because it's the same code path.

  • Roles are (scope, tier, products) tuples: core roles such as ACCOUNT_ADMIN, ACCOUNT_MANAGER, ACCOUNT_STAFF and ACCOUNT_VIEWER, plus custom customer-defined roles; legacy role names still resolve
  • API routes enforce capabilities via hasPermission() → 403
  • Every admin surface enforces real RBAC with no environment-variable bypass — permission checks come from the platform role catalogue, not a caller-supplied flag
  • Tenant-scoped requests fail closed: an unresolved or empty client/account scope returns nothing, never another tenant's data
How to demo
Log in as sarah@target.com (staff tier) vs admin@target.com — same Shipments page, different rows. Then Permissions (Account Admin) — the permission matrix.
Admin/Permissions
JT
Joe · Target
PermissionACCOUNT_ADMINACCOUNT_MANAGERACCOUNT_STAFFACCOUNT_VIEWER
filings.submit✓✓——
decisions.approve✓✓own—
documents.create✓✓✓—
compliance.override✓———
shipments.readallallassigned onlyall
Clerk: identity + MFAPostgres: authzwithAuthenticatedRoute guards

SOC2-ready immutable audit log

It can't be turned off, and it can't block your work.

Every administrative and mutating action writes an AuditLog entry: accountId, userId, action, entity, metadata, IP, user-agent, request-id, success/failure. Best-effort write path — a logging failure never blocks or rolls back the action. Shared by every module against a ~104-entry catalogue.

  • Explicitly designed against CBP 19 U.S.C. § 1509 recordkeeping
  • Compliance events also queue durable outbox notifications
How to demo
Security Management → the audit log, and Settings & Audit for settings changes. Every compliance module's Audit History tab. Show IP / user-agent / request-id on an entry.
Admin/Settings & Audit
JT
Joe · Target
TimeActionActorIPOK
14:02:11ROLE_ASSIGNEDjoe@target.com72.14.x.x✓
13:41:07FILING_TRANSMITTEDs.chen@target.com72.14.x.x✓
11:22:03USER_INVITEDjoe@target.com72.14.x.x✓
09:15:40ACCOUNT_SETTING_CHANGEDjoe@target.com72.14.x.x✓
request-id on every row · joins to the compliance-module audit histories

Zero-Fabrication data pipeline

We publish which datasets are real — in the admin console.

60+ reference datasets, each with an explicit LIVE or NOT_YET_IMPLEMENTED status. Un-wired datasets return HTTP 422 and never fake success. A new HTS revision is staged DRAFT and never auto-published — duty rates feed real filings, so a person publishes. One daily dispatcher fans out to all LIVE datasets by their own cadence; staleness fires alerts.

  • OFAC's ~20k-entry SDN list streamed via a durable job to avoid timeouts
  • Every AI run records which model actually ran
How to demo
Platform Admin → datasets registry. Walk the LIVE vs NOT_YET_IMPLEMENTED matrix. "Most competitors won't tell you what they've actually wired."
Platform Admin/Datasets
PA
Platform Admin
DatasetStateSourceLast success
HTSUS ScheduleLIVEhts.usitc.gov08:04 · staged DRAFT
OFAC SDN + non-SDNLIVEtreasury (Inngest job)02:11
BIS Consolidated ScreeningLIVEdata.trade.gov02:14
USITC AD/CVD OrdersNOT_YET_IMPLEMENTED—422 on request
GSP Eligible Products ListNOT_YET_IMPLEMENTED—422 on request
Un-wired = HTTP 422, never a fake 200 · legally-binding data = human publish gate

Partner API & Platform Admin Console

Scoped, keyed, logged — not a screen-scrape.

/api/v1/* routes authenticated by API key (Bearer / X-Api-Key), per-scope, idempotent, every action audit-logged source: "API". Screening, classification, HTS, products, parties, regulatory, rulings, trade agreements, batch.

  • Platform Admin Console: accounts, cron control, datasets, deployments, API catalog
  • Environment fail-safes: demo seeding always blocked in production
  • Every app sends hardened response headers (frame-ancestors, base-uri, object-src, nosniff, referrer policy, HSTS) and no longer advertises Next.js; a deliberately partial CSP, not a full one
  • Admin-controlled AI model pinning per account, client, or user — durable precedence resolution, not a hardcoded default
How to demo
Access Management → the API key panel and scopes. Then admin@qubere.ai → /platform-admin → /api/health shows blockers explicitly when misconfigured.
Admin/Integrations & APIs
JT
Joe · Target
acme-prod-01qk_live_…4c1a
Scopesscreening.read screening.screen hts.read
Last used3m ago · 1,204 calls today
/api/health
customs transmission providerMockAceProvider — filer credentials not set
tenant isolationOK
demo seedingblocked (production)

For the security review

The questionnaire, pre-answered.

Tenant isolation: one shared data layer, accountId-scoped; portal + billing isolation have automated regression tests.
Identity: Clerk (MFA, sessions); authorization in Postgres.
Audit: immutable, IP/UA/request-id, best-effort (never blocks).
Vendor access: separate platform RBAC; impersonation banner'd + logged.
Data integrity: Zero-Fabrication; un-wired sources 422; tariff data human-published.
Hosting: Google Cloud (Cloud Run, Cloud SQL, GCS), Clerk, Google Document AI, Gemini — confirm regions from current infra doc.

Objection handling

Every hard question, answered directly.

"SOC2 report?"The architecture is SOC2-ready — immutable audit, RBAC, tenant isolation, least-privilege data access. Position readiness and the design; get the formal attestation status from sales ops, don't improvise it.
"Can we self-host / air-gap?"The apps are Next.js; the document worker runs as a long-lived process on any host. A fully air-gapped deployment isn't a packaged offering — scope it as an enterprise engagement.
"Data deletion / export on termination?"Bulk shipment/document export exists. A formal end-of-contract data-return/purge runbook is an enterprise contract item, not a self-serve button.

The close

"Account is the boundary, enforced in the data layer. We publish which datasets are real. The audit log can't be turned off."

Next step: send us your security questionnaire. We'll walk it line by line against the Platform Admin Console on a screen-share — and show you the dataset registry and the audit log live.

Full detail: docs/apps/customs/sales/security-trust-and-platform.md · README §1–6