Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Securely manage passwords and sensitive data in your tests
.claude/skills/testdriverai-testdriver-secrets/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -1% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 81% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -10% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 25% | 0% |
<!-- Generated from secrets.mdx. DO NOT EDIT. -->
Protect sensitive information like passwords, API keys, and tokens in your TestDriver tests.
When typing sensitive information like passwords, use the secret: true option to prevent the value from being logged or stored:
javascriptimport { test } from 'vitest'; import { chrome } from 'testdriverai/presets'; test('login with secure password', async (context) => { const { testdriver } = await chrome(context, { url: 'https://myapp.com/login' }); await testdriver.find('email input').click(); await testdriver.type(process.env.TD_USERNAME); await testdriver.find('password input').click(); // Password is masked in logs and recordings await testdriver.type(process.env.TD_PASSWORD, { secret: true }); await testdriver.find('login button').click(); await testdriver.assert('dashboard is visible'); });
<Note> When secret: true is set, the typed text appears as **** in all logs, recordings, and dashcam output. </Note>
Store sensitive credentials as GitHub repository secrets so they're never exposed in your code:
<Steps> <Step title="Navigate to Repository Settings"> Go to your GitHub repository → Settings → Secrets and variables → Actions </Step> <Step title="Add Repository Secrets"> Click New repository secret and add your secrets:
TD_API_KEY - Your TestDriver API keyTD_USERNAME - Test account usernameTD_PASSWORD - Test account password</Step> <Step title="Use in GitHub Actions"> Reference secrets in your workflow file: yaml .github/workflows/test.yml
env: TD_API_KEY: ${{ secrets.TD_API_KEY }} TD_USERNAME: ${{ secrets.TD_USERNAME }} TD_PASSWORD: ${{ secrets.TD_PASSWORD }} run: vitest run </Step> </Steps>
For local development, store secrets in a .env file:
bash .envTD_API_KEY=your_api_key_here TD_USERNAME=testuser@example.com TD_PASSWORD=your_secure_password
<Warning> Never commit .env files to version control. Add .env to your .gitignore file. </Warning>
Here's a full login test with proper secrets handling:
javascript tests/login.test.jsimport { test, expect } from 'vitest'; import { chrome } from 'testdriverai/presets'; test('secure login flow', async (context) => { const { testdriver } = await chrome(context, { url: process.env.TD_WEBSITE || 'https://staging.myapp.com' }); // Enter username (not sensitive) await testdriver.find('email input').click(); await testdriver.type(process.env.TD_USERNAME); // Enter password securely await testdriver.find('password input').click(); await testdriver.type(process.env.TD_PASSWORD, { secret: true }); // Submit login await testdriver.find('login button').click(); // Verify successful login const loggedIn = await testdriver.assert('user is logged in'); expect(loggedIn).toBeTruthy(); });
<Card title="Secrets Best Practices" icon="shield-check">
secret: true when typing passwords, tokens, or sensitive data</Card>
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 12,004 | 7,839 | -35% | 1 | 1 | 0% | 2,128 | 2,112 | -1% | 0 | 0 | — |
case-02 | fail→pass | 18,192 | 3,749 | -79% | 1 | 1 | 0% | 914 | 1,657 | +81% | 0 | 0 | — |
case-03 | fail→pass | 13,850 | 6,072 | -56% | 1 | 1 | 0% | 2,271 | 2,137 | -6% | 0 | 0 | — |
case-04 | pass→pass | 13,026 | 2,405 | -82% | 1 | 1 | 0% | 2,105 | 1,349 | -36% | 0 | 0 | — |
case-05 | pass→pass | 5,485 | 1,953 | -64% | 1 | 1 | 0% | 725 | 1,240 | +71% | 0 | 0 | — |
case-06 | fail→pass | 24,726 | 3,097 | -87% | 1 | 1 | 0% | 1,708 | 1,538 | -10% | 0 | 0 | — |
case-07 | pass→pass | 3,897 | 3,328 | -15% | 1 | 1 | 0% | 594 | 1,317 | +122% | 0 | 0 | — |
case-08 | pass→pass | 5,455 | 2,725 | -50% | 1 | 1 | 0% | 920 | 1,275 | +39% | 0 | 0 | — |
case-09 | fail→pass | 6,601 | 2,822 | -57% | 1 | 1 | 0% | 1,155 | 1,447 | +25% | 0 | 0 | — |
case-10 | pass→pass | 8,521 | 4,950 | -42% | 1 | 1 | 0% | 1,373 | 1,645 | +20% | 0 | 0 | — |
case-11 | pass→pass | 10,215 | 3,531 | -65% | 1 | 1 | 0% | 1,662 | 1,426 | -14% | 0 | 0 | — |
case-12 | fail→pass | 10,645 | 4,653 | -56% | 1 | 1 | 0% | 2,391 | 1,953 | -18% | 0 | 0 | — |
case-13 | pass→pass | 2,995 | 1,987 | -34% | 1 | 1 | 0% | 469 | 1,263 | +169% | 0 | 0 | — |
case-14 | fail→pass | 10,722 | 1,699 | -84% | 1 | 1 | 0% | 1,814 | 1,173 | -35% | 0 | 0 | — |
case-15 | pass→pass | 7,566 | 2,479 | -67% | 1 | 1 | 0% | 1,146 | 1,218 | +6% | 0 | 0 | — |
case-16 | fail→pass | 9,194 | 1,995 | -78% | 1 | 1 | 0% | 1,455 | 1,275 | -12% | 0 | 0 | — |
case-17 | pass→pass | 3,841 | 2,014 | -48% | 1 | 1 | 0% | 732 | 1,246 | +70% | 0 | 0 | — |
case-18 | fail→pass | 10,958 | 4,399 | -60% | 1 | 1 | 0% | 1,936 | 1,591 | -18% | 0 | 0 | — |
case-19 | fail→pass | 6,326 | 1,659 | -74% | 1 | 1 | 0% | 887 | 1,183 | +33% | 0 | 0 | — |
case-20 | pass→fail | 6,871 | 3,857 | -44% | 1 | 1 | 0% | 941 | 1,515 | +61% | 0 | 0 | — |
case-21 | pass→fail | 3,359 | 3,521 | +5% | 1 | 1 | 0% | 557 | 1,604 | +188% | 0 | 0 | — |
case-22 | pass→pass | 10,590 | 7,690 | -27% | 1 | 1 | 0% | 1,637 | 2,098 | +28% | 0 | 0 | — |
case-23 | pass→pass | 6,285 | 5,847 | -7% | 1 | 1 | 0% | 1,159 | 1,779 | +53% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 22 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +35 percentage points is the difference between those two pass rates over the 22 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.