> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/guides-and-quickstarts/releases-and-environments/create-environment-variables.md).

# Create environment variables

Environment variables store configuration values outside the workflow. Use different stage values when the same workflow needs different settings in development and production.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2FCOj3D7qQe889fc4w3Jnw%2FG075.mp4?alt=media&token=e75e016b-0e5e-47a2-91fe-d809c464058a>" %}

## Before you start

Collect the configuration key and the intended value for each stage from the workflow or integration owner. For example, a non-secret support address may differ between a test team and the production support team. Ask IT or the integration owner to supply service URLs and credentials; do not invent them. After creating the values, follow [Assign and secure an environment](https://docs.stackai.com/guides-and-quickstarts/releases-and-environments/assign-and-secure-an-environment.md) to grant access and attach the environment to a workflow.

## Create an environment and variables

Open Environments, select New Environment, and enter a clear name and description.

![New Environment name and description](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/dgcGVLRjGMt4Kbdd3ZMz/assets/g075-g075-01-create.png)

Use the environment to manage related stage-specific values together.

Select New Variable, enter a Variable Key, and provide the required values for Development, Staging, and Production.

![Variable key and Development, Staging, and Production values](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/lRGGSxj2Cu1PBo9SGBpQ/assets/g075-g075-02-values.png)

Keep the key consistent while giving each stage the value it needs.

Add the variable and confirm its key appears in the table.

![Environment variable table with masked values](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/1Fb6qBawBrVPKHaZmF4s/assets/g075-g075-03-masked.png)

Stage values are masked by default to avoid unnecessary disclosure.

## Update a stage value

Open Variable options → Edit to change a stage value.

![Stage-value editing controls](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/RkMATM6FIpBbbzR9h9a5/assets/g075-g075-04-edit.png)

Review the other stage fields before saving so an unrelated value is not changed accidentally.

Reopen the environment and verify the saved configuration.

![Saved environment configuration](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/2GrF3rCS9DHCd69llto5/assets/g075-g075-05-persisted.png)

Reveal sensitive values only when needed and only in a suitable private context.

## Hide displayed values

Use the hide controls after inspecting values.

![Controls for hiding displayed variable values](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/X3x8JYhJwDCZmlIHoque/assets/g075-g075-06-hide.png)

Masking changes their display. It does not delete or replace the stored values.

## Important behavior

Each stage can have a different value for the same variable. Masking a value hides it on screen but does not delete it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/guides-and-quickstarts/releases-and-environments/create-environment-variables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
