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.
$ 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.
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.
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.
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.
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 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 # 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.
Validate
Treat LLM-generated SQL as a draft and check it against your real schema before it runs.
Schema-aware validation
Every query is checked against the live schema of the connected database — real columns, real relationships. Catches SQL that is locally plausible but silently wrong against your actual tables.
Learn more →AI reviewer, not author
l0l1 treats LLM output as a draft to be reviewed. Validation runs through OpenAI or Anthropic (pluggable providers) to reason about intent and correctness before a query ships.
Learn more →Any SQL origin
It does not matter whether a human, ChatGPT in a browser tab, or an internal tool produced the SQL. l0l1 sits at the boundary and validates whatever is about to run.
Learn more →Protect
Detect and anonymize PII at the prompt and query boundary, before data leaves the room.
PII detection on prompts + queries
Microsoft Presidio plus additional regex rules scan for SSNs, emails, phone numbers, and credit card numbers in both prompts and query text before anything leaves the local process.
Learn more →Anonymize before forwarding
Detected PII literals are anonymized before queries are stored or forwarded to an external model provider — reducing what raw data crosses the tool-to-provider boundary.
Learn more →Boundary-aware design
l0l1 reasons about four boundaries — user-to-tool, tool-to-model-provider, tool-to-warehouse, and warehouse-to-output — and applies protection at each one.
Learn more →Learn
Grow a per-workspace library of approved query shapes and surface them as completions.
Per-workspace pattern learning
Successful queries are sanitized of literals and stored as shape patterns per workspace, then surfaced as completions for the next person — a learning loop grounded in your own approved SQL.
Learn more →Completions from approved shapes
Instead of inventing SQL, l0l1 suggests query shapes your team has already run and verified. The library grows with real usage, not synthetic examples.
Learn more →Integrate
Meet SQL where it is written: CLI, REST API, Jupyter, and the editor.
CLI + REST API
A Typer-based CLI for local checks and a FastAPI REST server for pipeline integration. Validate, scan for PII, and request completions from either surface.
Learn more →Jupyter magic
A notebook magic brings validation and PII scanning inline, so analysts get feedback in the same cell where they draft SQL.
Learn more →VS Code + LSP
A VS Code extension built on an LSP server surfaces validation and completions directly in the editor as you write SQL.
Learn more →Four database connectors
Connects to PostgreSQL, MySQL, SQLite, and DuckDB. Schema introspection is cached so validation stays fast against large warehouses.
Learn more →Surfaces & connectors
Meet SQL where it is written
The same validation, PII scanning, and pattern learning across four interfaces and four databases.
From the blog
Notes on LLM-assisted SQL
Explore
Everything about l0l1, one click away
Dig into the capabilities, the architecture, the workflows, and the honest comparisons.
Features
Validate, protect, learn, and integrate — the four jobs l0l1 does between your SQL and your warehouse.
Explore →How it works
The four privacy boundaries and the six-step validation pipeline, from ingest to suggest.
Explore →Use cases
LLM-assisted SQL review, PII-safe analytics, notebook & IDE workflows, and shared team query patterns.
Explore →Quickstart
Install l0l1, configure a provider and database, then scan for PII, validate, and learn.
Explore →Compare
Honest side-by-sides with adjacent tools like Vanna.ai and DataHerald.
Explore →FAQ
What l0l1 is and is not, what data reaches providers, and the explicit non-claims.
Explore →Glossary
Key terms for LLM-assisted SQL: schema-aware validation, PII detection, pattern learning, and more.
Explore →About
Why l0l1 exists, its position in the stack, and the scope of what it claims.
Explore →Blog
Essays on validation, privacy boundaries, and why LLM-generated SQL is dangerously "mostly correct."
Explore →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.