ferro.toml Reference
Repository-level configuration parsed by ferro-cli (crates/ferro-cli/src/config.rs) and ferro-agent after Git checkout for webhook CI runs, generated directly from ferro.toml.example.
Workspace discovery
Place ferro.toml in your repository root (or generate a starter file with ferro init). When you invoke ferro run from any subdirectory, the CLI walks upward to the nearest ancestor containing ferro.toml or .git and loads the configuration from that workspace root.
Configuration keys
projectstring (optional)Project slug in your Ferro organization. Links CLI offload runs to a project in the dashboard and determines which Git repository is used if a run falls back to Relay Mode.
default_commandstring (optional)Default shell command executed when running `ferro run` without passing an explicit command argument.
labelsstring[]Required runner capability labels used when selecting an eligible BYO-Metal node for offload or queued relay runs.
ignorestring[]Additional gitignore-style patterns excluded during content-addressed SHA-256 delta sync. `.git`, `.ferro`, `node_modules`, `target`, `.next`, `dist`, `build`, `__pycache__`, and `.venv` are already excluded by default, along with local/parent/global `.gitignore` rules and `.ferroignore`.
include_sensitivestring[]Explicit opt-in patterns to re-include files blocked by the built-in sensitive file denylist (`.env`, `.env.*` except `.env.example`/`.env.sample`, `*.pem`, `*.key`, `*.p12`, `*.pfx`, `id_rsa*`, `id_ed25519*`, `id_ecdsa*`, `.ssh/`, `.aws/`, `.gnupg/`, `.npmrc`, `.pypirc`, `.netrc`, `.docker/config.json`, `*.kdbx`, `credentials.json`, `service-account*.json`, `terraform.tfstate*`). Leave empty unless a test fixture genuinely must be synced.
max_file_mbinteger (MiB)Maximum size in MiB for any single file uploaded during delta sync. Larger files are skipped and listed before execution.
cache_pathsstring[]Workspace-relative dependency or build directories restored from the runner's warm NVMe cache before execution and saved back atomically afterwards (copy-on-restore outside the sandbox so jobs never mutate shared cache entries). Sent with CLI runs and read from the checked-out `ferro.toml` on webhook CI runs. When omitted, Ferro detects defaults from workspace lockfiles: bun/npm/pnpm/yarn lockfiles → `node_modules`, `Cargo.lock` → `target`, and `uv.lock`/`poetry.lock`/`pdm.lock`/`Pipfile.lock` → `.venv`.
cache_key_filesstring[]Workspace-relative files (typically lockfiles like `bun.lock` or `Cargo.lock`) whose SHA-256 content hashes form part of the cache key alongside org, project, branch/PR trust scope, and OS/arch. When a lockfile changes and the exact key misses, Ferro falls back to the most recent compatible cache for the same project/path (restore keys). Untrusted fork PR runs (`trusted = false`) may read the default-branch cache read-only but never write to it—they save only to a PR-scoped key.
cache_save_on_failurebooleanWhen `true`, saves updated `cache_paths` back to the runner's warm cache even if the command exits with a non-zero status (useful for preserving partial dependency installs or compiler artifacts). Cancelled and timed-out runs are never saved.
timeout_secsinteger (seconds)Maximum run execution duration in seconds. The control plane clamps values to the range 10..7200 seconds.
artifactsstring[]Workspace-relative glob patterns collected into a tar+zstd archive after the job exits. Rejects path traversal (`..`), absolute paths, and symlinks escaping the workspace; plan-based per-run byte and file caps apply.
artifacts_on"always" | "success" | "failure"Controls when matched build artifacts are archived and uploaded after the job exits.
test_reportsstring[]Workspace-relative glob patterns for JUnit XML test report files uploaded after the job exits and parsed safely (XXE-disabled) into the dashboard Tests tab and GitHub commit status summaries.
pipeline.cancel_in_progressbooleanWhen `true`, a newer push or pull request run for the same project and concurrency group atomically cancels older queued runs (`cancelled (superseded)`) and requests cancellation on older running runs. Untrusted fork PRs can never cancel trusted branch runs.
pipeline.concurrency_groupstring template (optional)Template identifying the concurrency group for `cancel_in_progress`. Supports `${branch}`, `${pr_number}`, `${pr}`, `${ref}`, `${project}`, and `${trigger}`.
pipeline.on.pathsstring[] (globs)Repository-relative glob patterns (`*`, `**`, `?`) matched against changed files. When non-empty, runs are marked `skipped (paths)` unless at least one changed file matches.
pipeline.on.paths_ignorestring[] (globs)Repository-relative glob patterns excluded from triggering a run. If every changed file matches `paths_ignore`, the run is marked `skipped (paths)`.
pipeline.on.push.branchesstring[] (globs)Glob patterns matched against the pushed branch name on GitHub `push` events (prefix a pattern with `!` to exclude it). Non-matching pushes are recorded as `skipped (branch)`.
pipeline.on.pull_request.branchesstring[] (globs)Glob patterns matched against the pull request base branch on GitHub `pull_request` events. Non-matching PRs are recorded as `skipped (branch)`.
pipeline.services[].namestring (optional)Human-readable identifier for a sibling service container (alphanumeric, `.`, `-`, `_`) shown in run logs.
pipeline.services[].imagestring (required)OCI container image started as a sibling container via rootless `podman` (preferred) or `docker` on the runner node. Fails clearly if no container runtime is available.
pipeline.services[].portsstring[] | integer[]Ports exposed on loopback (`127.0.0.1`) so job steps can connect via `localhost:<port>`. Accepts `"5432"` or `"5432:5432"` (`host:container`).
pipeline.services[].envtable<string, string>Environment variables passed into the sibling service container via the runtime process environment (never exposed in container CLI argv).
pipeline.services[].health_cmdstring (optional)Shell command executed inside the service container via `podman/docker exec` until it exits 0 before step 1 begins.
pipeline.steps[].namestring (required)Display name of the step shown in the Run Inspector, streamed log boundaries (`==> [step i/n]`), and GitHub Check Run summaries.
pipeline.steps[].runstring (required)Shell command executed sequentially inside the shared sandboxed run workspace.
pipeline.steps[].timeout_secsinteger (seconds, optional)Per-step execution timeout in seconds (1..7200), capped by the overall run timeout.
pipeline.steps[].envtable<string, string>Step-scoped environment variables merged on top of base job env and project secrets for this step only.
pipeline.steps[].working_directorystring (optional)Workspace-relative subdirectory in which to run the step. Validated lexically and via filesystem canonicalization to prevent `..` or symlink traversal outside the workspace.
pipeline.steps[].continue_on_errorbooleanWhen `true`, a non-zero exit code (or per-step timeout) records the step as failed/timed out but allows subsequent steps to run without failing the overall run.
Warm dependency cache & trust rules
Before launching the per-run sandbox, ferro-agent restores each configured (or lockfile-detected) path in cache_paths from its agent-private warm cache store (<work_dir>/cache/warm/<org>/<project>/<key>/<path>) into the run's workspace using copy-on-restore (never mutable hardlinks). The sandboxed job only sees its private workspace copy; modifying restored files inside a job can never corrupt the stored cache. After the job exits (on success, or also on failure when cache_save_on_failure = true), the agent saves updated cache directories back atomically via a temporary staging directory and rename.
Lockfile defaults: When cache_paths or cache_key_files are omitted, Ferro inspects the workspace root and automatically caches node_modules (for bun.lock, bun.lockb, package-lock.json, npm-shrinkwrap.json, pnpm-lock.yaml, yarn.lock), target (for Cargo.lock), and .venv (for uv.lock, poetry.lock, pdm.lock, Pipfile.lock).
Restore keys & branch fallback: Cache keys combine the org, project, branch/PR scope, OS/arch, and the SHA-256 digest of all cache_key_files. When a lockfile changes and the exact key misses, Ferro falls back to the most recently used compatible cache for the same project and path (preferring the current branch, then the project's default branch).
Fork PR & untrusted cache trust rules
Caches are strictly isolated per organization and project. Runs with trusted = false (such as untrusted fork pull requests) may read the project's default-branch cache via an isolated copy-on-restore, but never write to it—even if the fork branch is named main. Untrusted runs write only to an isolated PR-scoped key (pr-<number>), and trusted runs never read from untrusted PR caches.
Automatic LRU eviction: ferro-agent enforces size-based LRU caps at startup and after each run (skipping any entries pinned by active runs), configured via FERRO_CACHE_MAX_GB (default 20 GiB), FERRO_BLOBS_MAX_GB (default 10 GiB), and FERRO_MIRRORS_MAX_GB (default 10 GiB).
Multi-step pipelines, filters & services
Single-command projects continue to work unchanged using ciCommand (for webhooks) or default_command / ferro run <cmd>. When a repository adds a [pipeline] section to ferro.toml, Ferro executes each [[pipeline.steps]] entry sequentially inside the same sandboxed workspace:
- Warm cache lifecycle:
ferro-agentrestores warm dependency caches once before step 1 and saves them atomically once after the final step. - Per-step isolation & controls: Each step supports its own
env,timeout_secs,continue_on_error, andworking_directory(verified lexically and after symlink canonicalization to remain inside the workspace). Steps stop on the first non-zero exit unlesscontinue_on_error = true. - Branch & path filters: GitHub App webhooks fetch
ferro.tomland changed files before enqueuing so non-matching commits are recorded immediately asskipped (branch)orskipped (paths)with a GitHub Check Run conclusion ofskipped. When pre-enqueue inspection isn't available (e.g. legacy webhooks),ferro-agentevaluates filters right after checkout. - Atomic cancel-in-progress: Setting
cancel_in_progress = truecancels older queued runs immediately (cancelled (superseded)) under a PostgreSQL advisory lock so they can never be double-claimed, and signals older running jobs to terminate. Untrusted fork PRs are always isolated into separate concurrency groups and cannot cancel trusted branch runs. - Sibling service containers: Optional
[[pipeline.services]]start before step 1 via rootlesspodman(preferred) ordocker, bind published ports exclusively on127.0.0.1(reachable atlocalhost), wait forhealth_cmd(or loopback TCP readiness), and are torn down at run end. If no container runtime is installed on the runner, the run fails clearly rather than faking service startup.
Migrating from GitHub Actions
Mapping an existing .github/workflows/ci.yml to ferro.toml takes a few lines—no runner minutes billing and the same warm NVMe cache across every step.
| GitHub Actions YAML | Ferro ferro.toml |
|---|---|
| on.push.branches | [pipeline.on.push] branches = [...] |
| on.pull_request.branches | [pipeline.on.pull_request] branches = [...] |
| on.*.paths / paths-ignore | [pipeline.on] paths / paths_ignore |
| concurrency.group + cancel-in-progress | [pipeline] concurrency_group + cancel_in_progress |
| jobs.<id>.services | [[pipeline.services]] (image, ports, env, health_cmd) |
| jobs.<id>.steps | [[pipeline.steps]] (name, run, env, working_directory, timeout_secs, continue_on_error) |
on: push: branches: [main, 'release/*'] paths-ignore: ['docs/**', '**/*.md'] pull_request: branches: [main]concurrency: group: ${{ github.ref }} cancel-in-progress: truejobs: test: runs-on: ubuntu-latest services: postgres: image: postgres:16-alpine ports: ['5432:5432'] env: POSTGRES_PASSWORD: ferro options: --health-cmd pg_isready steps: - uses: actions/checkout@v4 - name: Install run: bun install --frozen-lockfile - name: Test API working-directory: packages/api env: DATABASE_URL: postgres://postgres:ferro@localhost:5432/postgres run: bun testproject = "my-app"cache_paths = ["node_modules"]cache_key_files = ["bun.lock"][pipeline]cancel_in_progress = trueconcurrency_group = "${branch}"[pipeline.on]paths_ignore = ["docs/**", "**/*.md"][pipeline.on.push]branches = ["main", "release/*"][pipeline.on.pull_request]branches = ["main"][[pipeline.services]]name = "postgres"image = "postgres:16-alpine"ports = ["5432:5432"]env = { POSTGRES_PASSWORD = "ferro" }health_cmd = "pg_isready -U postgres"[[pipeline.steps]]name = "Install"run = "bun install --frozen-lockfile"[[pipeline.steps]]name = "Test API"working_directory = "packages/api"env = { DATABASE_URL = "postgres://postgres:ferro@localhost:5432/postgres" }run = "bun test"Built-in sensitive file protection
Automatic workspace scanner filtering
During ferro run, the workspace scanner automatically honors local, parent, and global .gitignore files plus .ferroignore, skips symlinks and files larger than max_file_mb (default 32 MiB), and excludes common secret files (.env, *.pem, *.key, .ssh/, .aws/, .npmrc, credentials.json, terraform.tfstate*, etc.). Pass --verbose to print skipped sensitive filenames, or opt specific test fixtures back in via include_sensitive.
Complete ferro.toml.example
# Ferro BYO-Metal CI Offloader configuration# Copy to `ferro.toml` in your repository root, or generate one with `ferro init`.# Matches `ProjectConfig` in `crates/ferro-cli/src/config.rs`.# Project slug in your Ferro organization (used to link CLI offloads to a project).project = "my-app"# Default command executed when running `ferro run` without an explicit command argument.default_command = "bun test"# Required runner labels used when selecting a BYO-Metal node for offload or relay runs.labels = ["linux", "x86_64"]# Extra gitignore-style patterns excluded during content-addressed delta sync.# `.git`, `.ferro`, `node_modules`, `target`, `.next`, `dist`, `build`, `__pycache__`,# and `.venv` are already skipped by default, alongside `.gitignore` (including parent# and global gitignores) and `.ferroignore`.ignore = [ "coverage/", "*.log", "tmp/",]# Explicit opt-in patterns to re-include files blocked by the built-in sensitive file# denylist (`.env`, `.env.*` except `.env.example`/`.env.sample`, `*.pem`, `*.key`,# `*.p12`, `*.pfx`, `id_rsa*`, `id_ed25519*`, `id_ecdsa*`, `.ssh/`, `.aws/`, `.gnupg/`,# `.npmrc`, `.pypirc`, `.netrc`, `.docker/config.json`, `*.kdbx`, `credentials.json`,# `service-account*.json`, `terraform.tfstate*`). Leave empty unless a test fixture# genuinely needs to be synced.include_sensitive = [ # ".env.test", # "tests/fixtures/*.pem",]# Maximum size (in MiB) for any single file uploaded during delta sync (default: 32).# Files larger than this limit are skipped and listed before execution.max_file_mb = 32# Persistent build/dependency paths restored into each run's workspace from the# runner's warm NVMe cache before execution and saved back atomically afterwards.# When omitted/empty, Ferro auto-detects defaults from lockfiles present in the# workspace: bun/npm/pnpm/yarn lockfiles -> `node_modules`, `Cargo.lock` -> `target`,# `uv.lock`/`poetry.lock`/`pdm.lock`/`Pipfile.lock` -> `.venv`.cache_paths = ["node_modules"]# Workspace-relative files whose SHA-256 content hashes form part of the cache key# (together with org, project, branch/PR trust scope, and OS/arch). When a lockfile# changes and the exact key misses, Ferro falls back to the most recent compatible# cache key for the same project/path ("restore keys"). Defaults to detected lockfiles# when omitted/empty.# Trust rules: runs with `trusted = false` (untrusted fork PRs) may read from the# default-branch cache via an isolated copy-on-restore, but NEVER write to it;# they save only to an isolated PR-scoped cache key (`pr-<number>`).cache_key_files = ["bun.lock"]# Save updated cache paths even when the run exits with a non-zero status (default: false).# Cancelled and timed-out runs are never saved.cache_save_on_failure = false# Maximum run execution duration in seconds (control plane clamps to 10..7200).timeout_secs = 900# Relative glob patterns collected into a compressed tar+zstd artifact archive after the job exits.# Must be workspace-relative (no leading `/` or `..`; symlinks escaping the workspace are rejected).artifacts = [ # "dist/**", # "coverage/lcov.info",]# When to collect artifacts after job exit: "always" (default), "success", or "failure".artifacts_on = "always"# Relative glob patterns for JUnit XML test reports uploaded and parsed into the dashboard "Tests" tab.test_reports = [ # "junit.xml", # "reports/**/*.xml",]# ============================================================================# Multi-step pipelines, branch/path filters, concurrency & service containers# ============================================================================# Optional. Omit `[pipeline]` to keep running a single project CI command or# `default_command` unchanged.[pipeline]# Cancel older queued or running jobs in the same concurrency group when a newer# push or pull request commit arrives (default: false).cancel_in_progress = true# Concurrency group template for `cancel_in_progress`. Supports `${branch}`,# `${pr_number}`, `${ref}`, `${project}`, and `${trigger}`. Untrusted fork PRs# are always isolated from trusted runs and default to `fork-pr:<pr_number>`.concurrency_group = "${branch}"[pipeline.on]# Run only when at least one changed file matches `paths` (glob syntax: `*`, `**`, `?`).paths = ["src/**", "crates/**", "package.json", "bun.lock"]# Skip runs when every changed file matches `paths_ignore`.paths_ignore = ["docs/**", "**/*.md"][pipeline.on.push]# Glob patterns matched against pushed branch names (prefix with `!` to exclude).branches = ["main", "release/*"][pipeline.on.pull_request]# Glob patterns matched against the pull request base branch.branches = ["main"]# Optional sibling service containers started via podman (preferred, rootless)# or docker on the runner node, bound to localhost, and torn down after the run.# Fails clearly if no container runtime is installed on the runner.[[pipeline.services]]name = "postgres"image = "postgres:16-alpine"ports = ["5432:5432"]env = { POSTGRES_PASSWORD = "ferro", POSTGRES_DB = "ferro_test" }health_cmd = "pg_isready -U postgres"# Sequential steps executed in the same sandboxed workspace (warm dependency# cache is restored once before step 1 and saved once after the last step).[[pipeline.steps]]name = "Install dependencies"run = "bun install --frozen-lockfile"timeout_secs = 300[[pipeline.steps]]name = "Lint & typecheck"run = "bun run lint && bun run typecheck"env = { NODE_ENV = "test" }working_directory = "."continue_on_error = false[[pipeline.steps]]name = "Test suite"run = "bun test"# Optional: Smart Test Cache v2 targets (requires the Smart Test Cache bundle add-on).# Run via `ferro test` (or `ferro test --no-cache`) and automatically in CI runs.# Inputs NEVER implicitly consult .gitignore; exclude files only with explicit `!` globs.## [test_cache]# fingerprint_cmd = "bun --version"## [[test_cache.targets]]# name = "unit"# run = "bun test"# inputs = ["src/**", "package.json", "bun.lock", "!src/generated/**"]# env = ["NODE_ENV"]# outputs = ["coverage/**"]