Sensitive environment variables
Environment variables that cannot be decrypted once created.Sensitive environment variables are environment variables whose values are non-readable once created. They help protect sensitive information stored in environment variables, such as API keys.
When you mark an existing environment variable as sensitive, Vercel converts it to a non-readable format. This is only possible for environment variables in the Production and Preview environments.
Both project environment variables and shared environment variables can be marked as sensitive.
You can only create a sensitive environment variables in the Preview and Production environments.
Sensitive environment variables can be create at the project or team level:
- Go to the Vercel dashboard and select your team from the scope selector. Click on the Settings tab and then select Environment Variables from the left navigation. To create sensitive environment variables at the project-level, select the project from your dashboard and then and click the Settings tab.
- At the top of the form, toggle the Sensitive switch to Enabled. If the Development environment is selected, you will be unable to enable the switch.
- Fill in the details to create a new environment variable.
- In the environment variable table, sensitive environment variables are marked with a "Sensitive" tag:
You can edit the environment for a sensitive environment variable. You cannot edit the key or value of a sensitive environment variable.
- From your dashboard, go to the team or project's Settings tab and select Environment Variables from the left navigation. Find your environment variable in the list.
- Click Edit from the three-dot menu in the environment variables list
- Select the environment(s) for the sensitive environment variable.
- After making the change, click the Save button.
Users with the owner role can set a team-wide environment variable policy for creating environment variables. Once enabled, all newly created environment variables in the Production and/or Preview environments will be sensitive environment variables.
- From the dashboard, ensure your team is selected in the scope selector and select the Settings tab.
- From the left navigation, click Security & Privacy.
- From the Environment Variable Policies section, toggle the Enforce Sensitive Environment Variables switch to Enabled:
Was this helpful?