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

# Environment Variables

Environment variables store configuration values—such as API keys, endpoint URLs, and tokens—that the app references at runtime. Define a value once and reuse it across tools and workflows without hard-coding it.

**Key benefits:**

* **Centralized management** — Define values once; reference them anywhere in the app.
* **Secure storage** — Sensitive values can be encrypted and hidden in the UI.
* **Environment-specific values** — Override defaults per deployment environment.

Environment variables are accessible to both **Code Tools** and **Workflow Tools**.

***

## View Environment Variables

Go to **Settings** > **Variables** to see all variables defined for the app.

***

## Create an Environment Variable

1. Go to **Settings** > **Variables**.

2. Click **+ New Variable**.

3. Fill in the following fields:

   | Field             | Description                                                                                       |
   | ----------------- | ------------------------------------------------------------------------------------------------- |
   | **Variable Name** | Unique identifier for the variable.                                                               |
   | **Description**   | Brief description of the variable's purpose.                                                      |
   | **Default Value** | Value used unless overridden during deployment.                                                   |
   | **Encryption**    | When enabled, the variable is encrypted and hidden in the UI.                                     |
   | **Namespace**     | Logical group for organizing related variables. Select an existing namespace or create a new one. |

4. Click **Create**.

***

## Edit an Environment Variable

1. In the Variables list, open the options menu for the variable.
2. Select **Edit**.
3. Update the fields as needed.
4. Click **Save**.

Changes automatically propagate to all modules that reference the variable.

***

## Delete an Environment Variable

Deleting a variable removes it permanently. The Platform doesn't resolve the references to the deleted variable. To delete, open the options menu for the variable, and select **Delete**.

<Note>To remove a variable associated with a namespace, remove the namespace first.</Note>

***

## Namespaces

A namespace is a logical group for organizing environment variables. Namespaces prevent naming conflicts and allow different modules to use variables with the same name independently.

A **Default** namespace is available out of the box for every app. New variables are automatically assigned to the Default namespace. You can create and assign custom namespaces when needed.

| Benefit                 | Description                                                                                       |
| ----------------------- | ------------------------------------------------------------------------------------------------- |
| **Organization**        | Group related variables—such as those for authentication or third-party integrations.             |
| **Conflict prevention** | Avoid clashes when multiple modules need variables with identical names (for example, `API_KEY`). |
| **Scoped access**       | Only variables within an associated namespace are accessible to a tool.                           |

### Create and Manage a Namespace

1. Click **Manage Namespaces** and select **+ Create Namespace**.

2. Fill in the following fields:

   | Field           | Description                                   |
   | --------------- | --------------------------------------------- |
   | **Name**        | Unique identifier for the namespace.          |
   | **Description** | Brief description of the namespace's purpose. |

3. Click **Create**.

To update or delete a namespace, open **Options** and select the action. Use **Preview** to view the variables and modules associated with the namespace.

<Note>You can't delete a namespace that's associated with a tool. You must remove all variables within the namespace to delete the namespace.</Note>

***

## Access Environment Variables in Tools

To use an environment variable in a tool, the variable must belong to a namespace associated with that tool.

1. Go to the tool. Click **Options** > **Manage Namespaces**.
2. Associate the relevant namespace and click **Save**.
3. Reference the variable in a script using the format `env.<variable-name>`. `env` is a reserved keyword.
4. To reference the variable in other fields such as prompts or parameters, use the format `{{env.<variable-name>}}`.

***

## Variable Lifecycle

Environment variables are defined at the app level and can hold different values per deployment environment.

| Stage                                                       | Behavior                                                                                                           |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **Variable creation**                                       | A default value can be assigned. This value is used when new versions and environments are created.                |
| **New app version**                                         | All existing variables carry forward. Review variables and defaults before proceeding.                             |
| **New deployment environment**                              | The environment uses default values initially. Click **Review Variables** to override values for that environment. |
| **Deploying an updated version to an existing environment** | Choose to use default values or apply custom values for that deployment.                                           |

***

## API Support

The Platform provides APIs to update environment variable values dynamically at runtime. Contact the Support Team for access.
