harbor lint checks task configuration, files, and common security risks
without running a sandbox.
root-agent and unpinned-image run by default.
Without file configuration:
--select A→ A only--extend-select A→ defaults + A--ignore A→ defaults − A
--select and
--extend-select also accept ALL, including rules added in future versions.
Rule selection is inspired by Ruff.
Configure the same options in task.toml or dataset.toml:
Task checks
Compose checks
Requires the Docker CLI. Tasks without Compose files do not run these checks. Harbor runtime variables use placeholder values; runtime host mounts are flagged as potentially external. Compose interpolation uses the applicable agent or verifier environment configuration; task values override shell values.
Linting is optional. Use
--ignore for rules that do not fit your task.
Static linting complements the rubric-based
harbor check and harbor analyze and does not guarantee task or verifier correctness.Custom rules
A dataset can add its own rules in Python. Each rule is a function decorated with@rule that takes the task directory, a Path, and returns Finding
objects or plain string messages:
checks/lint_rules.py
dataset.toml, using paths relative to dataset.toml:
dataset.toml
.py file in it, except
files starting with _, which can hold helpers the rules share. Rule files are
imported by name, so name them like Python modules (no_todo.py), distinct from
other modules. Import helpers at the top of a rule file: they’re importable only
while the rules load.
- Names: Rule names must include a namespace (for example,
acme/no-todo) so they never collide with built-in rules. Select and ignore them like built-in rules;ALLincludes them. - Defaults:
@rule(enabled=False)keeps a rule off until explicitly selected. - Locations: File paths in
Locationare relative to the task directory. A finding without a location points at the task directory itself. - Shared work:
once(key, compute)fromharbor.lint.rulescomputes a value once per task and shares it across all rules running on that task.
--dangerously-trust-dataset; without it, harbor lint runs Harbor’s rules and
says that the dataset lists rules it skipped. Pass it only for datasets you
trust:
dataset.toml can list rules; a task’s task.toml can’t. If a rule file
fails to import or a rule raises an exception, harbor lint exits with code 2.
Pull requests
Trust only rules from a trusted ref when linting a pull request’s tasks, never the pull request’s own.--dataset names the dataset.toml to use instead of
each task’s nearest one:
dataset.toml from the
base, so nothing in the pull request is searched for rules or configuration.
--output-format github puts findings on the pull request’s lines.
