l0l1.skelfresearch
A Skelf Research project · Open source (MIT)

SQL that learns.
AI that validates.
Privacy that protects.

l0l1 is an open-source co-pilot that sits between whoever wrote the SQL — a person, ChatGPT, or an internal tool — and your warehouse. It validates queries against your live schema, detects PII before it leaves the room, and learns your team's approved patterns.

~/analytics
$ l0l1 check-pii "SELECT ssn, email FROM customers"
  Found: US_SSN, EMAIL_ADDRESS
  Anonymized: SELECT <US_SSN>, <EMAIL_ADDRESS> FROM customers

$ l0l1 validate "SELECT * FROM orders WHERE created > NOW() - INTERVAL 7 DAY"
  ok   schema:  orders(id, user_id, total, created)
  warn SELECT * pulls every column; name the columns you use

$ l0l1 complete "SELECT user_id, sum(total) FROM orders WHERE"
  Suggestions drawn from your workspace's approved patterns…

What is l0l1?

A validation layer for LLM-assisted SQL

l0l1 is an open-source developer toolkit that treats LLM-generated SQL as a draft to be reviewed, not a finished answer. The premise: LLM SQL is often mostly correct — locally plausible but silently wrong against your real schema and semantics — and that deserves a first-class validation layer. l0l1 checks queries against live schema, scans prompts and query text for PII, and learns the query shapes your team already trusts.

What l0l1 is

  • A deterministic-plus-LLM reviewer between the SQL author and the warehouse
  • Schema-aware: it reads the actual columns and relationships of your database
  • A PII scanner (Presidio + regex) that runs before text leaves the local process
  • A per-workspace learning loop grounded in your own approved queries

What l0l1 is not

  • Not a text-to-SQL system. It validates SQL; it does not insist on writing it.
  • No differential privacy or homomorphic encryption — result rows are exact.
  • Not local-only by default: if you configure OpenAI or Anthropic, query text and schema context go to that provider.
  • Not a compliance product. PII detection is best-effort, not a legal guarantee.

The problem

LLM help on SQL is useful — and quietly risky

l0l1 does not try to replace the LLM. It makes the SQL it produces safer to ship.

🎯

LLM SQL is “mostly correct”

Problem

A model returns confident SQL that looks right, gets a “ship it,” and silently returns wrong numbers for a week — a wrong join key, a column that does not exist, a filter that reads plausibly but means something else.

How l0l1 helps

l0l1 validates against your live schema before a query runs. Real columns, real relationships, and an LLM reviewer that reasons about intent — so “mostly correct” gets caught, not shipped.

LLM-assisted SQL review →
🛡️

Prompts leak PII to providers

Problem

To get help on a query, people paste real table data, sample rows, and identifiers into a chat window. That content crosses a boundary to a model provider you do not control.

How l0l1 helps

l0l1 scans prompts and query text with Microsoft Presidio plus regex for SSNs, emails, phones, and card numbers, and anonymizes detected literals before anything is stored or forwarded.

PII-safe analytics →
🔁

Every analyst reinvents the same query

Problem

Good, verified SQL lives in someone’s notebook history or a buried Slack thread. The next person asks an LLM from scratch and reintroduces the same mistakes.

How l0l1 helps

l0l1 records successful queries as sanitized shape patterns per workspace and surfaces them as completions — so approved SQL becomes a shared, growing library, not tribal knowledge.

Team query patterns →
🧭

Where does the risk actually live?

Problem

It is hard to reason about a copilot that can see your warehouse. What crosses to the model? What touches the database? What lands in a stored result?

How l0l1 helps

l0l1 is built around four explicit boundaries — user-to-tool, tool-to-model-provider, tool-to-warehouse, and warehouse-to-output — and applies detection and anonymization at each one.

The four boundaries →

In practice

Validate before you execute

Drop l0l1 in as a checkpoint between the model and the warehouse — via the Python library, CLI, REST API, notebook magic, or the editor.

Paste-and-pray
# Paste model output straight into the warehouse
sql = llm.ask("top customers by revenue this quarter")

# Looks right. Ships. Runs.
db.execute(sql)
# -> joins on customer.id = orders.customer
#    but the column is orders.customer_id
# silently wrong numbers for a week
Reviewed with l0l1
# Route the same SQL through l0l1 first
from l0l1 import validate, scan_pii

sql = llm.ask("top customers by revenue this quarter")

# 1. strip PII before it leaves the process
clean = scan_pii(sql).anonymized

# 2. validate against the LIVE schema
report = validate(clean, connection="warehouse")

if report.ok:
    db.execute(sql)       # columns + joins verified
else:
    print(report.issues)  # caught before it ran

Capabilities

Validate. Protect. Learn. Integrate.

Four jobs, one layer between your SQL and your warehouse.

Surfaces & connectors

Meet SQL where it is written

The same validation, PII scanning, and pattern learning across four interfaces and four databases.

C
CLI Typer-based local checks Python
R
REST API FastAPI server for pipelines HTTP
J
Jupyter magic Inline notebook feedback Python
V
VS Code / LSP Editor-native validation LSP
P
PostgreSQL Schema-aware connector SQL
M
MySQL Schema-aware connector SQL
S
SQLite Schema-aware connector SQL
D
DuckDB Schema-aware connector SQL
4
databases supported
PostgreSQL · MySQL · SQLite · DuckDB
4
interfaces
CLI · REST API · Jupyter · VS Code/LSP
4
trust boundaries
user · provider · warehouse · output
MIT
licensed
open source, self-hosted

Put a reviewer between your SQL and your warehouse

l0l1 is open source (MIT) and self-hosted. Install it, point it at your database, and start validating — before raw rows leave the room.