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

# Environments

> Configure deployment targets with approval workflows and environment-specific tokens.

Environments define where releases get deployed. Each environment can have its own approval requirements and evaluation token. Access from Settings → Environments within a project.

## Virtual vs external environments

GoRules supports two types of environments:

| Type     | How it works                                          | Best for                          |
| -------- | ----------------------------------------------------- | --------------------------------- |
| Virtual  | Rules hosted in BRMS, evaluated via API               | Simple deployments, lower volume  |
| External | Rules pushed to object storage, pulled by agents/SDKs | High performance, edge deployment |

### Virtual environments

Virtual environments host releases directly in the BRMS. Your applications call the BRMS API to evaluate decisions.

```mermaid theme={null}
flowchart LR
    app["Your App"] --> brms["GoRules BRMS"]
    subgraph brms["GoRules BRMS"]
        staging["staging: v1.2.0"]
        production["production: v1.1.0"]
    end
```

**Use when:**

* You want the simplest deployment
* Your rules volume fits BRMS capacity
* You prefer API-based evaluation

### External environments

External environments push releases to object storage (S3, Azure, GCS). Agents or embedded SDKs pull rules and evaluate locally with sub-millisecond latency.

```mermaid theme={null}
flowchart LR
    brms["BRMS"] -->|publish| storage["Object Storage"]
    storage -->|pull| agent["Agent / SDK"]
    app["Your App"] --> agent
```

**Use when:**

* You need maximum performance
* You're using the GoRules Agent
* You want rules at the edge or need offline capability

For external environments, configure your storage provider in [Deployments](/brms/setup/deployments).

## Creating an environment

1. Go to Settings → Environments
2. Click "Add environment"
3. Configure the environment:
   * **Name**: Descriptive identifier (e.g., "staging", "production")
   * **Type**: Virtual or External
   * **Deploy approval mode**: How deployments are approved
4. Click Create

## Deploy approval modes

Control who can deploy to each environment.

| Mode            | Description                                                 |
| --------------- | ----------------------------------------------------------- |
| None            | Deployments proceed immediately without approval            |
| Open Request    | Creates a request for visibility before deployment proceeds |
| Single Approval | One designated user must approve the deployment             |
| Group Approval  | One member from each assigned group must approve            |

### Choosing an approval mode

**None**: Use for development environments where speed matters more than oversight.

**Open Request**: Use when you want visibility into deployments without blocking them.

**Single Approval**: Use for staging environments where one reviewer is sufficient.

**Group Approval**: Use for production environments requiring sign-off from multiple teams.

## Environment properties

Each environment displays the following information:

| Property          | Description                                   |
| ----------------- | --------------------------------------------- |
| Name              | Environment identifier                        |
| Evaluation token  | Auto-generated API token for this environment |
| Deploy protection | Current approval mode                         |
| Release           | Currently deployed release version            |

## Managing environments

### Viewing status

The environments table shows all configured environments. Click Refresh to update deployment status and see the latest deployed release.

### Environment tokens

Each environment receives its own evaluation token. Use this token when your application needs to evaluate rules for a specific environment.

Tokens are masked by default. Click the copy button to add the token to your clipboard.

### Editing an environment

Click the edit action on any environment to modify:

* Name
* Deploy approval mode
* Approver groups (for Group Approval mode)

### Deleting an environment

Remove environments you no longer need. This revokes the environment's evaluation token and removes it as a deployment target.
