Docs / Guides

Keep personal data out of AI prompts

Updated

AI can help with your database without your customers' personal data ever reaching the model. SayQL gives the AI your schema and the numbers it needs, and keeps chosen columns out entirely.

What the AI sees by default

When you ask in SayQL's Ask box, the AI gets your question and your table and column names, not your rows. AI apps such as Claude Code and Cursor get counts and summaries of query results by default: a row count and, per column, its type, nulls and distinct values. No row values.

Three levels of protection

  1. Counts, not rows. Per connection, choose what AI apps see of results: nothing, counts and summaries, masked rows, or all rows. Investigate, SayQL's multi-step mode, has its own setting: nothing (the default), counts and summaries, or up to 20 masked rows, and can ask you before each send.
  2. Masked rows. When rows help, Rows, masked replaces likely personal data (emails, phones, names, IDs) with tokens such as ‹email-1›. It's best effort: a free-text column can hold anything.
  3. Never send. The firm line. Mark a column, such as customers.email or patients.ssn, and any query that could read it in any form is refused before it runs, at every level, for AI apps and Investigate alike. Its comments and allowed values are left out of the schema too.

Skills for the Ask box

Skills such as /pii-safe tell the AI to keep contact details out of the SQL it writes. See Ask in plain English.

Errors can quote values too

A database error can include a value from your data. Below All rows, AI apps get a fixed description of the error instead of the database's message.

For a company

On the self-hosted SayQL server, never-send columns are withheld on the server for every person and agent, and every query is in one audit log. Your data stays on your network.

More: Privacy and data, What AI apps may see, and how other tools handle this.

Something missing or unclear? Ask in Discussions.