CONSOLE

Secrets

Secrets are key/value pairs used to store application secrets and configuration for your applications across Environments in various folders and paths. Secrets in Phase can additionally have tags and comments associated with them. Every read, update or delete event for a secret will be logged and viewable on the App logs screen. All changes to secrets in an environment automatically trigger deployments to their platform secret sync integrations, if set up.

You manage the Secrets of an App on its Home tab, in a single editor where every Environment is a column and every secret is a row. You can compare, edit, and deploy the secrets of all your Environments from this one screen.

Secrets across the Environments of an App

Working across Environments

Each Environment of the App has its own column, with its name, color and any secret syncs shown in the column header. A cell holds the value of that row's secret in that Environment.

  • Show or hide Environments: Open the "All Environments" menu above the editor to choose which Environments are shown, or click "Only" to work in a single Environment. You can also untick the checkbox in a column header to hide that Environment, or click its name to show only that one. Hidden Environments stay visible as narrow columns; click one to bring it back.
  • Arrange columns: Drag a column by the grip in its header, or use "Move left" and "Move right" in the column's options menu, to reorder Environments. Drag the edge of a column to resize it, and double-click the edge to reset its width.
  • Missing values: A patterned cell means the secret does not exist in that Environment. Hover over it and click "Add value" to add it.
  • Scheduled for deletion: An Environment that is scheduled for deletion keeps a struck-out column with a clock in its header. Click it to restore the Environment.
  • Same as Production: A secret value that is identical to the one in your Production Environment is marked with a small tick in Production's color, which makes credentials that are shared between Environments easy to spot.
The Environments menu, with the option to show only one Environment

When you narrow the editor down to one Environment, the other Environments remain one click away.

The editor narrowed down to a single Environment
A secret that is missing in one Environment

Create a Secret

To create a Secret, click the "New Secret" button. This adds a new row at the top of the editor. Enter the key, then type a value into the column of each Environment. The secret is created in every Environment that is currently shown, so hide an Environment first if it should not get the secret. Click "Deploy" to save your changes.

You can also type a new key into the search bar and click the "Create" button that appears when nothing matches.

Secret Types

Every secret in Phase has a type that controls its behavior and visibility. All secrets are end-to-end encrypted regardless of type — the type only affects how the secret is displayed and whether the value can be read back after saving. You can set the type when creating a secret, or change it later using the type selector that appears when hovering over the secret key.

TypeDescription
SecretThe default type. Values are masked in the UI until revealed.
SealedValues are write-once. After saving, the plaintext value is redacted server-side and can never be read back in the Console UI. The type cannot be changed once saved. Use this for values that should only be injected at runtime and never exposed in the UI, such as root credentials or signing keys.
ConfigNon-sensitive configuration values (e.g. APP_NAME, LOG_LEVEL, REGION). Values are shown in plaintext by default without masking.
Secret type selector shown when hovering the secret key

Changing a secret's type

You can change a secret's type by hovering over the secret key and using the type selector at the start of the menu that appears. The new type applies to the secret in every Environment that is currently shown. Type changes are staged like any other edit and are only saved when you deploy.

Staged secret type changes before deploying

As the value of a sealed secret cannot be changed after it is saved, a sealed secret cannot be deployed with an empty value. Enter a value in every Environment that is shown, or delete the secret from the Environments that should not have it.

Import Secrets

You can import secrets into your Apps and Environments by dragging-and-dropping .env files or selecting them from your filesystem.

The quickest way is to drop a .env file anywhere on the editor. This opens the "Import secrets" dialog with the contents of your file.

Dropping a .env file on the editor

You can also open the dialog from the "New Secret" menu to paste the contents of your .env file, type key-value pairs by hand, or choose a file.

New Secret menu with the Import secrets option

Phase will parse all key-value pairs in your .env file, as well as any comments that are either in-line or precede a key-value pair. For each Environment, you can then decide whether to import into it at all, and whether to include values and comments. By default the first Environment receives values and comments while the others only receive the keys. This is great for quickly initializing your App with dev secrets from your local .env file, while populating other Environments with just the corresponding keys.

Import secrets dialog with options for each Environment

Click "Preview Import" to add the secrets to the editor. Imported secrets land in the folder you are currently viewing and are staged like any other change, so you can adjust them before deploying.

Imported secrets staged in the editor

If one or more keys of the secrets that you are trying to import already exist in the current folder, their values will automatically be updated in every Environment that imports values. Environments that only receive keys keep the values they already have. You can easily review the changes while in the deploy preview before deploying.

Here's a quick demo of how to import secrets by dropping a file:

Secret Referencing

You can use the value of other secrets inside a given secret across environments and folders. This may be useful for things like database connection strings.

Example:

DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}
DB_USER=j_mclaren
DB_PASSWORD=2ff9853e23b68587480da26a478b782aa8aeafe46ec716d0667ad7078870c345
DB_HOST=mc-laren-prod-db.c9ufzjtplsaq.us-west-1.rds.amazonaws.com
DB_PORT=5432
DB_NAME=XP1_LM

