- Docs
- Resources
- Data Source
- Secrets and credentials
Secrets and credentials
A password typed into a test step is visible to everyone who opens the test. Keep every secret in an encrypted key or in a connection, and let steps reference it.
In short
On this page you can
- Store a password, token or API key as an encrypted key.
- Keep database and Kafka passwords in their connection, never in a step.
- Replace a secret without seeing the old one.
- Show an encrypted value again if you created it.
- Rely on runs to mask encrypted values in logs and reports.
How to use it
- Create a key and leave Value comes from on Typed value.
- Switch on Encrypt, type the secret and click Save.
- In the step, use {{ds:yourKey}} instead of the secret.
- To change it later, type the new value and save; leave the field empty to keep it.
- Check the run log: the value shows as ••••••.
Where secrets belong#
| Secret | Put it in | The step uses |
|---|---|---|
| Test user password typed into a login form | An encrypted key, for example adminPassword | {{ds:adminPassword}} as the Type value |
| API token or API key | An encrypted key, for example apiToken | {{ds:apiToken}} in the Bearer token or a header |
| Database password | The DB connection | The connection, picked by name |
| Kafka SASL password | The Kafka connection | The connection, picked by name |
| Test mailbox password | The email integration under Integrations | The Mail step’s mailbox |
Never type a secret into a step
Step values are stored with the test case and shown to every project member who opens it. A reference such as {{ds:adminPassword}} carries none of that risk. The same goes for a token typed into a saved request on the API Requests page: anyone who opens the request can read it.
Encrypt a value#
Open or create the key
In Variables, click New key or open an existing key. Value comes from must be Typed value: a dataset or database value cannot be encrypted.
Switch on Encrypt
Click Encrypt next to the value. The hint says “Store the value encrypted: it is never shown again and only the test run reads it.”
Type the secret
The field hides what you type. If the key already had a plain value, you can leave it: on save, that value is encrypted.
Save
The field now shows “•••••• (set, encrypted)” and “Encrypted. Leave it empty to keep the current value; type a new one to replace it.” In the list the key’s kind is Encrypted and its value “•••••••• set”.
Replace or remove a secret#
- Replace: type the new value and save. Anyone who can edit keys can replace a secret without seeing the old one.
- Keep: leave the field empty and save; the stored secret stays.
- Switch Encrypt off: the old secret is never shown, so the field is empty. Type the new plain value before you save; saving an empty field leaves the key without a value and the secret is gone.
- Copy: copying an encrypted key gives a plain key without a value. Type the secret again and switch on Encrypt.
Who can see an encrypted value#
| Where | What appears |
|---|---|
| The key list | “•••••••• set”, or “no value”. Also for its creator. |
| The key panel, for the creator | An eye icon: “Show the value (only you, its creator, can)”. Click again to hide it. |
| The key panel, for anyone else, Admins included | Only “•••••• (set, encrypted)”. No eye icon. They can replace the value. |
| Test runs | The runner receives the real value and uses it in the step. |
| Live log, run report, API request log | •••••• |
| Send previews on the screen | •••••• is sent in place of the value. Check secured calls with a Dry Run. |
| The AI (App Map, generation) | Key names and “encrypted”, never the value. |
| AI assistants through MCP | Never the value. They cannot write one either; see AI assistants. |
On the server, encrypted keys and connection passwords are stored with AES-256-GCM.
Secrets in runs#
Before a run writes a log line, a report entry or a live message, it replaces every known secret with ••••••:
- the value of every encrypted key read during the run;
- the Authorization, token and API key headers of API steps;
- text typed into a password field.
In the report’s list of variables, values whose name looks like a password or token (password, token, secret, api key, bearer, cookie and similar), Authorization values and copies of encrypted values are shown as ••••••. Values shorter than 3 characters are not masked, so do not use very short test passwords.
Masking hides values, not screenshots
A screenshot of a page that displays a secret still shows it. Do not make tests open pages that print passwords or tokens in clear text.
Connection passwords#
- DB and Kafka passwords are required when you create a connection and stored encrypted.
- They are never sent back to the screen. The field stays empty when you open the connection; leave it empty to keep the password.
- Test Connection on a database reads the stored password on the server. A failure message masks it (
password=***). - The runner receives the password with the run that needs it, and masks it like any other secret.
AI assistants (MCP)#
An assistant connected through the SmartestQA MCP server follows fixed rules:
- It never asks you for a password and never writes one. When a test needs a credential, it creates the key empty (encrypted for secrets) and asks you to fill it in SmartestQA.
- Requests it adds to the API library carry tokens and passwords only as
{{ds:key}}references. - It reads connections with their credentials masked, and can test them.
More in FAQ › MCP.
Checklist#
Do
- One encrypted key per secret, with a Description.
- Dedicated test users and a dedicated test mailbox.
- Least-privilege database users.
- Rotate a secret by typing the new value and saving.
Don’t
- Passwords in step values, datasets, descriptions or URLs.
- Literal tokens in saved API requests.
- Real people’s logins or inboxes.
- Switching Encrypt off without a new value.
Didn’t find your answer?Write to support with your project name and what you see on screen.
info@smartestqa.ai