Skip to content

Secrets

A secret is an API key or token your scripts use, such as the admin key that lets Support’s unlock-account script call your app’s admin API. Reminix keeps it so the code doesn’t have to.

  • Write-only. Once you save a value, nobody can see it again in the app, the API, the CLI or through an agent. To rotate it, save a new value.
  • Encrypted at rest. Reminix encrypts each value with a key for its workspace.
  • Sent only to its hosts. Each value lists the hosts Reminix may send it to, such as api.yourapp.com. Reminix adds the value to a script’s requests to those hosts and to nothing else, whatever the code says. A script you let read the value can send it to any host the script’s version allows.
  • One value per environment. A run uses the value for its own environment, such as a test key in staging and the live key in production.
  • Not readable by code. The exception is a secret where you turn on “Let scripts read it as an environment variable” (allowEnvVar).
  • Kept out of output and logs. If a run prints a secret value it had access to, Reminix replaces it with [secret] in the run’s output, log and error. Reminix also catches the value when it’s base64- or URL-encoded. Reminix doesn’t scan files a run saves, so never write a secret to /saved.

Workspace owners and admins save, rotate and delete secrets. Members see each secret’s name and hosts, but never its value. They need the name and hosts to write a reminix.json.

Settings, Secrets: a grid of secrets by environment. ADMIN_KEY has a production value sent only to api.yourapp.com, and SLACK_TOKEN one sent only to slack.com, neither with a staging value. STRIPE_KEY has values in both, sent only to api.stripe.com. The grid never shows a value. Settings, Secrets: a grid of secrets by environment. ADMIN_KEY has a production value sent only to api.yourapp.com, and SLACK_TOKEN one sent only to slack.com, neither with a staging value. STRIPE_KEY has values in both, sent only to api.stripe.com. The grid never shows a value. Settings, Secrets: a grid of secrets by environment. ADMIN_KEY has a production value sent only to api.yourapp.com, and SLACK_TOKEN one sent only to slack.com, neither with a staging value. STRIPE_KEY has values in both, sent only to api.stripe.com. The grid never shows a value. Settings, Secrets: a grid of secrets by environment. ADMIN_KEY has a production value sent only to api.yourapp.com, and SLACK_TOKEN one sent only to slack.com, neither with a staging value. STRIPE_KEY has values in both, sent only to api.stripe.com. The grid never shows a value.

In the app, go to Settings → Scripts → Add secret. If your workspace has more than one environment, the page is a grid with a column for each one. Use Set to add a missing value. A saved value’s ⋯ menu shows when a run last used it, and it has Rotate and Remove.

With five environments or more, each secret is one row that says where it has a value, as in “Set in 3 of 10”. Its Environments button lists every environment with a checkbox. Tick one to give the secret a value there, or untick it to remove that value.

From the CLI or your code, Reminix saves the secret in the environment you act in. It’s the workspace’s default environment unless you name another. A key or token needs secrets:write:

import { createClient } from "@reminix/sdk";
const reminix = createClient({ environment: "staging" });
const secret = await reminix.secrets.set("ADMIN_KEY", {
value: process.env.STAGING_ADMIN_KEY!,
hosts: ["api.staging.yourapp.com"],
});
console.log(secret);

reminix secrets list shows each secret’s name and the hosts it may go to in each environment. It never shows a value. To remove one environment’s value:

Terminal window
reminix secret-values delete ADMIN_KEY staging

reminix secrets delete ADMIN_KEY deletes the secret everywhere. The same operations are under Secrets in the API reference. Agents can list secrets but never save or delete them. An agent that needs a secret asks you to add it.

A script declares the secrets it uses in its reminix.json. See Scripts → Calling APIs. A run uses the value for its own environment, and only for the hosts that value allows. If the environment has no value, the run fails before it starts. Reminix never borrows another environment’s value. After a rotation, the next run uses the new value.