# will resolve to:
DATABASE_URL=postgresql://j_mclaren:6c37810ec6e74ec3228416d2844564fceb99ebd94b29f4334c244db011630b0e@mc-laren-prod-db.c9ufzjtplsaq.us-west-1.rds.amazonaws.com:5432/XP1_LM

Secret referencing syntax:

Value reference syntaxEnvironmentPathSecret Key Being ReferencedDescription
${KEY}same environment/KEYLocal reference in the same environment and path root (/).
${staging.DEBUG}staging/ (root of staging environment)DEBUGCross-environment reference to a secret at the root (/).
${production./frontend/SECRET_KEY}production/frontend/SECRET_KEYCross-environment reference to a secret in a specific path.
${/backend/payments/STRIPE_KEY}same environment/backend/payments/STRIPE_KEYLocal reference with a specified path within the same environment.
${backend_api::production.SECRET_KEY}production (in backend_api app)/ (root of backend_api app)SECRET_KEYCross-application reference to a secret at the root path within another application.
${backend_api::production./frontend/SECRET_KEY}production (in backend_api app)/frontend/SECRET_KEYCross-application reference to a secret in a specific path within another application.

Please note the following when using secret referencing:

  • Authentication requirements: Your authentication token must have access to all referenced secrets across apps, environments, and paths. If access is insufficient, the reference won't be resolved and will be returned with the original syntax. For example, if you have access to the production environment in backend_api but not in frontend, the value ${backend_api::production./frontend/SECRET_KEY} will not be resolved.

  • Third-party sync integration behavior: When syncing to third-party services, Phase requires all secret references to be resolvable. The sync will fail if any referenced secret is not found in its specified location (whether locally, in a path, or within an app). This design ensures third-party platforms never receive broken references, as many support their own native referencing syntax.

  • Name collision handling: If two or more applications in your organization share the same name (case insensitive), any secret reference to these applications will be deemed ambiguous and will be returned as unresolved when accessed via the REST API. Additionally, any sync operation involving these ambiguous references will fail with an error message.

  • Server-side Encryption (SSE): For references to resolve over the Public API or native integrations, all referenced apps must have SSE enabled. If a secret is referenced in an app without SSE, the reference will not resolve, will be returned as-is over the API, and sync jobs will fail. Note: SSE is not required for references to resolve when using E2E enabled clients such as the CLI or SDKs.

  • Renaming Environments and folders: References are not rewritten when the Environment or folder they point to is renamed or moved. Update any references that use the old name or path afterwards.

Override a Secret (Personal Secrets)

You can override the value of a Secret with a Personal Secret. This can be useful for using API keys, authentication credentials, or other environment variables that are unique to your development setup without having to modify the environment for other users. When applied, the overridden value of the Secret will only be visible to you. When developing locally with the Phase CLI, the override value will be used by default.

A Personal Secret overrides the value of a secret in one Environment. To create one, hover over the value in the column of that Environment and click on the "Override" button.

secret override button

Then simply enter the value you wish to override this secret with. You can also control whether a Personal Secret override is active using the "Activate Secret Override" toggle switch.

create personal secret

To find the secrets you have overridden, open the "Filter" menu and select "Overridden".

Tag a Secret

To apply a tag to a Secret, hover over the secret key and click on the tags button in the menu that appears to open the Tags dialog. You can select one or more tags to apply to this Secret, or create new Tags if required.

tag a secret

All tags applied to a secret will be displayed as colored dots next to the secret key. Open the Tags dialog to see their names, or use the "Filter" menu to list the secrets with a given tag.

view secret tags

Note: Secret tags are not saved until you "Deploy" your changes

Add comments to a Secret

To add comments to a Secret, hover over the secret key and click on the "#" comment button in the menu that appears to open the comment dialog. Type your comment and close the dialog.

edit secret comment

Secrets with comments will be identifiable by a green comment icon next to the secret key.

view secret comment

Note: Secret comments are not saved until you "Deploy" your changes

Share a Secret

You can easily share secrets to other users via a secure link. When sharing a secret, you need to decide whether you simply want to link a secret to another user who already has access to it in Phase (via a Permalink) or an external user who may not have an account in Phase (via a Lockbox). Hover over the value of the secret in the Environment you want to share it from and click the "Share" button to create a Permalink or Lockbox.

Share button on a secret value

Permalinks allow you to share a secret with other users who already have access to it in Phase. This is useful when you want to link a specific secret within an App, Environment, or Folder to others on your team. Opening a permalink takes you to the App with the editor narrowed down to that Environment and the secret highlighted.

secret permalink

Lockbox

Lockbox allows secrets to be shared via a single link using a "sealed box" with zero-trust encryption. The key that is used to decrypt the secret is encoded as a URL fragment and is not stored in Phase or transmitted to the server. When creating a Lockbox, you will be able to update or override the value of the secret and specify the expiry time and the maximum number of views. Please be mindful that anyone with the link will be able to access the secret.

Create a Lockbox
Lockbox link
Opening a Lockbox

View Secret history

You can view the entire history of a Secret in an Environment by hovering over its value in the column of that Environment and clicking the "History" button. This dialog shows a timeline of changes to all properties of this secret, with timestamps and user information for each change.

