Keep production data and credentials out of prompts
What you should never paste into an AI tool, and how to get help without leaking anything.
A prompt can leave your control. Whatever you paste may be logged, retained, or used to train a model depending on the tool and its terms. That makes some inputs simply off limits for a database session.
Never paste:
- Real customer records: names, emails, addresses, account numbers, anything that identifies a person.
- Credentials: connection strings, passwords, API keys, tokens. A connection string alone can hand someone your database.
- Regulated or confidential data you are contractually bound to protect.
You almost never need any of it. AI writes SQL from structure, not from live rows. Give it what it needs and nothing more:
- Share the schema: table names, column names, types, and relationships. That is what drives a correct query.
- Replace real values with placeholders. Use a bind parameter or a made-up sample like 12345 instead of a real identifier.
- Describe the data shape in words: approximate row counts, value ranges, whether a column allows nulls.
If you must show sample rows, use a handful of synthetic ones you invented, never a copy of production.
A safer setup matters too. Prefer a tool your organization has approved and that carries the right data terms over a personal account with unknown retention. Know which data classes you handle and match the tool to the class.
Here is my table schema and column types. Write the query using placeholders for any values. I will fill in real values myself when I run it.
Take a query you would want help with. Produce a shareable version: keep the schema, strip every real value and credential, and swap in placeholders or synthetic samples. That stripped version is what goes into the prompt.
Enjoying the free lessons? Get an email when we publish new courses and updates — no spam, unsubscribe anytime.
Discussion (0)
Ask a question or share what worked for you. Comments are reviewed before they appear.
No comments yet. Be the first to start the discussion!