What data must not be passed to AI tools?
Without explicit permission, personal data, secrets, client code and documentation, and NDA data are not passed to AI tools. Secrets are passwords, tokens, keys, cookies and the contents of .env. A request goes to a third-party provider's servers, and storage and training terms depend on the plan, so the company's permission decides. Logs are anonymised or replaced with synthetic data, and if there is no policy, security or a manager is asked.
QA Fundamentals · AI in testing
You want to analyse a production log in a chat assistant quickly. What must not stay in it?
A test on staging fails with a 500, and the log has a stack trace and a request dump. The quickest way is to paste it all into a chat assistant and ask "why?". But the dump contains a user's email, a card number and an Authorization header. After "Send" is pressed, this data is already outside the company's control. This lesson is about what happens to the data passed to AI, which categories must not be passed, and how to keep the assistant's benefit without the risk.
How it works and why. A request to AI is a transfer of text to a third-party service: it goes to the provider's servers, where it may be stored in logs, be accessible to support staff or, depending on the plan's terms, be used to improve models. The terms differ between plans: enterprise plans usually state that data is not used for training, while personal accounts may differ. So the rule is built not on guesses about a particular service but on the level of "what the company has allowed". Besides chat, data is passed indirectly too: a browser extension, an editor assistant that sees open files, an agent that reads a repository or .env.
What is not passed without direct permission:
- Personal data: names, emails, phones, card and account numbers, real database dumps.
- Secrets: passwords, tokens, API keys, private keys, cookies, the contents of
.envand configs. - Customer code, documentation and requirements, if the contract or policy does not allow a specific tool.
- Data under NDA and internal architecture details.
What goes into an AI request: a raw log and a masked one
A production log as is
An email, a card number, a token and a URL with an identifier go to an external service along with the question.
A masked fragment
The structure of the error stays, identifiers are replaced by labels. That is enough for the analysis.
Example: how to mask a log before a request. The goal: keep what shows the cause (the response code, the error text, the order of calls) and remove what identifies a person or gives access.
Before (made-up values):
POST /api/transfers user=olena.k@example.com
card=4111111111111111 Authorization: Bearer eyJhbGci...
-> 500 "balance check failed for account 8841-2210"
After:
POST /api/transfers user=<USER_1>
card=<CARD_MASKED> Authorization: <REDACTED>
-> 500 "balance check failed for account <ACCOUNT_1>"
The analysis did not suffer: the masked fragment shows that the balance check returns 500, which is enough to propose hypotheses. Replacing values with labels such as <USER_1> and <ACCOUNT_1> keeps the relations: the same user is marked the same way everywhere. Remember the hidden places: a HAR file contains headers and cookies, a screenshot may also show an email or a balance, and a database dump from a "test" environment is sometimes a copy of production. Re-read the whole fragment before sending, not just the top.
Limits and alternatives. Masking is not perfect: a combination of rare fields or a unique error text can identify a person or a system, and a secret can be left in by accident. It is more reliable to have no real data in the request at all: use synthetic data, a minimal reproducible example, or just the structure of a response without values. Alternatives to an external service: an enterprise plan with data guarantees, a tool inside the company perimeter, or a locally hosted model. The company decides this, not an individual QA. If there is no policy or it is unclear, the right move is to ask (security or a manager), not to assume "probably fine". In fintech and healthcare the requirements are stricter because of regulation of personal and payment data, and a breach has legal consequences.
Common mistakes.
- A personal account for work data: no contract terms and no company control.
- "It is only test data": staging sometimes holds copies of production, and you may not know that.
- Dropping a whole HAR or
.envinto a chat for speed: they hold tokens and cookies. - A screenshot with a mailbox or an admin tab open: data is visible outside the focus.
- Masking part of the data and forgetting headers or a URL with an identifier.
Check yourself
You need AI to help write SQL for checking balances. What can you pass for that without risking data?
Answer
The table schema (column names and types), a description of the rule and a few made-up rows. Real customers and amounts are not needed: the structure is enough for the model to compose the query, and you run the result yourself on your own data.
Your team has no policy on AI at all. A colleague suggests just pasting logs into a public chat "because it is faster". What do you do?
Answer
I do not pass real data until the rules are clear: I ask a manager or security which tool and plan are allowed. Meanwhile I use masked or synthetic examples. Speed does not justify a leak.