You can also restore the "Value" of a secret from history by clicking the "Restore" button. This will update the value of the Secret, and will be saved when you next Deploy your changes.

view secret history

Reveal Secret values

Values of the Secret type are masked until you reveal them. You can reveal:

  • A single value: Hover over the value and click the "Reveal" button.
  • One Environment: Hover over the column header of the Environment and click the eye button that appears next to the cog icon. Click it again to mask the values.
  • Everything: Click "Reveal all" above the editor, or switch on "Reveal on hover" to unmask each value while your pointer is over it.
Revealing the values of a single Environment

Sealed secrets cannot be revealed.

Search for a Secret

You can search for a secret by typing into the search bar above the editor. The search matches both the keys and the values of secrets in the Environments that are shown, and filters the list to only show the secrets that match.

Search for a secret

To narrow the list down further, open the "Filter" menu to filter by type (Config, Secret, Sealed), by how a secret is managed (Rotating, Dynamic, Overridden) or by tag. The same filters can be typed straight into the search bar as type:, is: and tag: qualifiers, for example type:config or tag:database. The "Sort" menu orders secrets by when they were created or updated, or by key or value.

You can also search for secrets across all Apps, Environments, and Folders that you have access to in your organization via the command palette. You will see matching results listed with the App, Environment, and Path context of each secret.

Global secret search

Here's a quick demo of finding a secret from the command palette and opening it:

Update a Secret

To update the key or value of a secret, simply find the row of the secret you wish to update and start typing the new key or value in the column of the Environment you want to change. You may choose to reveal the value of the secret by clicking the "Reveal" button. "Boolean secrets" can be easily flipped between "true" and "false" values with the toggle switch. The existing case of your boolean value will be preserved e.g., True will be flipped to False and vice versa, true will be flipped to false and so forth.

Secrets that have been updated will be highlighted in yellow to indicate that they have been updated. You can update any number of secrets, in any number of Environments, at once. A summary of your undeployed changes appears next to the "Deploy" button. Once finalized, click the "Deploy" button to save your changes.

Review and deploy changes

Changes are not saved as you type. They are collected as undeployed changes and shown next to the "Deploy" button, together with the Environments they affect.

  • Hover over the undeployed changes to see a summary of what will change in each Environment, and which secret syncs a deploy will trigger.
  • Click on the undeployed changes to open the full review, with the old and new value of every change grouped by Environment.
Reviewing undeployed changes before deploying

From the review you can discard a single change, all the changes in one Environment, or everything. Click "Deploy" to save the changes to all the affected Environments in one go.

After a deploy, the same control follows the secret syncs that were triggered by it and tells you once they have completed, or if any of them failed.

Syncs completing after a deploy

Delete a Secret

You can delete the value of a secret in a single Environment, or delete the secret from every Environment that is shown:

  • To delete a secret from one Environment, hover over its value in the column of that Environment and click the red 🗑️ (trashcan) button at the end of the menu.
  • To delete a secret from all the Environments shown, hover over the secret key and click the red 🗑️ (trashcan) button at the end of the menu.

This will select the secret for deletion. You will see the value or row being highlighted in red to indicate that it is selected for deletion.

You can select any number of secrets for deletion. You can also deselect a secret that was selected for deletion by clicking the red restore button. Once finalized, click the "Deploy" button to delete the selected secrets.

Select multiple Secrets

To work on several secrets at once, hover over the row number of a secret and tick its checkbox. The checkbox in the corner of the table selects every secret that is shown. A toolbar then appears above the editor with the actions for your selection:

ActionDescription
MoveMove the selected secrets to another folder.
TypeSet the type of the selected secrets.
TagsAdd tags to, or remove tags from, the selected secrets.
ExportDownload the selected secrets of an Environment as a .env file.
New EnvironmentCreate a new Environment that starts with the selected secrets.
DeleteSelect the secrets for deletion.
Multiple secrets selected, with the selection toolbar

These actions apply to the Environments that are shown. Moving secrets, setting their type or tags, and deleting them are staged like any other change, and are saved when you deploy.

Moving the selected secrets to a folder

Folders

Folders let you organize the secrets of an App into paths, such as /payments or /aws. Folders are listed at the top of the editor, with the number of folders and secrets they contain in each Environment.

  • Create a folder: Open the "New Secret" menu and click "New Folder". The folder is created in the Environments that are shown.
  • Browse a folder: Click the arrow next to a folder to expand it in place, or hover over the folder and click the open (→) button to navigate into it. The path of the folder you are in is shown above the editor, where you can copy it, jump to another folder, or go back.
  • Add a secret to a folder: Hover over the folder and click the "+" button, or open the folder and click "New Secret".
  • Move secrets to a folder: Select the secrets and click "Move".
Folder actions shown when hovering a folder
The contents of a folder

Renaming or moving a folder

Hover over a folder and click the pencil button to rename it or move it to a different path. You can choose which Environments the change applies to.

Rename or move a folder

Deleting a folder

Hover over a folder and click the red 🗑️ (trashcan) button, then choose the Environments to delete it from. Deleting a folder also deletes all the secrets and folders inside it, and cannot be undone.