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

# Environments

> Reference for the Environment class

An `Environment` is a single VM in a `Session`. Access via `session.envs` or `session.get_env(alias)`.

```python theme={null}
session = plato.sessions.create(envs=[
    Env.simulator("espocrm", alias="crm"),
    Env.simulator("gitea", alias="git"),
])

crm = session.get_env("crm")
desktop = session.desktop_env       # or None
```

## Declaring envs

Build env configs with the `Env` helper, then pass to `plato.sessions.create(envs=[...])`.

```python theme={null}
from plato.v2 import Env, SimConfigCompute

Env.simulator("espocrm")                       # the sim's example version
Env.simulator("espocrm", alias="crm")          # name it
Env.artifact("artifact-abc123")                # pin to a specific version
Env.artifact("artifact-abc123", alias="crm")
Env.resource(                                  # blank VM with custom resources
    "custom-service",
    SimConfigCompute(cpus=4, memory=8192, disk=20000),  # MB
    alias="beefy-vm",
)
```

<Note>
  `Env.simulator(name)` boots whatever artifact is configured as the sim's example version. Not every sim has one set, and the example can change underneath you. For reproducible runs, grab an artifact ID from the sim's **Versions** list in the [Plato dashboard](https://plato.so) and use `Env.artifact(...)`.
</Note>

## Operations

### `reset()`

Reset just this env without touching others.

```python theme={null}
crm.reset()
```

### `get_state()`

```python theme={null}
state = crm.get_state()
print(state.mutations)
```

### `close()`

Tear down just this VM. Usually `session.close()` is what you want.

```python theme={null}
crm.close()
```

## `env.sdk` — sim-specific client

`env.sdk` lazy-loads the sim's own client based on the env's `simulator` field (resolved from `plato.sims.{name}`). For desktop envs (currently `ubuntu-vm`), this is the entire computer-use surface — see [Computer Use → Tools](/computer-use/tools).

```python theme={null}
desktop = session.desktop_env
desktop.sdk.status()
desktop.sdk.computer(...)
```

## Properties

| Property            | Type          | Description                                                        |
| ------------------- | ------------- | ------------------------------------------------------------------ |
| `job_id`            | `str`         | Unique VM/job identifier                                           |
| `alias`             | `str`         | Human-readable alias                                               |
| `simulator`         | `str \| None` | Sim name (e.g. `"espocrm"`, `"ubuntu-vm"`)                         |
| `artifact_id`       | `str \| None` | Source artifact ID                                                 |
| `is_desktop`        | `bool`        | True for desktop / computer-use envs                               |
| `mesh_ip`           | `str \| None` | WireGuard mesh IP                                                  |
| `internal_hostname` | `str`         | `{alias}.plato.internal` — reachable from other VMs in the session |
| `session_id`        | `str`         | Parent session ID                                                  |
