Skip to main content
harbor lint checks task configuration, files, and common security risks without running a sandbox.
All rules except root-agent and unpinned-image run by default. Without file configuration:
  • --select A → A only
  • --extend-select A → defaults + A
  • --ignore A → defaults − A
Repeat these options to specify multiple exact rule names. --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:
Precedence: CLI flags > task.toml > dataset.toml > defaults.

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
Register your rule files in dataset.toml, using paths relative to dataset.toml:
dataset.toml
An entry can also be a directory: Harbor loads each .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; ALL includes them.
  • Defaults: @rule(enabled=False) keeps a rule off until explicitly selected.
  • Locations: File paths in Location are relative to the task directory. A finding without a location points at the task directory itself.
  • Shared work: once(key, compute) from harbor.lint.rules computes a value once per task and shares it across all rules running on that task.
Rules are Python code, so they run only when you pass --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:
Only 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:
Check out the pull request’s merge commit and its base commit separately, and lint the changed tasks from the merge with Harbor and 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.