Lex-Privacy AI — Privacy & LGPD Compliance Platform
Lex-Privacy AI is a SaaS platform for personal data governance and LGPD compliance that combines, in a single system, a secure read-only gateway to the client's databases and a lineage and catalog platform that shows where each personal data record lives, where it came from, where it flows and how risky it is.
The problem it solves
Companies know they process personal data, but rarely know where it is. Answering a data subject request or an LGPD audit usually means manual digging across dozens of databases and hundreds of tables.
- Where is the personal data? Discovery of CPF, email, phone and other attributes across 28+ databases and 1,200+ tables — without touching business data.
- Data subject requests and audits: a CPF/email search traverses the foreign-key graph and returns every occurrence, with an auditable history and signed reports (SHA-256 hash).
- Impact analysis: before changing a table, column or process, it shows upstream and downstream dependencies.
- Risk and exposure: a heat map with a versioned score based on sensitivity, exposure, propagation, usage and missing controls.
Architecture
A modular monolith: FastAPI (Python 3.12) on the backend and React 19 + TypeScript + Vite on the frontend. Metadata lives in SQLite/PostgreSQL and credentials are encrypted with AES-256 (Fernet). Client sources are reached over a WireGuard + TLS tunnel, with a read-only gateway enforced at the protocol level.
Main modules
- Catalog: sources, schemas, tables and columns, with connection status and coverage.
- AI Catalog Builder: an interactive canvas (
@xyflow/react) where the manager provides sources and purpose; the AI proposes categories and classifies columns, with a preview before publishing. - Lineage: dependency graph and data origin per field.
- Heat Map: risk × source × domain matrix, with drill-down.
- Scans: asynchronous, resumable scans with progress and retry/backoff.
- LGPD / PII: deterministic classification + sampling + AI, DPO review and taxonomy versioning.
- Chat / autonomous agent: an LLM (Qwen via vLLM) that decides between answering or querying the database, with document RAG (pgvector + OCR).
- Reports: PDF/CSV/JSON with masking, electronic signature and export auditing.
- External API per catalog: a per-API token (
lpai_cat_) for read-only access by third parties under the catalog rules. - Multi-tenant: head-office/branch hierarchy with isolation, catalog grants and scope by active unit.
Engineering differentiators
- "Absence of evidence is never evidence of absence": a timeout or missing permission yields partial/inconclusive coverage, never "it does not exist".
- Explicit evidence and confidence: observed, confirmed, declared and inferred relationships are never mixed; inference is never presented as fact.
- Economical, guarded AI: a multi-pass pipeline (deterministic → sampling → AI only on ambiguous cases); AI-generated SQL runs only through the validated read-only path, with LIMIT and timeout.
- No regression:
/api/v1,/searchand the legacy dashboard are preserved; new work is additive via/api/v2.
AI-assisted development
About 90% of the development was done with AI assistance — architecture, code, tests, documentation and refactoring — with human review and decisions at every step. It is a practical study of how AI accelerates the delivery of a complex product without giving up engineering rigor.
In short: it turns technical read-only access to corporate databases into a platform for visibility, classification and proof of LGPD compliance.