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

# API: Repo Ablations

> Change every approved task's files once, then run the tasks as built, alone or with a saved harness.

An environment runs one script in every approved task's image and builds each task with the change. Pass its `id` in `environments` when you [start a comparison](https://docs.selfbench.dev/api/evaluate.md#harnesses-and-environments), alone or with each [saved harness](https://docs.selfbench.dev/api/harnesses.md) picked.

| Method | Route | Does |
| - | - | - |
| `GET`, `POST` | `{repo}/environments` | List environments, or create one and build every approved task in it |
| `GET`, `DELETE` | `{repo}/environments/{id}` | One environment with each task's check, or delete it |
| `POST` | `{repo}/environments/{id}/build` | Build the approved tasks it lacks or that failed |

## Request Body

| Route | Body |
| - | - |
| `POST {repo}/environments` | `{ environment: { name, script }, generation }` |

`script` is Bash of at most 64 KB, run in `/app` as the image is built, before the agent starts: `"rm -f AGENTS.md CLAUDE.md\npnpm add next@15.5.0"`. It stops at the first command that fails, and that task's build fails with it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.