Compliance as Architecture
Isolation and grounding built into the data layer from the first migration — provable in a security review, not asserted in a README.
Whatever your AI system outputs, a compliance team, an auditor, or a regulator will eventually read it — in fintech, healthcare, and proptech alike, a wrong figure or a document that crosses a tenant boundary isn't a bug ticket, it's an incident report. A chatbot that impresses in a demo and can't explain how it reached an answer doesn't survive that scrutiny.
Most AI vendors can show you confidence. Very few can show you proof: that one customer's data structurally cannot reach another's, that a hallucinated number gets caught before a user ever sees it, and that every decision behind the system is written down somewhere your own reviewer can find.
The architecture, not the pitch
Every practice below is our own engineering discipline — applied on every engagement, describable without reference to any client, and provable in a technical review rather than taken on faith.
Tenant isolation enforced at the data layer
Postgres row-level security keyed to a per-transaction session variable with a nullif bleed-guard: an unset variable reads back NULL and matches no rows, so a bug fails to an empty result, never to another tenant's data. The application role is LOGIN NOBYPASSRLS and does not own the tables it queries.
Grounded output, checked the same way in CI as in production
Every number and rule state in a model's response is checked against what the deterministic engine actually produced; anything ungrounded is rejected and replaced with deterministic copy. The CI fixture eval imports the same primitives as the runtime guard, so the check and the guard cannot quietly drift apart.
Data residency as a provider swap, not a rewrite
Every model call routes through one provider-agnostic layer. When a GDPR or EU data-residency requirement dictates a specific region or vendor mid-engagement, changing providers is an environment variable, not a re-architecture.
An audit trail your reviewer can actually check
Every departure from the agreed spec is a numbered ADR citing the exact clause it deviates from and the sign-off that approved it. Isolation tests carry positive controls, so an empty result can never be mistaken for a broken query that happens to return nothing.
Start with a scoping call.
Tell the two architects who'd build it what you need, and they'll tell you plainly what it takes — no sales deck, no pressure to sign anything.