# Spaces

Each shared [space](/docs/spaces/) is a folder in `spaces/`. The folder's name is the space's slug, and a `space.yaml` inside describes it.

## Declare a space

All a space needs is a `space.yaml` with a name:

```yaml title="spaces/engineering/space.yaml"
name: Engineering
```

Everything else the space has goes in the same folder: its instructions, memory, agents, apps, automations and channels. [Configuration files](/docs/developers/iac/configuration/#folder-layout) shows where each one goes.

## Fields

| Key                           | What it sets                                                                                                                        |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `name`                        | Required. The name shown in Ren.                                                                                                    |
| `description`                 | The space's description                                                                                                             |
| `settings`                    | The space's model, steps, permissions and repositories. See [Organization → Settings](/docs/developers/iac/organization/#settings). |
| `brainScope`, `brain`, `hand` | Where the space's chats run. See [Runtime](#runtime).                                                                               |
| `uses`                        | Agents of other spaces that this space uses. See [Agents](/docs/developers/iac/agents/#share-an-agent).                             |
| `factory`                     | The space's factory. See [Factory](/docs/developers/iac/factory/).                                                                  |
| `renamedFrom`                 | Earlier slugs. See [Rename, move and remove](/docs/developers/iac/plan-and-apply/#rename-move-and-remove).                          |

```yaml title="spaces/engineering/space.yaml"
name: Engineering
description: Plans, builds and reviews the Acme example app.
settings:
  permissions:
    - action: shell
      resource: rm -rf *
      effect: deny
```

## Runtime

A space's chats run on two kinds of [machine](/docs/machines/). The brain runs the agent itself, and the hand runs the agent's file and shell tools. `brainScope`, `brain` and `hand` choose them, as the space's [Compute](/docs/compute/) page does. Most spaces can leave all three out and use the defaults.

| Key                 | Values                                                                                                                                 | Default                    |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| `brainScope`        | `space` (**Per space**): all chats share one brain. `session` (**Per chat**): each chat gets its own.                                  | `space`                    |
| `brain.provider`    | Where the brain runs. `ren environment provider brains` lists the choices.                                                             | Ren's default provider     |
| `brain.environment` | A machine of that provider, by its name in `environments.yaml`                                                                         | **Ren's standard machine** |
| `hand.placement`    | `colocated`: tools run on the brain's machine. `remote`: on the machine that `hand.environment` names. `none`: no file or shell tools. | `colocated`                |
| `hand.environment`  | A machine, by its name in `environments.yaml`. Required with `remote`.                                                                 |                            |

This space gives each chat its own brain and runs its tools on the `Web build` machine, which [`environments.yaml`](/docs/developers/iac/machines/) declares:

```yaml title="spaces/engineering/space.yaml"
name: Engineering
brainScope: session
hand:
  placement: remote
  environment: Web build
```

A runtime change takes effect when the brain next starts. [Compute](/docs/compute/#apply-a-change) explains when that is, and how to shut the space down to apply the change now.

## Remove a space

Deleting a space's folder archives the space along with its agents, apps, automations and channels. The organization's first space is the exception: Ren never archives it.

## Personal spaces

The spec covers shared spaces only, so pull leaves personal spaces out. They still share names with the rest of the organization: a shared space can't take a personal space's slug, and an agent can't take the name of an agent in one.