Secrets

Passwords, tokens and API keys go into secrets. Their values are encrypted on your computer and never written to flows, projects, logs, reports or exports, so a project can be shared, through git for example, without them.

Example flow

examples/Examples/19_secrets.clem.json sends the project's secret $demoKey in a header, in the query and through Auth → API key. httpbin.org echoes it back, the checks compare the echo with the real value, and the log shows ••••••. Adding the Examples project stores a demo value for it, encrypted like any other; change it in Secrets.

Adding a secret

  1. Click Secrets (the lock) in the title bar.

  2. Add Secret: a name such as $apiKey and its value. Tick A different value per environment to give dev and prod their own.

  3. Save, and use $apiKey anywhere a variable works: URLs, headers, bodies, Auth fields, conditionals and code.

The Secrets panel with a new secret, $apiKey, and the box for its value
The Secrets panel. Values are typed here and never shown anywhere else.

To turn an existing variable into a secret, click the lock on its row in Variables or Environments.

How they are kept

The lock's dot

Green: every secret this flow uses has a value for the selected environment. Red: something needs attention, such as a missing value, the same name also being a variable, or a computer that can't encrypt values. A run with a missing value doesn't start; the message says which.

In exported flows and CI

Exports never contain the values. Each secret the flow uses is read, in this order, from:

  1. an environment variable CLEM_<name>: CLEM_apiKey for $apiKey, or CLEM_apiKey__staging for staging only. This is how CI secrets reach a run;
  2. <project>.secrets.env next to the script, with KEY=value lines (or another file with --secrets).

Export writes <project>.secrets.env.example with the names to fill in. Tick Include secret values to write the filled-in file instead: plain text, for your own machine (a .gitignore line is added). --set $name=value works too. A run with a missing value stops with exit code 2 before it starts. A key in a --secrets file that the run doesn't use (a name without CLEM_, or a variable that isn't one of the flow's secrets) gets a warning that says why; the run goes on.

- run: node checkout.js --env staging --junit results.xml
  env:
    CLEM_apiKey: ${{ secrets.API_KEY }}
    CLEM_password: ${{ secrets.TEST_PASSWORD }}

AI clients (MCP) never see secret values either: runs use them, and results show ••••••.