> ## 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.

# 1Password Environments

> 1Password Environments store project secrets as environment variables you can share with your team and load into your apps, local .env files, and AI coding tools.

A 1Password Environment holds the secrets for one project or stage, like `dev` or `staging`, separate from the rest of your vaults. Your app, terminal, CI/CD, or AI agent reads them from 1Password when it needs them, so they never sit in a plaintext `.env` file.

**1. Create an Environment**

In the 1Password app, go to **Developer** > **View Environments** > **New environment**. [Details](#create-an-environment)

**2. Add your secrets**

Import an existing `.env` file or add key-value pairs. [Details](#add-secrets-to-an-environment)

**3. Use them where your code runs**

Pick one way to load them:

* [Local .env file](https://www.1password.dev/environments/local-env-file.md): a file 1Password mounts for your app, with nothing written to disk.
* [1Password CLI or SDKs](https://www.1password.dev/environments/read-environment-variables.md): read secrets in your terminal or Go, JavaScript, and Python code.
* [MCP server](https://www.1password.dev/environments/mcp-server.md): let Claude Code, Cursor, and other agents use them.
* [AWS Secrets Manager](https://www.1password.dev/environments/aws-secrets-manager.md) or the [Credential Broker](https://www.1password.dev/brokered-access.md): for cloud and machine workflows.

> [!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.

[Video overview of 1Password Environments and how they help you manage project secrets.](https://www.youtube.com/embed/mrhtzh05jG4)

## 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). \
  This feature is not available in 1Password for iOS or Android.
* Have an Owner or Administrator [turn the Environments policy on](#turn-the-environments-policy-on-or-off) from the 1Password admin console.

## 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.

> [!TIP]
>
> You can also use [1Password Developer Watchtower](https://www.1password.dev/watchtower.md) to find `.env` files containing plaintext secrets on your device and [import them into Environments](https://www.1password.dev/watchtower.md#import-plaintext-secrets-from-local-env-files).

## Add secrets to an Environment

After you create an Environment, you can add your project secrets to it. Each secret is a key-value pair that includes a name (for example, `DB_HOST`, `DB_USER`, or `API_KEY`) and its value.

To add secrets 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 secrets in two ways:

* If you have an existing `.env` file for your project, select **Import .env file**. 1Password will automatically import the environment variables from the file as secrets.
* To manually add secrets, select **New secret**. Enter the secret's name in the **Name** field and its value in the **Value** field. Repeat this process for each secret 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 vertical ellipsis  next to the secret, then select **Show value by default**.

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

## Use your Environments in your workflows

In the 1Password desktop app, you can configure each Environment to fit your workflow:

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

Values are hidden by default, but you can toggle the visibility on or off in the **Actions** column. You can also delete secrets from this column. Select **Edit** within the environment to add, edit, or delete secrets 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.

### 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 their secrets 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**. You'll be redirected to the Admin Console.
3. Select **Manage**, then search for and select the team members or groups you want to add to your Environment.
4. To adjust permissions for team members or groups added to your Environment, select the People or Groups tab in the "Environment access" screen. Next to the team member or group name, select the ellipsis  and choose to allow viewing, allow editing, or allow managing.

To remove a team member or group from an Environment, return to the "Manage access" screen. Select the People or Groups tab in the "Environment access" screen, then select the ellipsis  next to the team member or group name you want to remove and select **Remove Access**.

### Sort and search Environments

You can curate your Environments view to surface information you need in the way that best supports your work. From the Environments page in the 1Password desktop app (**Developer** > **View Environments**), select the arrow next to the **Name** column to organize Environments alphabetically or reverse-alphabetically.

Search for Environments from anywhere in the 1Password app [using the top-level search bar](https://support.1password.com/search-1password/) to navigate to your Environments directly. Enter the name of an Environment in the search, then select it to go directly to that Environment's details page.

You can also sort or search for specific secrets within Environments. Within an Environment's details page, select the arrow next to the secrets **Name** column to organize secrets alphabetically or reverse-alphabetically. To search secrets, select **+ Add secret** then enter a secret name in the **Search secrets** bar.

## Turn the Environments policy on or off

Owners and Administrators can turn Environments on or off from the 1Password Admin Console. This controls whether all users in an account have access to the Environments feature. If Environments are turned off, any previously created Environments and integrations will become inaccessible to users until the policy is re-enabled.

No data is deleted when the policy is turned off. Full access to all previously created Environments will be restored if the policy is turned back on.

If a user tries to access previously available Environments after the policy is turned off, they’ll see a message that the policy has been turned off with instructions to contact an Administrator if they need access.

To turn the Environments policy on or off:

1. Sign in to 1Password.com with your administrator or owner account.
2. From the sidebar, go to **Policies** then select **Sharing and permissions**.
3. Select **Developer permissions**.
4. Scroll to the **Environments** toggle, then turn it on or off.
5. Follow the confirmation steps, then scroll to the bottom of the page and select **Save**.

## Learn more

* [Access secrets from 1Password through local `.env` files](https://www.1password.dev/environments/local-env-file)
* [Use 1Password's agent hook to validate local .env files from 1Password Environments](https://www.1password.dev/environments/agent-hook-validate.md)
* [Sync secrets between 1Password and AWS Secrets Manager (beta)](https://www.1password.dev/environments/aws-secrets-manager.md)
* [Programmatically read Environments with 1Password CLI or 1Password SDKs](https://www.1password.dev/environments/read-environment-variables.md)
* [1Password Developer Watchtower](https://www.1password.dev/watchtower.md)
* [Workflow: Secure your developer secrets](https://www.1password.dev/get-started/secure-developer-secrets.md)
* [Workflow: Secure local development](https://www.1password.dev/get-started/secure-developer-secrets.md)
* [Workflow: Secure your deployments](https://www.1password.dev/get-started/secure-deployment.md)


## Related topics

- [environment](https://www.1password.dev/cli/reference/management-commands/environment.md)
- [1Password Environments MCP Server](https://www.1password.dev/environments/mcp-server.md)
- [Programmatically read 1Password Environments](https://www.1password.dev/environments/read-environment-variables.md)
