Skip to main content
An app’s Environment tab is one editor for every variable the app reads at start: plain values, encrypted secrets, and Vault references. Values that look like credentials are masked everywhere they are read, and reading one back needs a fresh confirmation that is written to the audit log.

What counts as sensitive

The control plane classifies every plain variable when it is read, not when it is saved, so older values are covered too. You can override the automatic choice per variable from the row menu: Mark as sensitive, Show value to readers, or Use automatic detection. Marking a value sensitive takes effect at once. Making a sensitive value visible again is treated like a reveal, so it asks you to confirm it’s you. Secrets (saved with Type: Secret) are always sensitive. Their values are envelope encrypted at rest (see Security overview).

What is masked

A sensitive value is never returned by a read. In its place the API returns •••••••• plus metadata:
The preview shows at most four characters from each end, and nothing for values shorter than sixteen characters. Masked surfaces: GET /api/v1/apps/{name}, the app list, the responses of create, update and clone, organization, project and environment variables, preview and branch overrides, environment and deploy comparisons, the compose preview, the masked export, the audit log and app events (keys only, never values), every MCP tool, and CLI output. The deploy pipeline, the reconciler and the app importer still read the real values on the server.

Sending a masked value back

A client that reads an app, changes one field and writes the whole app back sends •••••••• for the values it never saw. The server keeps the stored value for every existing key that comes back masked. A masked value for a key that has nothing stored is rejected with 400, so a pasted file can never write the placeholder as a real value. The same rule applies to organization, project and environment variables.

Revealing a value

Reveal is a separate, audited action: Step-up proves it is still you at the keyboard:
  • Password: your current password. When the account has an authenticator app enabled, the authenticator code (or a recovery code) is required as well.
  • Passkey: a passkey assertion for the signed-in account (POST /api/v1/auth/step-up/passkey/begin, then .../finish).
A successful step-up issues a grant that is bound to the browser session and to one action on one app (reveal, export or manage for web, for example). It lasts five minutes by default (APP_SECRET_STEP_UP_TTL, at most 15 minutes) and is useless from any other session, for any other app, or for any other action. Failed attempts are rate limited per account and per client address and lock out with growing back-off. Every reveal and export writes an audit row with the actor, app, key and method, never the value. In the dashboard a revealed value shows for 30 seconds (APP_SECRET_REVEAL_HIDE_AFTER), hides when the tab is hidden, and is gone when you leave the page. Copy is only offered after a reveal. All export responses carry Cache-Control: no-store.

API tokens

API tokens cannot use step-up grants. A token can reveal only when all of these hold:
  1. it carries the secrets:reveal ability (only grantable from a signed-in session that holds read:sensitive; root does not imply it),
  2. it also holds read:sensitive,
  3. the server runs with APP_SECRET_REVEAL_TOKENS=on (off by default),
  4. the request includes the token owner’s password, plus the authenticator code when the owner has one, as step_up.
The CLI asks for the password and code at the prompt and never reads them from flags or the environment:

Reveal policy

APP_SECRET_REVEAL sets the platform policy: An unknown value turns reveal off and the doctor reports it. allow raises a warning in levelrail-cli doctor (secret_reveal_policy) and a high severity row in the Security center (secret_reveal_allow). An app owner can also make one app’s secrets write-only from Protection on the Environment tab (PUT /api/v1/apps/{name}/env/settings with {"secrets_write_only": true}). That blocks every reveal and full export for the app. Turning it back off needs a step-up.

The editor

  • Table: Key, Value, Type (Plain, Secret, Vault) and Scope (own value, or inherited from the organization, project or environment, with an Override action).
  • Add variable suggests Secret when the name looks sensitive.
  • Convert to secret moves an existing plain value into encrypted storage on the server. The value never passes through the browser. The running app keeps the old variable until you restart or redeploy.
  • Edit as .env switches the same rows to text. Masked lines keep what is stored, deleting a line removes the variable, and Vault rows stay in the table.
  • Import .env file merges a file into the table; a masked or empty value for a masked key keeps the stored value.
  • Review changes lists added, changed and removed keys before anything is saved, with sensitive values hidden.
  • After a save, a Redeploy needed banner offers a restart.

Local .env files

