> ## Documentation Index
> Fetch the complete documentation index at: https://agent-compass.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Recipes

> Understand automatic image, workspace, resource, and provider adaptation.

Recipes are AgentCompass's provider-adaptation layer. They translate portable benchmark task metadata into the
provider-specific image, workspace, resource, network, and execution settings required to run that task.

A recipe exists because neither side of this translation should own it. A benchmark should describe what a task
requires without branching on Docker, Modal, or Daytona APIs. An environment provider should create a sandbox from a
resolved plan without knowing the conventions of every benchmark. Requiring users to repeat this mapping in every CLI
command would make otherwise equivalent runs provider-specific and difficult to reproduce.

Recipes bridge that boundary after AgentCompass builds the initial execution plan and before it opens the environment:

```text theme={"system"}
benchmark task metadata + explicit user settings
                    ↓
           compatible recipe
                    ↓
        resolved execution plan
                    ↓
          environment provider
```

## Design Principles

| Principle                   | What it means                                                                                                                     |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| Keep components independent | Benchmarks remain provider-neutral, while environment providers remain benchmark-agnostic.                                        |
| Preserve user intent        | Explicit CLI, SDK, and configuration values take precedence; recipes fill or adapt values that the user did not override.         |
| Adapt per task              | A recipe may select a different image, workspace, or resource profile for each task from stable task metadata.                    |
| Fail before startup         | Missing images, snapshots, incompatible layouts, and unsupported combinations are reported before an expensive sandbox is opened. |

For most evaluations, users do not select a recipe manually. Choose the benchmark and environment normally;
AgentCompass matches compatible built-in recipes for each task. Use recipe flags only when you need to restrict that
matching for debugging or load a trusted external adaptation package.

## What Recipes Own

<CardGroup cols={2}>
  <Card title="Image selection" icon="package">
    Read public Docker image metadata or provider snapshots and set provider params.
  </Card>

  <Card title="Workspace layout" icon="folder-tree">
    Align benchmark workspaces such as `/testbed`, `/workspace`, or `/root`.
  </Card>

  <Card title="Resource hints" icon="cpu">
    Merge task CPU, memory, disk, GPU, or provider resources without overwriting explicit user overrides.
  </Card>

  <Card title="Network policy" icon="shield">
    Apply benchmark-aligned setup, rollout, and verifier policies and add required endpoint hosts when supported.
  </Card>

  <Card title="Verifier environment" icon="flask-conical">
    Prepare provider settings for a fresh verifier sandbox when the benchmark's grading flow requires one.
  </Card>

  <Card title="Compatibility failure" icon="shield-alert">
    Fail before sandbox startup when a required image, snapshot, or task metadata field is missing.
  </Card>
</CardGroup>

Recipes do not execute commands, create sandboxes, score results, or call model APIs.

## Using Recipes

By default, AgentCompass evaluates the registered recipes against each task and applies the compatible ones automatically. Matching can consider the benchmark, environment provider, task image metadata, workspace requirements, and current execution plan.

Explicit user values keep the highest priority. For example, a recipe may supply a task image and default memory from benchmark metadata, while an explicit `--env-params '{"memory":"8g"}'` preserves the requested memory override.

Restrict automatic matching when reproducing or debugging one recipe:

```bash theme={"system"}
agentcompass run <benchmark> <harness> "$MODEL_NAME" \
  --env <environment> \
  --recipe <recipe-id>
```

`--recipe` is repeatable. An empty recipe selection uses all compatible built-in recipes.

## Trusted External Recipes

Load a private recipe package for one run with a repeatable `--recipe-dir` option:

```bash theme={"system"}
agentcompass run <benchmark> <harness> "$MODEL_NAME" \
  --env <environment> \
  --recipe-dir ./company_recipes \
  --recipe company_swe_recipe
```

Python callers use `recipe_dirs=["./company_recipes"]`, and configuration files use `runtime.recipe_dirs`. External recipe packages execute as trusted Python code in the AgentCompass process. See [Environment Integration](/en/developer_guide/environment_integration) for provider precedence, lifecycle boundaries, and validation requirements.

## Example: Modal SWE-bench Verified

