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

# Environments

> Create and manage the runtime environments your agents run in, and test a setup script before an agent depends on it.

An environment is a reusable template for where an agent runs: a base container image plus an optional setup script that prepares the container before the agent starts. Define an environment once and any number of agent versions can run in it.

Open the section by selecting **Environments** in the account navigation. It has two tabs:

| Tab              | What it lists                                                                  |
| ---------------- | ------------------------------------------------------------------------------ |
| **Environments** | The environment templates available to your account.                           |
| **Runtimes**     | The runtime containers created from those environments, active and historical. |

## Environments tab

The **Environments** tab lists each environment your account can use — the ones it owns, alongside public ones.

| Column     | Description                       |
| ---------- | --------------------------------- |
| Name       | The environment's name.           |
| Image      | The base container image it runs. |
| Visibility | **Public** or **Private**.        |
| Owner      | The account that owns it.         |

Select a row to open the environment's detail page.

## Create an environment

Select **Create environment** on the **Environments** page.

<Steps>
  <Step title="Name the environment">
    Names take lowercase letters, numbers, and the `-`, `_`, and `.` characters — the full pattern is `^[a-z0-9\-_.]+$`.
  </Step>

  <Step title="Choose a base image">
    Pick a **Base image** from the searchable picker, which lists your account's own container images alongside public ones.
  </Step>

  <Step title="Add a setup script (optional)">
    A **Setup script** is a bash script — for example one starting with `#!/usr/bin/env bash` — that runs during container setup, before the agent starts. Use it to install dependencies or otherwise prepare the container.
  </Step>
</Steps>

<Note>
  Visibility is not part of this form. A new environment is private, and making one public is handled separately.
</Note>

## Environment detail

An environment's detail page shows its name, image, visibility, owner, creation and update timestamps, and its full setup script. An environment with no setup script says so explicitly — it runs its image as-is.

### Test setup

**Test setup** checks a setup script before an agent depends on it. It boots a throwaway container from the environment, runs the setup script, and reports whether it completed, along with how long container creation took. A failure reports the cause and a suggested fix. From the result you can open the session or the runtime the test produced to read the full logs.

## Edit an environment

Select **Edit** on an environment's detail page to change its base image, its setup script, or both. Clearing the setup script removes it, and the environment then runs its image without one.

## Runtimes tab

The **Runtimes** tab lists the runtime containers created from your environments. Select one to open its runtime detail page, which carries that container's events and setup logs.

### Setup logs

Where a runtime captured the full output of its setup script, its detail page shows a **Setup Logs** field and a download button per stream in the **Logs** card header — **Download full stdout log** and **Download full stderr log**.

A runtime whose setup succeeded shows no buttons. The same downloads are offered on the failure event in the session view — see [Setup log downloads](/platform/sessions#setup-log-downloads).
