Build a
governed enterprise
AI platform — RAG with audit
Ship a multi-tenant RAG platform with Postgres RLS isolation, Presidio PII redaction, prompt-injection + jailbreak guardrails, a Redis-backed policy engine, per-tenant token cost tracking, and 5 committed ADRs. Module 01 unlocks with PRO; the platform unlocks with EXPERT.
The governance system-design portfolio piece for staff AI roles — 5 committed ADRs, a Presidio + RLS reference build, a runnable cost model, and an on-call runbook you can defend in an architecture review.
- Per-tenant /v1/chat with JWT auth and Postgres RLS isolation on pgvector
- Presidio PII redaction with an immutable audit log and GDPR data-deletion
- Lineage DAG in Redis + a policy engine + an agent approval queue
- Prompt-injection + jailbreak + output-filter guardrails with Prometheus alerts
- Per-tenant token cost tracker with daily projections + Grafana cost panel
- 5 ADRs (one Deprecated) committed alongside the code, plus a real cost-model CSV
Module 01 unlocks with PRO. The full platform with EXPERT.
Module 01 (~5h) ships a working multi-tenant RAG service with audit + Presidio — included with PRO. Modules 02-04 (~15h additional) layer on the lineage / safety / multi-tenant scale story and unlock with EXPERT.
Foundation. Governance. Scale.
Each phase ends with a tagged release, a passing red-team suite, and an audit-log review. No ambiguity about where you are.
RAG + Compliance Core running locally. Per-tenant retrieval with permission levels, Presidio redaction, immutable audit log.
- ✓Working /v1/chat per tenant
- ✓Presidio PII redaction middleware
- ✓Audit-log table with checksums
Lineage + policy + approvals + safety guardrails. Prompt injection / jailbreak / output filtering with Prometheus + Grafana + runbook.
- ✓Redis lineage DAG + policy engine
- ✓Agent approval queue with HITL gate
- ✓Red-team pytest suite + Grafana safety dashboard
Multi-tenant hardening. RLS, tenant RBAC, rate limiting, per-tenant cost tracker, OTel observability, leakage checker.
- ✓Postgres RLS + tenant context middleware
- ✓Per-tenant cost panel + daily projections
- ✓Cross-tenant leakage checker + OTel per-tenant spans
One command. Local FastAPI + Postgres + pgvector + Redis + Presidio.
What lives in the repo
You get the real platform on day one — FastAPI as the gateway, PostgreSQL + pgvector for retrieval, Redis for lineage / policy / approval queue / rate limit / cost, Presidio for PII detection, and Prometheus + Grafana for safety + cost dashboards.
- compose.{core,full}.yml — Postgres + pgvector, Redis, Prometheus, Grafana
- api/ + rag/ — FastAPI gateway + RBAC retriever + Anthropic Claude pipeline
- governance/ — lineage DAG, policy enforcer, secure agent executor
- safety/ — injection detector, jailbreak middleware, output filter
- auth/ + middleware/ + db/ — tenant context, tenant RBAC, Postgres RLS setup
- docs/adr/ + docs/cost-model/ — 5 ADRs (one Deprecated) + the runnable cost-model CSV
Enterprise AI Platform Starter Kit
Pre-built governed-RAG stack with seeded multi-tenant Postgres, Redis, Prometheus + Grafana, the red-team pytest suite. Now bundled: 5 committed ADR markdown files (docs/adr/) and the runnable cost-model CSV (docs/cost-model/) — unzip and read them straight from the repo.
The same RAG demo — but built for the regulated case.
Most AI tutorials show you a notebook hitting a vendor API. This shows what changes when 4 tenants share infrastructure, compliance owns the audit log, and finance asks for unit economics.
pgvector, role-based RBACRetrieverPresidio redaction at ingest + on output, with audit entries for every matchPolicyEnforcer; hot-reload without redeployWrite the ADRs staff engineers actually get judged on.
Five ADRs ship inside the starter-kit zip at docs/adr/, one per major decision in the build, including a real Deprecated ADR documenting the v1 → RLS migration. The kind of doc that travels with you to your next role. Preview ADR-001 →
Use Anthropic Claude API over self-hosted inference for v1
anthropic SDK; pipeline interface is one method callMulti-tenant isolation via Postgres RLS, not schema-per-tenant
tenant_id on every row + RLS POLICY tenant_isolation + session varPolicy engine is Python rules + Redis store, not OPA/Rego
PolicyEnforcer reads JSON rules from Redis; eq / in / gte ops onlyApproval queue is Redis with 24h TTL, not Temporal workflow
SETEX approval:{tenant_id}:{req_id} with 24h TTL; reviewer mutates statusSingle shared documents table for all tenants (v1)
tenant_id + RLS + composite indexesRead the FinOps story for the build you actually ship.
Module 04 ships a runnable cost-model CSV inside the starter-kit zip at docs/cost-model/. 4-tenant beta load, real Anthropic + AWS RDS + ElastiCache list prices, with model-cascade and reserved-instance levers wired up. The version you’ll defend to a CFO. Preview the CSV →
Optimization levers
Async architecture review with a staff-level reviewer (cohort beta).
Submit your repo, your ADR draft, or your safety-rule rollout plan. A staff or principal-level reviewer who has shipped this exact stack responds within 7 days with line-by-line comments. Cohort capped at 12 members.
Bring a diff, an ADR draft, or a runbook.
The cohort beta runs as async architecture review — pick a reviewer by topic, send the artifact, get inline comments + a Loom walkthrough back. No back-and-forth scheduling. No 30-minute slot pressure.
PRO unlocks Module 01. EXPERT unlocks the full platform.
PRO is the entry point — Module 01 plus the rest of the PRO catalog. EXPERT unlocks Modules 02-04 of this build, the 5 ADRs, the cost-model CSV, and the cohort-beta async review.
Pick this if you own the audit log, not just a feature.
Staff / principal engineers
You own the audit log, the safety pipeline, and the multi-tenant story your security team will pull apart in their next review.
Engineering managers · AI
You need a reference architecture for the governance + safety questions your CISO will ask before the AI team gets headcount approval.
Platform / infra leads
You absorb AI without absorbing 6 new vendors. RLS, Redis, Prometheus, Postgres — tools you already operate. This is the playbook.
Founding engineers · AI startups
Your investors will ask about compliance posture before they ask about scale. The 5 ADRs + cost model + audit log is the answer.
Going deeper? Four tracks back this project.
The Enterprise AI Infrastructure curriculum is the foundation. These four tracks let you go deeper on the parts that matter most for your role.
Quick answers.
Paired with this project
Ready to ship a governed AI platform?
Start with PRO ($29/mo) for Module 01 — RAG + Compliance Core. Or unlock the full 4-module platform plus 5 ADRs, the cost-model CSV, and cohort-beta architecture review with EXPERT ($79/mo).