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

# Resources

> Managing environment resources.

Tasks declare resources in `task.toml`. Harbor applies CPU and memory using **enforcement policies**; storage, GPU, and TPU requests are passed through when the provider supports them.

## Task fields

```toml theme={"system"}
[environment]
cpus = 2
memory_mb = 4096
storage_mb = 10240
gpus = 1
gpu_types = ["H100", "A100"]

[environment.tpu]   # optional; GKE only
type = "v6e"
topology = "2x4"
```

| Field | Description |
| - | - |
| `cpus` | CPU count |
| `memory_mb` | RAM in MB |
| `storage_mb` | Ephemeral disk in MB |
| `gpus` | GPU count |
| `gpu_types` | Acceptable GPU types (optional) |
| `tpu.type` | TPU accelerator type — alias (`v6e`, `trillium`, `v4`) or GKE label (`tpu-v6e-slice`) |
| `tpu.topology` | TPU topology as `NxM` or `NxMxK` (required; chip count = product of dimensions) |

All fields are optional. Omitted fields use the provider's default sizing.

[Separate verifier sandboxes](/tasks/separate-verifier) can set their own values under `[verifier.environment]`.

## Enforcement policies

CPU and memory each get an independent policy. Set them via `--cpus` / `--memory`, or `cpu_enforcement_policy` / `memory_enforcement_policy` in job or trial config.

| Policy | Meaning | Requires `cpus` / `memory_mb`? |
| - | - | - |
| `auto` | Use the provider's default mode | No |
| `limit` | Hard ceiling only | Yes |
| `request` | Reservation only, no ceiling | Yes |
| `guarantee` | Both reservation and hard ceiling | Yes |
| `ignore` | Do not pass the value to the provider | No |

<Tabs>
  <Tab title="CLI">
    ```bash theme={"system"}
    harbor run -p "<path/to/dataset>" -m "<model>" -a "<agent>" \
      -e docker --cpus limit --memory guarantee
    ```
  </Tab>

  <Tab title="Config">
    ```yaml theme={"system"}
    environment:
      type: docker
      cpu_enforcement_policy: limit
      memory_enforcement_policy: auto
    ```
  </Tab>
</Tabs>

You can override resource values at runtime:

<Tabs>
  <Tab title="CLI">
    ```bash theme={"system"}
    harbor run -p "<path/to/dataset>" -m "<model>" -a "<agent>" \
      --override-cpus 4 \
      --override-memory-mb 8192 \
      --override-storage-mb 20480 \
      --override-tpu v6e=2x4
    ```
  </Tab>

  <Tab title="Config">
    ```yaml theme={"system"}
    environment:
      override_cpus: 4
      override_memory_mb: 8192
      override_storage_mb: 20480
      override_tpu:
        type: v6e
        topology: 2x4
    ```
  </Tab>
</Tabs>

## Provider support

Harbor validates policies at the start of a job. Unsupported combinations fail before trials run. `limit` and `guarantee` require limit support; `request` and `guarantee` require request support.

Storage, GPUs, and TPUs do not have enforcement policies. Harbor passes their declared values to providers that support them.

| Capability | Environments |
| - | - |
| CPU and memory limits | `apple-container`, `cwsandbox`, `docker`, `ec2`, `gke`, `modal`, `opensandbox`, `openshift`, `podman`, `skypilot`, `runta`, `prime` |
| CPU requests | `beam`, `cwsandbox`, `daytona`, `e2b`, `gke`, `hyperbrowser`, `islo`, `modal`, `novita`, `openshift`, `runloop`, `skypilot`, `tensorlake`, `vercel`, `runta` |
| Memory requests | `beam`, `blaxel`, `cwsandbox`, `daytona`, `e2b`, `gke`, `hyperbrowser`, `islo`, `modal`, `novita`, `openshift`, `runloop`, `skypilot`, `tensorlake`, `vercel`, `runta` |
| Storage sizing | `ack`, `daytona`, `gke`, `hyperbrowser`, `islo`, `langsmith`, `runloop`, `runta`, `tensorlake`, `use-computer`, `prime` |
| GPU allocation | `beam`, `daytona`, `gke`, `modal`, `opensandbox`, `prime`, `docker` |
| TPU allocation | `gke` |

## Validation

| Check | When |
| - | - |
| Policy vs provider | Job creation |
| Missing value for non-`auto`/`ignore` policy | Environment start |
| GPU / TPU / internet requirements | Environment start |
| GPU and TPU both set (GKE) | Environment start |


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