> ## Documentation Index
> Fetch the complete documentation index at: https://www.1password.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments (beta)

export const Image = ({src, darkSrc, alt, width, border, height, round}) => {
  const classNames = ["mint-mx-4"];
  if (border) {
    classNames.push("mint-rounded-sm");
  }
  if (round) {
    classNames.push("mint-rounded-lg");
  }
  const style = {};
  if (width) style.width = typeof width === "number" ? `${width}px` : width;
  if (height) style.height = typeof height === "number" ? `${height}px` : height;
  return darkSrc ? <>
      <img src={src} alt={alt} className={[...classNames, "dark:hidden"].join(" ")} style={Object.keys(style).length > 0 ? style : undefined} />
      <img src={darkSrc} alt={alt} className={[...classNames, "hidden dark:block"].join(" ")} style={Object.keys(style).length > 0 ? style : undefined} onError={e => {
    e.target.src = src;
  }} />
    </> : <img src={src} alt={alt} className={classNames.join(" ")} style={Object.keys(style).length > 0 ? style : undefined} />;
};

export const Small = ({children}) => {
  return <small>{children}</small>;
};

<Badge color="gray" stroke size="lg">Beta</Badge>

1Password Environments allow you to organize and manage your project's environment variables, separately from the rest of the items in your 1Password vaults. You can create an Environment for each project or development stage, then securely access your variables directly from 1Password when you need them. With Environments, you can:

* Make your Environment's variables available via [locally mounted `.env` files](/environments/local-env-file), without writing your credentials to disk.
* Validate your locally mounted `.env` file setup in supported agents and IDEs with [the 1Password agent hook](/environments/agent-hook-validate).
* Programmatically [read your environment variables](/environments/read-environment-variables) from 1Password in your terminal or in your Go, JavaScript, or Python integrations.
* Securely sync your environment variables to [AWS Secrets Manager](/environments/aws-secrets-manager).
* [Share Environments with your team members](#share-an-environment) for easier collaboration and onboarding.

You can import your project variables to Environments from your existing `.env` files, or by manually adding key-value pairs for each variable.

<Image align="center" alt="A 1Password Environment with several environment variables added to it." width="800px" src="/static/img/environments/overview/environments-app-light.png" darkSrc="/static/img/environments/overview/environments-app-dark.png" />

<Warning>
  When sharing an Environment with others and reading its contents outside of 1Password, review the Environment's values carefully before using them in any program or workflow. What you store in 1Password is exactly what we provide when you read your Environment.
</Warning>

## Requirements

Before you can use Environments, you'll need to:

* [Sign up for 1Password](https://1password.com/pricing/password-manager).
* Install and sign in to 1Password for [Mac](https://1password.com/downloads/mac), [Windows](https://1password.com/downloads/windows), or [Linux](https://1password.com/downloads/linux). <br /><Small>This feature is not available in 1Password for iOS or Android.</Small>
* Have [1Password Developer turned on](#turn-on-1password-developer).

### Turn on 1Password Developer

1. Open and unlock the 1Password desktop app.
2. Select your account or collection at the top of the sidebar, then select **Settings** > [**Developer**](onepassword://settings/developers).
3. Turn on **Show 1Password Developer experience**.

## Create an Environment

1. In the 1Password desktop app, go to **Developer** > **View Environments**.
2. Select **New environment**.
3. Enter a name for the new environment, then select **Save**. If you have multiple 1Password accounts, you can select which account to save the environment to.

## Add variables to an Environment

After you create an Environment, you can add your project secrets as variables. 1Password Environment variables map to conventional [environment variables <Icon icon="arrow-up-right-from-square" />](https://en.wikipedia.org/wiki/Environment_variable). Each variable is a key-value pair that includes a name (for example, `DB_HOST`, `DB_USER`, or `API_KEY`) and a value that holds the corresponding secret.

To add variables to an Environment, open and unlock the 1Password desktop app, navigate to **Developer** > **View Environments**, then select the Environment you want to update.

You can add variables in two ways:

* If you have an existing `.env` file for your project, select **Import .env file**. 1Password will automatically import your environment variables.
* To manually add environment variables, select **New variable**. Enter the environment variable name in the **Name** field and its secret in the **Value** field. Repeat this process for each environment variable you want to add.

<Note>
  Values are hidden by default, which means they'll be masked in the output of CLI and SDK operations. To change this, select the verticle ellipsis <Icon icon="ellipsis-v" /> next to the variable, then select **Show value by default**.
</Note>

You can add, edit, or remove variables from your Environment at any time. To update your variables, open the Environment and select **Edit**.

## Use your Environments in your workflows

In the 1Password desktop app, each Environment has a tab called Destinations where you can configure your Environment to use in your workflows. The following destinations are available:

* [**Local `.env` file**](/environments/local-env-file): Create a locally mounted `.env` file to make your environment variables available during local development without writing plaintext secrets to disk.
* [**Agent hook**](/environments/agent-hook-validate): Use 1Password's hook to validate your locally mounted `.env` files with supported IDEs and agents like Cursor and GitHub Copilot.
* [**Programmatically read Environments**](/environments/read-environment-variables): Read environments then pass environment variables to applications and scripts using 1Password CLI or 1Password SDKs.
* [**AWS Secrets Manager**](/environments/aws-secrets-manager): Sync secrets from 1Password to AWS Secrets Manager.

## Manage your Environments

<Tip>
  1Password Environments return values exactly as they are entered. Format your values as you would in a standard `.env` file. For example:

  * If a value contains a space, enclose the value in quotation marks: `"bar baz"`
  * If a value contains special characters, escape them with a `\`: `\$100`
</Tip>

Values are hidden by default, but you can toggle the visibility on or off in the **Actions** column. You can also delete variables from this column. Select **Edit** within the environment to add, edit, or delete variables at a later time.

### Rename or remove an Environment

If you want to rename or remove an Environment:

1. In the 1Password desktop app, go to **Developer** > **View Environments**.
2. Select the Environment you want to manage, then select **Manage Environment**.
3. Choose **Rename environment** or **Delete environment**.

<Warning>
  Deleted Environments cannot be restored and any associated integrations will stop working. 1Password will prompt you to confirm whether or not you want to delete your Environment before proceeding.
</Warning>

### Share an Environment

If you're using a shared account, such as for a team or business, you can share Environments with your team members. Each Environment remains independent, allowing you to work across multiple environments in different accounts while keeping environment variables separate. Access must be granted for each Environment.

To share an Environment:

1. In the 1Password desktop app, go to **Developer** > **View Environments**.
2. Select the Environment you want to share, then select **Manage environment** > **Manage access**.
3. Select **Add People**, then search for and select the team member you want to add to the Environment. Select **Next**.
4. Select **View & Edit**, and choose whether the person can view, edit, or manage the Environment.

To remove a team member from an Environment, return to the "Manage access" screen and select **Remove from environment** next to the person's name.

## Learn more

* [Access secrets from 1Password through local `.env` files](/environments/local-env-file)
* [Use 1Password's agent hook to validate local .env files from 1Password Environments](/environments/agent-hook-validate)
* [Sync secrets between 1Password and AWS Secrets Manager (beta)](/environments/aws-secrets-manager)
* [Programmatically read Environments with 1Password CLI or 1Password SDKs](/environments/read-environment-variables)
