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

# AutoPilot for CI settings

> Turn AutoPilot for CI on or off, and set its policy, pins, runners, and provider limits for the organization, a repository, or a workflow.

You change AutoPilot for CI settings on the **Settings** tab of AutoPilot for
CI, or with the settings API. Settings apply at three levels: the organization,
a repository (`owner/name`), and one workflow
(`.github/workflows/ci.yml` in a repository). The
[routing job's](https://docs.costgraph.ai/costgraph/autopilot/ci.md#add-the-routing-job) inputs in the
workflow file can override or narrow some of them.

## How the levels combine

| Setting | Rule |
| - | - |
| `policy` | The narrowest level that sets it wins, and the workflow file's `policy` input wins over all of them. The default is `balanced`. |
| `pin` | Resolves like `policy`, with the workflow file's `pin` input. An empty list clears a pin from a wider level. A pinned provider must be allowed, and CostGraph refuses an entry it does not recognize. Refer to [Pin a workflow to a provider](https://docs.costgraph.ai/costgraph/autopilot/ci.md#pin-a-workflow-to-a-provider). |
| `allowed_providers` | Every level, including the workflow file's `providers` input, can only narrow the list. |
| `max_cores` | The smallest value at any level, including the workflow file's `max-cores` input, applies. |
| `allowed_os`, `allowed_arch` | Every level, including the workflow file's `allowed-os` and `allowed-arch` inputs, can only narrow the list. The API takes `x86_64` and `arm64`. The workflow inputs take `x64` and `arm64`. |
| `allow_gpu` | `false` at any level, including the workflow file's `allow-gpu` input, keeps AutoPilot off GPU runners. |
| `enabled` | Turning AutoPilot off at a level keeps every job below it on its default runner. Off for the organization, no level can turn it back on. |
| `paused_until` | Works like `enabled` until the given time. The latest pause at any level applies. |
| `release` | The narrowest level that sets it wins. Release jobs take the best runner without spreading and are never cancelled or re-run. |
| `usage_capture` | The narrowest level that sets it wins. On by default. `false` stops the runners AutoPilot launches from [measuring job usage](https://docs.costgraph.ai/costgraph/autopilot/ci.md#measure-job-usage). |

The workflow file cannot turn AutoPilot on or off, pause it, set provider
limits, or allow a provider or runner shape that CostGraph does not allow. A
job whose default runner is outside the runner limits keeps its default runner.
When the workflow file sets `policy`, `providers`, or a runner limit, the
workflow shows **Set in Git**.

## Read and change settings

Read the settings for a level with `GET`. Leave out `repository` and
`workflow_path` for the organization.

```bash theme={null}
curl -s "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings?repository=acme/api&workflow_path=.github/workflows/ci.yml" \
  -H "X-API-Key: $COSTGRAPH_API_KEY" -H "X-CostGraph-Tenant-ID: $TENANT_ID"
```

The response has the settings set at that level (`own`), the settings in
effect (`effective`), and the level each effective value comes from
(`inherited_from`). Reading needs the `focus:read` scope or the Member role.

Change settings with `PUT` on the same path. It replaces every setting at that
level, and a field you leave `null` inherits from the wider level. Changing
settings needs the Admin role and an active
[subscription](https://docs.costgraph.ai/costgraph/billing.md#features-that-need-a-subscription).

```json theme={null}
{"repository": "acme/api", "workflow_path": ".github/workflows/ci.yml", "policy": "cheapest", "allowed_providers": ["ubicloud", "blacksmith"], "pin": ["ubicloud"]}
```

## Runners

`GET /api/v1/tenant/ci/autopilot/labels` lists every runner CostGraph knows for
you, grouped by provider. The list includes GitHub-hosted runners, runners of
providers integrated with CostGraph, and labels you set. Pass `repository` and
`workflow_path` to see one level. Each runner has a state.

| State | Meaning |
| - | - |
| `allowed` | AutoPilot can choose the runner. |
| `blocked` | A setting blocks the runner. |
| `provider_off` | The runner's provider is not allowed. |
| `outside_limits` | The runner limits exclude the runner. |

To allow or block several runners at once, `PUT` a list for one level.

```json theme={null}
{"repository": "acme/api", "labels": [
  {"label": "warp-ubuntu-latest-x64-4x", "enabled": true},
  {"label": "ubicloud-standard-2", "enabled": false}
]}
```

Narrower levels inherit an allow. A block at any level wins, even over an allow
at a narrower level. CostGraph reads the provider, operating system,
architecture, and vCPUs from each label. If it does not recognize a label,
nothing is saved and the error names the label. To remove a setting so the
runner inherits again, send `DELETE` with `label` and the same `repository` and
`workflow_path`.

## Provider limits

Provider limits are set for the organization only. The
`GET /api/v1/tenant/ci/autopilot/providers` request lists every provider
AutoPilot can route to. Each has its limits and what routed jobs use now. `PUT` the limits for
one provider. A limit you leave `null` means no limit.

```json theme={null}
{"provider": "blacksmith", "max_concurrent": 20, "max_per_hour": 200, "daily_spend_cap": 50, "monthly_spend_cap": 800, "allow_secrets": true}
```

| Limit | Counts |
| - | - |
| `max_concurrent` | Routed jobs on the provider that have not finished. |
| `max_per_hour` | Jobs routed to the provider in the last hour. |
| `daily_spend_cap` | Estimated cost of jobs routed today, including the next one. |
| `monthly_spend_cap` | Estimated cost of jobs routed this month, including the next one. |
| `allow_secrets` | `true` by default. `false` keeps jobs that use secrets off the provider. Only jobs routed with `secrets: false` go there. |

A job skips a provider at a limit and takes the next best runner or its
default. AutoPilot checks limits from its own estimates when it routes a job.
Limits do not read the provider's bill or stop jobs that are already running.

## Sandbox runners

Three settings control jobs that [run in sandboxes](https://docs.costgraph.ai/costgraph/autopilot/ci-sandboxes.md)
with a CostGraph label. The narrowest level that sets each one wins. The
workflow file cannot set them.

| Field | Value |
| - | - |
| `fallback_target` | The sandbox a job goes to when no other sandbox started it, as the providers endpoint lists it, or `null`. CostGraph refuses a value that is not one of your connected sandboxes. |
| `fallback_after_seconds` | Seconds before the fallback sandbox gets the job. At least 60, or `null` for 300. |
| `baseline_label` | The runner these jobs are compared with for policy, trials, and savings, or `null`. |

```json theme={null}
{"fallback_target": "costgraph:microsandbox:sbx_ab12cd", "fallback_after_seconds": 180, "baseline_label": "ubuntu-24.04"}
```

## Suggest a provider

If the runner provider you use is not listed, ask for it through the support
chat in the CostGraph dashboard.


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