env pull asks for your password (and authenticator code) once so secret values are written too. Add --masked to skip that and write secrets as empty keys. Database and storage links inject their connection env at container start, so they are not part of the file. env push merges plain variables only: keys already stored as secrets are skipped. Both accept --file and the usual --api-url and --token flags.

Credential scan on save

Before new or changed plain values are saved, the editor’s Review changes step (and env push) checks them for credentials such as cloud keys, tokens and URLs with embedded passwords. A match shows a warning naming the variable only, never the value, with a Store as secrets button that converts those rows to Secrets. The scan needs secret scanning enabled on the control plane and is skipped silently when it is not.

Variable health and history

The Environment tab shows a Variable health card. It flags empty values, plain values hidden by a secret or database binding of the same name, names that differ only by case, required secrets with no value, and bindings to databases that no longer exist. Problems that can be fixed safely have a Fix button; the rest say what to do. From the CLI: apps env check <name> (add --fix to apply the safe fixes). Every edit also records which variables were added, changed or removed, by whom and when, shown under Recent changes and by apps env history <name>. Values are never recorded, only names, so the history is safe to share. It keeps the newest 1000 changes per app.

Output masking

The control plane also hides stored secret values in what it writes out. Each known value is replaced with [redacted] in app and container logs (when stored and when read back), deploy and build output, audit log rows, alert history and notification delivery errors, and the control plane’s own logs. A value is registered for masking when:
  • a secret is saved (apps secrets set) or read from the store,
  • the control plane boots and decrypts every stored secret it can open, so lines written after startup are covered,
  • a Vault value is read at deploy time,
  • a pipeline job secret, a GitHub App installation token or a DDNS provider token is used.
Rules that follow from that:
  • Values shorter than 8 characters are never masked, so ordinary text such as true or 1234 is not shredded.
  • The same value is also masked in base64 (standard, unpadded and URL-safe), URL-escaped and JSON-escaped forms, and with LF line endings where the source had CRLF.
  • APP_SECRETMASK_MAX_VALUES (default 20000) caps how many distinct values are tracked. Past the cap, new secrets are not masked and the control plane logs one warning, secretmask: registry full, new secrets are not masked.
  • The registry is in memory in the control plane process and is rebuilt at each boot from the stored secrets.

Managing secrets from the CLI

A value typed on the command line can end up in shell history, so prefer --env-file for real credentials. build-time is off by default, and an enabled secret can be read by anyone who can change the Dockerfile. Rotation has its own commands. Both need --yes:
See Secret rotation policies for schedules and status. Scan a directory or an app’s plain values with levelrail-cli secrets scan --path ./repo and levelrail-cli secrets scan my-app --policy-show, described in Secret scanning. Per-app data keys and the master key are covered by levelrail-cli secrets key-status, secrets rotate-dek <app> and secrets key-policy --max-age-days 90 --remind-every-days 7, in Master key rotation.

Not yet

  • Plain variables that are sensitive by name or value are masked in API and CLI reads, but they are not registered with the output masker. A log line that prints one is not redacted. Store the value as a secret to get log masking.
  • A value the app transforms in another way (a hash, a truncated copy, a different encoding) is not recognized.
  • There is no per-app setting for output masking. APP_SECRETMASK_MAX_VALUES is the only tunable.

Threat model

This protects against:
  • Shoulder surfing and shared screens: values are masked by default, a reveal hides itself after 30 seconds and when the tab is hidden.
  • Screen recordings and screenshots of the Environment tab, the deploy comparison or a support session.
  • A leaked read token or a read-only teammate: read and read:sensitive tokens never see values on any read surface.
  • A stolen browser session: a reveal still needs the password (and authenticator code) or a passkey, and every attempt is audited and rate limited.
  • Browser history and caches: reveal and export responses are POST or no-store, and values never appear in URLs.
  • Accidental overwrite from a pasted file: masked placeholders keep stored values.
It does not protect against:
  • an attacker with root on the host, who can read the database, the master key in memory, or the running container’s environment,
  • an attacker who holds a root API token and the account password,
  • a user with write who changes the app’s image or command to print its own environment: deploying code is equivalent to reading the values that code receives.
Last modified on November 8, 2026