> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voiceflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments

> Work on multiple versions of your agent in parallel, conduct A/B tests with traffic splits, and roll changes back with confidence.

<img src="https://mintcdn.com/voiceflow-009a8802/JSaXjbI0-V7PORiH/images/Envs-docs.png?fit=max&auto=format&n=JSaXjbI0-V7PORiH&q=85&s=f3be4990ec87cb1b62a1e096b42f13b8" alt="Envs Docs" width="2820" height="870" data-path="images/Envs-docs.png" />

Environments are independent copies of your AI agent. This makes it safe to test a change in isolation, compare two versions of your agent against each other (A/B test), or roll out a new version gradually.  Environments are independent copies of your AI agent. This makes it safe to test a change in isolation, compare two versions of your agent against each other (A/B test), or roll out a new version gradually.

Each environment has its own [draft version](/documentation/deploy/environments/publishing), **live version,** and independent [version history](/documentation/deploy/environments/publishing#version-history-and-reverting). Every project starts with a single environment called `Main`, which is what your users connect to by default.

## Key concepts

| Concept               | What it is                                                                                                                                          |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Environment**       | An independent copy of your agent.                                                                                                                  |
| **Draft version**     | An auto-saved working version of the environment, updated as you make edits.                                                                        |
| **Live version**      | The most recently published version of the environment that's [receiving traffic](/documentation/deploy/environments/traffic-split), if configured. |
| **Traffic splitting** | Control what % of live traffic is reaching which environment.                                                                                       |
| **Merging**           | Promoting a specific environment to Main.                                                                                                           |
| **Version history**   | Snapshots of an environments versions over time.                                                                                                    |

## Best practices

Use the following workflow for any meaningful change to your agent. `Main` keeps serving users throughout, and you can roll back at any step.

<Steps>
  <Step title="Clone Main">
    Create a new environment cloned from `Main` and name it after the change(s) you're making.
  </Step>

  <Step title="Iterate">
    Work on the new environment and save <kbd>⇧⌘S</kbd> or [publish versions](/documentation/deploy/environments/publishing) as you go.
  </Step>

  <Step title="Route a small percentage of live traffic">
    Once you're happy with the changes, open [**edit traffic split**](/documentation/deploy/environments/traffic-split) and send a small percentage of live traffic to the new environment.
  </Step>

  <Step title="View results (A/B test)">
    Compare this environment to `Main` using your KPIs in [Analytics](https://docs.voiceflow.com/documentation/measure/analytics), [Evaluations](https://docs.voiceflow.com/documentation/measure/evaluations) and [Transcripts](https://docs.voiceflow.com/documentation/measure/transcripts).
  </Step>

  <Step title="Merge and clean up">
    If this environments proves to be performing better than Main, [merge](/documentation/deploy/environments/merging) the environment to `Main`. Delete the environment on merge to keep your project clean.
  </Step>

  <Step title="Repeat">
    Repeat this process to continually improve your agent over time.
  </Step>
</Steps>

<Info>
  Each project supports up to 10 environments, including Main. If you're close to the limit, merge or delete the ones you no longer need.
</Info>

## Managing environments

You can manage a project's environments from **Settings** → **Environments** when editing a project. Or click the environment name in the left menu under the project name and press 'view all'.

<Frame>
  <img src="https://mintcdn.com/voiceflow-009a8802/JSaXjbI0-V7PORiH/images/CleanShot-2026-04-29-at-13.09.52@2x.png?fit=max&auto=format&n=JSaXjbI0-V7PORiH&q=85&s=890425af5b543bcf8d85bf02866c3ab3" alt="Clean Shot 2026 04 29 At 13 09 52@2x" width="2564" height="1038" data-path="images/CleanShot-2026-04-29-at-13.09.52@2x.png" />
</Frame>

### Creating an environment

Click **New environment** in the top right. Give the environment a name, pick an environment to **Clone from**, and click **Create**.

<img src="https://mintcdn.com/voiceflow-009a8802/m2AwTYepiz1ibdK4/images/New-env.png?fit=max&auto=format&n=m2AwTYepiz1ibdK4&q=85&s=c29d816f4caefe88da508b6774d3962f" alt="New Env" width="1732" height="1040" data-path="images/New-env.png" />

Most of content from the environment that you chose to clone from will be copied into your new environment - see below for the exceptions.

| Data type                                                                                        | Behaviour when cloning                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Workflows, playbooks, and tools                                                                  | Cloned into the new environment.                                                                                                                                                                                                                                                                                                               |
| Agent configuration (model, instructions, guardrails)                                            | Cloned into the new environment.                                                                                                                                                                                                                                                                                                               |
| Widget settings                                                                                  | Cloned into the new environment.                                                                                                                                                                                                                                                                                                               |
| Variables                                                                                        | Cloned into the new environment.                                                                                                                                                                                                                                                                                                               |
| Knowledge base documents                                                                         | The contents of each knowledge base document are shared project-wide. The list of documents included in the original environment is cloned into the new environment. This means that adding or removing documents in the knowledge base is environment-specific, but modifying a document affects all environments that contain that document. |
| Knowledge base metadata                                                                          | Environment specific. Adding or removing metadata from a document only affects a specific environment.                                                                                                                                                                                                                                         |
| Knowledge base [integrations](/documentation/build/Importing-data-sources) (Shopify and Zendesk) | Shared project-wide.                                                                                                                                                                                                                                                                                                                           |
| Phone numbers                                                                                    | Shared project-wide, but assigned to a specific environment.                                                                                                                                                                                                                                                                                   |
| Secrets                                                                                          | Shared project-wide, with [per-environment overrides](/documentation/building/data/secrets) available for both draft and live versions of each environment.                                                                                                                                                                                    |
| Evaluations                                                                                      | Shared project wide. Results can be filtered to a specific environment and version.                                                                                                                                                                                                                                                            |
| Analytics                                                                                        | Shared project wide. Data can be filtered to a specific environment and version.                                                                                                                                                                                                                                                               |

### Switching between environments

Use the environment switcher at the top of the sidebar of any page inside your project to switch between environments. You can edit any environment, including ones your users are currently interacting with. Edits only affect the draft version until you [publish your environment](/documentation/deploy/environments/publishing).

<Frame>
  <img src="https://mintcdn.com/voiceflow-009a8802/50KUJuv_9rMWX-Q9/images/env-switching.png?fit=max&auto=format&n=50KUJuv_9rMWX-Q9&q=85&s=45f0675cffba6e404456ea969511ba82" alt="Env Switching" width="3012" height="776" data-path="images/env-switching.png" />
</Frame>

### Cloning to new environment

Press the dropdown arrow next to the publish button, and select **Clone environment** to clone the current draft version to a new environment.

<Frame>
  <img src="https://mintcdn.com/voiceflow-009a8802/N0lyyLTj-ijCNyEq/images/env---clone.png?fit=max&auto=format&n=N0lyyLTj-ijCNyEq&q=85&s=aab2edf0a4dfbbbba844e3d1d0a13512" alt="Env Clone" width="1160" height="612" data-path="images/env---clone.png" />
</Frame>

### Discarding changes

Press the dropdown arrow next to the publish button, and select **Discard changes** to open a diff view where you can confirm the selection.

<Frame>
  <img src="https://mintcdn.com/voiceflow-009a8802/fmpMeSXQ10o6R0gt/images/envdiscard.png?fit=max&auto=format&n=fmpMeSXQ10o6R0gt&q=85&s=7d4af965fd68ba561dabc5eadfbf8ebf" alt="Envdiscard" width="1160" height="612" data-path="images/envdiscard.png" />
</Frame>

### Aliases

Every environment has a short, URL-safe **alias** used in API calls, the web chat widget, and any other programmatic reference. `Main`'s alias is `main`. Aliases don't change when you rename an environment, so integrations keep working.

Copy an environment's alias from the **Alias** column in **Settings** → **Environments**.

### Legacy projects

Projects created before environments launched use three fixed environments (Development, Staging, and Production) with aliases `development`, `staging`, and `production`. These keep working until you opt into migration.

After migrating, update integrations that use the legacy aliases, including the [web chat widget snippet](/documentation/deploy/widget/web-chat-api#choosing-which-environment-the-widget-loads). If you're making use of the [start session API endpoint](/api-reference/session/start-session), you'll also need to update this to point to the `main` environment, rather than `production`.
