EveryRole

Test credentials in CI: where test logins belong

Test credentials in CI belong in the pipeline’s masked variables, one pair per kind of user, typed by the job itself. Seven rules, and where they leak.

Test credentials in CI belong in one place: your pipeline’s secret variables, masked, one username and password per kind of user. The job reads them when it runs and types them into your login form itself. They don’t go in the repository, in the test files, in a committed .env, in the logs, or in anything sent to an AI model.

That sounds obvious, and people still relax it for test accounts, because “it’s only a test login”. On a staging app with made-up data, maybe. On production, a test account is an account, and an admin test login is the keys to the app.

Who sees a test password in CI. The value: the pipeline's secret store, the test job while it runs, and the app's sign-in page. Only the name: the repository, logs and reports, an AI model, and the testing service
Three places need the value. Everything else can work with its name.

Test credentials in CI: seven rules for where to store them

1. One account per kind of user, made for testing. Never a real person’s login, and never your own. Each with the least access that still lets its journeys run. We wrote the details in test accounts for each role.

2. In the pipeline’s secret store. Every CI system has one: secrets, masked variables, protected variables. Use the strictest setting it offers: masked in logs, available only to protected branches, and not handed to pull requests from forks. That last one matters on public repositories, where anyone can open a pull request that prints the environment.

3. Named by a convention. One pattern for every kind of user, so nobody invents a new name per test:

E2E_LOGIN_ADMIN_USERNAME
E2E_LOGIN_ADMIN_PASSWORD
E2E_LOGIN_VIEWER_USERNAME
E2E_LOGIN_VIEWER_PASSWORD

The test refers to “the admin login”. Only the job turns that into a value.

4. A missing variable stops everything, by name. If E2E_LOGIN_VIEWER_PASSWORD isn’t set, the job should say exactly that and run nothing. The alternative is a test that types an empty password, fails at login, and sends someone looking for a bug in the app.

5. Different values per environment. Staging and production test accounts don’t share a password. A staging secret has more readers and gets pasted into more chats.

6. A long random password, changed on a schedule and when people leave. A test account may have no second factor, because a test can’t answer a code on a phone. The password is the only guard, so make it a good one. Changing it should be a one-line job: update the app, update the variable.

7. Nothing the run leaves behind may hold it. This is the rule that gets broken without anyone deciding to.

Where secrets in CI for E2E tests leak

Masking helps with the obvious case: echo $PASSWORD prints stars. It only matches the exact string. The leaks we’d look for are the ones masking doesn’t see.

  • Traces and videos. A recording of the login page shows dots in the password field. The trace file beside it can hold the typed value, in the action log or in the request body. Those files are uploaded as artifacts that anyone with access to the repository can download.
  • Request logs. A test that logs “POST /login” with its body for debugging has written the password to the job output, in a form the mask may not match once it is encoded.
  • Reports. A failure message that includes “filled password with …” ends up in the test report, the pull request comment and the chat notification.
  • Debug mode. The flag someone turned on once to see the whole environment, and left on.
  • Prompts. If an AI agent writes or runs the tests, whatever the harness puts in its context goes to a model provider. A password in a page snapshot or an environment dump travels with it.

The check for all five is the same, and it takes a few minutes: run the suite once, download everything the run produced, and search it for the password. Logs, reports, traces, screenshots’ text, uploads. If the search finds it, you have found the leak before someone else did. Then change that password.

When an AI model is in the loop

Some E2E runs now have a model somewhere: finding its way through the app, or writing the steps. That is a new reader, and the rule for it is the one in the diagram: the model gets the name of a value, never the value.

In practice the model says “type the admin password into this field”, and the code around it, which holds the secret, does the typing. On the way out, every request to the model passes a filter that replaces any secret it finds with a placeholder. The filter is the safety net. The design is that the value was never in the model’s context to begin with.

If a tool can’t tell you which of these it does, assume it does neither.

What about a secrets manager?

For a small team the CI’s own secret store is enough. A separate vault earns its place when many pipelines need the same logins, or when you want every read of a secret recorded. The rules above don’t change: the job fetches the value at run time, uses it, and writes it nowhere.

The safest password is none: if your app can hand a test user a one-time sign-in link, there is nothing to store.

What we’d avoid is the half-step: an encrypted file in the repository with the key in a CI variable. It works, and it leaves an old copy of every past password in the history, readable by whoever gets the key later.

How EveryRole keeps test logins out of reach

EveryRole gives an app two choices for where its tests run.

EveryRole's "Where tests run" setting with two options. EveryRole's browsers: it keeps each kind of user's test login, encrypted. Your CI (GitLab or GitHub): your pipeline runs the tests in its own browser, EveryRole sends what to run and gets back only the results, and keeps no test login for the app
The setting in an app’s settings. With the second option, the logins never leave your pipeline.

With your CI, the logins live only in your pipeline’s masked variables, named by a convention like the one above: EVERYROLE_LOGIN_ADMIN_USERNAME, EVERYROLE_LOGIN_ADMIN_PASSWORD, and so on for each kind of user. Your job runs the tests in its own browser and types each login itself. EveryRole sends what to run and receives the results. When you choose this option it deletes every test login it had kept for that app, and keeps none while it is on. If a variable is missing, the job names it, fails, and runs nothing. The set-up is in the docs.

With EveryRole’s browsers, it keeps each kind of user’s test login encrypted and hands it only to the run that signs in.

Either way, AI models only ever see the name of a value, and every request to a model is filtered for secrets before it leaves. Our own test suite does the search from this post: it signs in to a real app with a real browser, run the way a pipeline job runs it, then checks that the password is in no model request, no job output and no report.

Keep reading

Deploys and CI

How to test a vibe-coded app before users do

How to test a vibe-coded app: from the outside, as each kind of user, on the running app. The agent says what changed, and something else has to prove it works.

7 min read

Deploys and CI

Testing in production, safely

Testing in production is safe under six rules: test accounts, never-click words, named test data, clean-up, no retry after a real send, a stop before money.

6 min read

Deploys and CI

E2E tests in CI without slowing every merge

Run E2E tests in CI as two sets. A few journeys block the merge, the full suite reports after it. How to choose the blocking set and keep it quick.

6 min read