Numling

Guides · Safe AI SQL Safe read-only AI SQL on any database with PII masking.

Ask any SQL database in plain English—read-only, with customer PII masked first.

Read-only transactions · Separate masking gateway · Never trains AI models

After Query Gateway · before model sees rowsPII replaced with pseudonyms
full_nameemailphonemrr
person_8f2amail_8f2a@maskphone_8f2a$149
person_3c91mail_3c91@maskphone_3c91$149
person_7d04mail_7d04@maskphone_7d04$49

Same person gets the same token across rows so COUNT(DISTINCT) and joins stay exact.

Click the 3 stages to inspect what leaves your database vs. what the LLM actually sees
Works the same way across:PostgresSupabaseNeonAWS RDSMySQLSnowflakeBigQueryRedshiftMongoDB

Defense in depth

Three boundaries between an LLM and production data.

Prompt instructions like “please don’t run DELETE” are not security. Safe AI SQL enforces read-only and PII boundaries outside the model—across every SQL database or warehouse you connect.

Layer 1 · Database role

Least-privilege reader

A dedicated DB user with SELECT only on chosen schemas (never internal auth or admin tables), enforced read-only sessions, and a query timeout.

Layer 2 · Query gateway

Guarded runner + PII masker

Every SQL string is parsed and checked before execution, run in a read-only session, and stripped of names, emails, phones and addresses before results reach the model.

Layer 3 · Workspace access

Row-level rules & audit log

Scope what each teammate can see by city, client or team, and keep a full audit trail of every sign-in and every query run.

Step by step

Set up safe AI SQL on your database in 5 minutes.

Pick your SQL provider below—this is the exact least-privilege setup Numling’s connect flow uses.

See all supported data sources →
  1. Create a hardened read-only user

    Grant SELECT only on the tables or schemas your team needs, lock the session to read-only, and add a timeout so an analytical scan never slows production.

    Postgres (RDS / Neon / self-hosted) · run once as admin
    create role numling_reader login password 'choose-a-long-password';
    alter role numling_reader set default_transaction_read_only = on;
    alter role numling_reader set statement_timeout = '30s';
    
    grant connect on database your_db to numling_reader;
    grant usage on schema public to numling_reader;
    grant select on all tables in schema public to numling_reader;
    alter default privileges in schema public
      grant select on tables to numling_reader;
  2. Connect with TLS (or via read replica / SSH bastion)

    Paste your connection string (or use Supabase’s pooler URI, Neon’s read-only branch, or a service account for BigQuery/Snowflake). For private VPCs, allow Numling’s fixed IP or connect through a forward-only SSH bastion.

  3. Confirm detected PII columns during the scan

    Quill scans table schemas and column summaries (never storing raw personal rows) and flags columns holding names, emails, phone numbers, or addresses. You can mark extra custom columns as masked in one click.

  4. Ask in plain English — inspect the SQL under every answer

    Founders and ops teams ask in Numling or Slack; engineers can expand the generated SQL under every answer to verify joins, filters and execution time.

Security checklist

What’s allowed, and what’s refused.

Every check enforced in code and at the database — not just in a system prompt.

SELECT & CTE queries Allowed
Read-only analytical queries run inside an explicit read-only transaction with a per-query timeout.
INSERT, UPDATE, DELETE, DDL Blocked
Refused by the query gateway parser before hitting your database, and blocked a second time by the database role permissions.
Private / auth schemas Blocked
Schemas not granted to numling_reader (such as Supabase’s auth.* or admin tables) stay completely unreadable.
Raw PII in LLM context Masked
Emails, phone numbers, names and street addresses are replaced with stable pseudonyms in the runner before the model sees output.
Model training on your data Never
Your schema, questions and masked query results are never used to train foundation models.
Doing it by hand: expose an anonymized SQL schema

If you want database-level PII redaction even before a query runner sees a column (or you’re wiring up your own text-to-SQL script), put sanitized views in a dedicated analytics_safe schema and grant the AI role access only to that schema.

Postgres / Supabase / RDS · anonymized analytics_safe schema with keyed SHA-256 pseudonyms
create extension if not exists pgcrypto;
create schema if not exists analytics_safe;

create or replace view analytics_safe.profiles as
select
  id,
  case when email is not null then encode(hmac(email, 'replace-with-random-secret-salt', 'sha256'), 'hex') end as email_hash,
  split_part(email, '@', 2) as email_domain,
  plan,
  country,
  created_at
from public.profiles;

revoke all on all tables in schema public from numling_reader;
alter default privileges in schema public
  revoke select on tables from numling_reader;
revoke all on schema public from numling_reader;
grant usage on schema analytics_safe to numling_reader;
grant select on all tables in schema analytics_safe to numling_reader;

FAQ

Questions engineers ask.

Is there an AI SQL tool safe for production Postgres or MySQL that masks emails and phone numbers?

Yes — Numling connects with a read-only database user across Postgres, MySQL, Supabase, Neon, RDS, Snowflake, BigQuery, Redshift and MongoDB, enforces read-only sessions and timeouts in a guarded query runner, and replaces personal data (names, emails, phones, addresses) with deterministic pseudonyms before any AI model sees query output.

How is this different from a cloud console’s built-in AI SQL editor (like Supabase or Neon)?

Built-in SQL editors are designed for developers working inside the database console with admin privileges. Numling is built for founders, ops, and product teammates to ask questions safely in plain English or Slack — read-only, with PII masked, saved metric definitions, scheduled reports, and anomaly alerts.

Does the read-only role respect Row Level Security (RLS) on Postgres and Supabase?

Yes. A newly created role without BYPASSRLS obeys RLS policies on tables where RLS is enabled, and only reads schemas and tables explicitly granted to it. You can also configure per-user row rules inside Numling.

Can we self-host or run the query runner inside our own VPC?

Yes. Self-hosting Numling in your own cloud is available today — email team@numling.app and we’ll set it up with you.

Ask your production database safely in ten minutes.

Read-only transactions, PII masked before the AI sees a row, on every database you connect.