```bash theme={"system"}
export MODAL_TOKEN_ID="..."
export MODAL_TOKEN_SECRET="..."

agentcompass run \
  swebench_verified \
  mini_swe_agent \
  "$MODEL_NAME" \
  --env modal \
  --benchmark-params '{"sample_ids":["astropy__astropy-12907"]}' \
  --model-base-url "$MODEL_BASE_URL" \
  --model-api-key "$MODEL_API_KEY"
```

The `swebench_verified_modal_prebaked` recipe can derive the image from SWE-bench metadata or instance id and set the workspace root to `/testbed`.

## Example: Daytona Terminal-Bench

```bash theme={"system"}
export DAYTONA_API_KEY="..."

agentcompass run \
  terminal_bench_2 \
  terminus2 \
  "$MODEL_NAME" \
  --env daytona \
  --benchmark-params '{"sample_ids":["<task-id>"]}' \
  --model-base-url "$MODEL_BASE_URL" \
  --model-api-key "$MODEL_API_KEY"
```

The Terminal-Bench Daytona recipe reads `task.environment.docker_image`, sets the environment image, and uses `/root` as the default workspace root.

## Example: ResearchClawBench Sandboxes

ResearchClawBench has built-in recipes for Docker, Daytona, and Modal. When no image or provider-native artifact is
supplied explicitly, the compatible recipe selects the ResearchHarness runner image and configures `/workspace` where
the remote provider requires a workspace root. The normal benchmark command therefore does not need an
`--env-params` image override:

```bash theme={"system"}
agentcompass run researchclawbench researchharness "$MODEL_NAME" \
  --env docker \
  --benchmark-params '{"judge_model":{"id":"<judge-model>","base_url":"<judge-base-url>","api_key":"${JUDGE_MODEL_API_KEY}"}}' \
  --harness-params '{"serper_api_key":"${SERPER_API_KEY}","jina_api_key":"${JINA_API_KEY}","mineru_token":"${MINERU_TOKEN}"}' \
  --model-base-url "$MODEL_BASE_URL" \
  --model-api-key "$MODEL_API_KEY"
```

An explicit Docker image, Daytona image/snapshot, or Modal image remains higher priority than the recipe fallback.

## User Overrides

| Override                               | Effect                                                                      |
| -------------------------------------- | --------------------------------------------------------------------------- |
| `--env-params '{"image":"..."}'`       | Force a provider image when the recipe supports registry images.            |
| `--env-params '{"named_image":"..."}'` | Use a named Modal image when supported.                                     |
| `--env-params '{"snapshot":"..."}'`    | Use a provider snapshot instead of an inferred image when supported.        |
| Phase network fields in `--env-params` | Override setup, rollout, or verifier access for a deliberate custom policy. |
| `--recipe <recipe_id>`                 | Restrict enabled recipes to explicit ids.                                   |
| `--recipe-dir <package_dir>`           | Load a trusted external recipe package for this run; repeatable.            |

Do not pass `image` just because a benchmark is remote. If a recipe can infer the task image, the shorter command is more reproducible.

## Recipe Families In This Repo

| Benchmark family                                  | Providers                                    |
| ------------------------------------------------- | -------------------------------------------- |
| SWE-bench Verified                                | `host_process`, `docker`, `modal`, `daytona` |
| SWE-bench Multilingual / Pro and DeepSWE          | `docker`, `modal`, `daytona`                 |
| Terminal-Bench 2 / 2.1 / Verified                 | `docker`, `modal`, `daytona`                 |
| PinchBench and GDPval-AC                          | `docker`, `modal`, `daytona`                 |
| ResearchClawBench                                 | `docker`, `modal`, `daytona`                 |
| TauBench, WildClawBench, and Frontier Engineering | `docker`                                     |

## Related Pages

* [Environments](/en/user_guide/modules/environments/overview)
* [Network Policy](/en/user_guide/modules/environments/network)
* [Sandbox Resource Limits](/en/user_guide/modules/environments/resource_limits)
* [Benchmarks](/en/user_guide/modules/benchmarks/overview)
* [Configuration](/en/user_guide/overview#configuration-files-and-precedence)
* [Environment Integration](/en/developer_guide/environment_integration)
