Utilizing KaneAI Secrets Feature: A Step-by-Step Guide
KaneAI now supports the use of secret variables to enhance security and streamline functionality. This feature leverages HashiCorp Vault for secure management of sensitive information, ensuring robust protection for your data while maintaining ease of use. This guide outlines the process for creating, managing, and utilizing secret variables within KaneAI.
- In Web/App Agent, users will see list of all secrets created at user or org level for that user.
- A user role can create only user level secrets, while an admin can create user-level, org-level, or environment secrets.
- A user can delete their own secrets, but only an admin can delete org-level and environment secrets.
- Secret variables will be accessible in test steps, modules, and test cases.
Secret Scopes
Every secret has a scope, which decides who can use it and how you reference it in a test step.
| Scope | Who can use it | Reference |
|---|---|---|
| User | Only you | {{secrets.user.NAME}} |
| Organization | Everyone in your organization | {{secrets.org.NAME}} |
| Environment | Everyone in your organization, when a test runs in that environment | {{secrets.env.NAME}} |
Use an environment secret when a sensitive value, such as a password or an API token, is different in each environment. See Environment Secrets.
How to Create Secrets and use them in your tests?
You can create Secrets variables via:
- Test Manager
- Web/App Agent
Create Secrets via Test Manager
Step 1: Navigate to the Test Manager.
Step 2: Click on the settings icon > Secrets.
Step 3: Click on the Create new secret button.
Step 4: Provide the secret key and value, choose a Scope, and click on the Create Secret button.
Create Secrets via Web/App Agent
Step 1: Navigate to the "Write a Step" field where you typically write your test scenarios in plain English.
Step 2: To switch to Secrets mode, type the forward slash / or click on the + icon. You will see a Secret pop-up option appear.
Step 3: Provide the secret key and value and click on the Create Secret button.
How to use your Secrets?
Once created, you can now reference any secret variables in your test steps using double-curly braces syntax (e.g.,{{email}}).
To use a previously created variable in any subsequent step or test case, reference the variable using the same
{{syntax. This will list down all existing variables for this test.
Format:
Verifieduse the value of {{secrets.user.email}} in the email text field
<VerifiedTag value="Verified" />
How to Update your Secrets?
Step 1: Navigate to the Test Manager.
Step 2: Click on the settings icon > Secrets.
Step 3: Click on the pencil icon to update that respective secret value.
Step 4: Provide the secret value and click on the Update secret button.
How to Delete your Secrets?
Step 1: Navigate to the Test Manager.
Step 2: Click on the settings icon > Secrets.
Step 3: Click on the delete icon to update that respective secret value.
Step 4: Provide the secret value and click on the confirmation button.
Environment Secrets
An environment secret holds a separate, encrypted value for each environment, such as Dev, Stage, and Production. It works like an environment variable, but its value is encrypted and masked everywhere.
Use environment secrets for credentials that change between environments. In the following steps, all three values change when you run the test in a different environment, and the password is never shown:
Go to {{environment.url}}
Enter {{environment.username}} in the username field
Enter {{secrets.env.password}} in the password field
Environment secrets are available to everyone in your organization, and resolve only when a test runs in their environment.
Create an Environment Secret
You can create an environment secret from the environment's page or from the Secrets page.
From the environment's page:
- Open the Variables page and select the environment under Environments.
- Click Create new and choose Secret.
- Enter a Name and a Secret value. The Scope is already set to the environment you opened.
- Click Create secret.
From the Secrets page:
- Open Secrets on the Variables page and click Create new secret.
- Enter a Key and a Value.
- In Scope, select an environment from the Environments list.
- Click Create secret.
To use the same secret in several environments, create it with the same name in each one and give each its own value. A test that references {{secrets.env.password}} then gets the value for whichever environment it runs in.
View Environment Secrets
An environment's page lists its variables and secrets together. Use the type filter to show only variables or only secrets, or search by name. Secret values are always masked.
Environment secrets are listed only on their environment's page. The Secrets page lists user and organization secrets.
Use an Environment Secret
Reference an environment secret in a test step as {{secrets.env.NAME}}. Its value comes from the environment the test uses:
- Authoring: the environment you select for the authoring session.
- Test runs: the environment you choose when you run or schedule a test run, from the UI or through the API.
You don't edit test steps to switch environments. The same reference resolves to the value of the environment selected for the session or run.
Environment secrets follow the same rules as environment variables. For example, the session is locked to one environment, and a step fails if the secret isn't defined in that environment. See What changes in a session with a selected environment.
Edit or Delete an Environment Secret
To change an environment secret, open its environment's page, click the actions menu on the secret's row, and choose Edit.
- You can replace the value, but the current value is never shown.
- The name and scope cannot be changed. To move a secret to another environment, create it in that environment and delete the old one.
- The Use in tests field shows the secret's reference, which you can copy into a test step.
To remove an environment secret, choose Delete from the same menu.
Environment secrets are not supported when you author or replay tests locally with Kane CLI, which does not support environments yet.
Data Masking & Anonymization
TestMu AI protects sensitive data in tests through synthetic substitution and capture-time masking.
- AI Autofill (synthetic substitution) - generates realistic substitute values against your real dataset structure, so production values are replaced rather than encoded. No mapping between original and substituted values is retained, removing the re-identification vector.
- Secret variables (HashiCorp Vault) - values marked as secret are resolved at runtime from HashiCorp Vault and are never written to action logs, session logs, screenshots (known secret values are redacted from screenshot OCR before upload), video recordings, run summaries, or reports.
- Lambda Masking - hides sensitive data in recorded test commands and session recordings.
- SmartUI PII masking - masks PII regions in visual snapshots. Masking is enforced at capture time, not applied post-hoc, so masked data is never persisted in artifacts.