Skip to main content

The Agent-Ready Toolchain: mise, Ruff, Biome, golangci-lint, Trivy, OpenTofu

Basic

Applies to: any repo where an agent writes or changes code · Time to learn: 30 min reading + 20 min exercise · Lever: feedback + guardrails

A coding agent improves by iterating on tool output: it edits, runs a check, reads the result, and edits again. The quality of that loop depends on the tools. This page covers a small set that fits agents well: mise to pin and run everything, Ruff (Python), Biome (JavaScript and TypeScript), golangci-lint (Go), Trivy (vulnerabilities, secrets, IaC misconfiguration), and OpenTofu with TFLint (infrastructure as code).

TL;DR
  • Agents write code faster than people review it, so the feedback loop must be fast, deterministic, and machine-readable.
  • One mise.toml pins every tool version and defines a single check task; the agent, your laptop, and CI all run mise run check.
  • Prefer single-binary tools with autofix and JSON or SARIF output: Ruff, Biome, golangci-lint, Trivy, OpenTofu, TFLint.
  • Scan what the agent adds (dependencies, IaC, secrets) with Trivy; AI-suggested packages can be hallucinated.
  • Agents may plan and validate infrastructure. They never apply to production.

Why it matters in the AI age​

Review is the bottleneck. An agent can produce a diff in a minute that takes a person much longer to read. If checks are slow, flaky, or only run in CI, the agent either waits or skips them. If checks are fast and deterministic, the agent fixes its own mistakes before a human sees them.

The evidence says unchecked AI code needs checking:

SourceFinding
Veracode, 2025 GenAI Code Security ReportAI-generated code introduced risky security flaws in 45% of tests
GitClear, 2025 AI Copilot Code Quality report (211 million changed lines, 2020 to 2024)Refactored ("moved") lines fell from 25% of changed lines in 2021 to under 10% in 2024; copy/pasted lines rose from 8.3% to 12.3%; copy/paste exceeded moved code for the first time
Spracklen et al., "We Have a Package for You!" (16 models, 576,000 code samples)Hallucinated package names averaged at least 5.2% for commercial models and 21.7% for open-source models; 205,474 unique hallucinated names were found

The last row is the basis of "slopsquatting": an attacker registers a package name that models tend to invent, and an agent that installs it runs the attacker's code. A scanner and a reviewed lockfile are the defence.

Reproducibility. If the agent runs ruff 0.16 and CI runs 0.17, they disagree and the agent chases phantom failures. Pinning tool versions in one file makes the agent and CI run the same checks.

This page covers the feedback and guardrails levers. Hooks, Pre-commit, and Quality Gates shows how to make these checks run automatically; Lab: Make a Repository Agent-Ready puts it all together.

Core concepts​

What makes a tool agent-friendly​

PropertyWhy the agent benefits
FastThe agent can run it after every edit without stalling the session
Deterministic and pinnedSame input and version give the same result on every machine
AutofixMechanical problems are fixed by the tool, so the agent spends tokens on real problems
Single binaryNothing to bootstrap; easy to install in CI and containers
Structured output (JSON, SARIF)The agent or a script can parse results instead of scraping text
Clear exit codePass or fail is unambiguous

The loop​

Tool summary (versions as of 2026-10)​

ToolLanguage or targetReplacesLatest releaseAgent commandMachine-readable output
miseall (tool and task runner)asdf, nvm, pyenv, Makefile gluev2026.10.17mise run checkn/a
RuffPythonFlake8, isort, Black0.17.2ruff check --fix then ruff format--output-format includes json, sarif, github
BiomeJS, TS, JSON, CSSESLint and Prettier for most projects2.6.2biome check --writebiome ci --reporter=json or sarif
golangci-lintGorunning many Go linters separatelyv2.15.0golangci-lint run --fix and golangci-lint fmtJSON, SARIF, checkstyle, JUnit via config
Trivyrepos, images, IaCseparate vuln, secret, and IaC scannersv0.76.1trivy fs . and trivy config .--format json or sarif
OpenTofuIaC (Terraform-compatible)Terraform CLIv1.13.2tofu fmt -check, tofu validate, tofu testtext
TFLintTerraform and OpenTofu codemanual review of provider mistakesv0.65.0tflint --recursive--format includes json, sarif

How to do it​

Step 1: mise as the glue​

mise installs pinned tool versions per project and runs tasks. Put it in the repo root and commit it.

mise.toml
[tools]
ruff = "0.17.2"
biome = "2.6.2"
golangci-lint = "2.15.0"
trivy = "0.76.1"
opentofu = "1.13.2"
tflint = "0.65.0"

[tasks.fix]
description = "Autofix formatting and safe lint issues"
run = "ruff check --fix . && ruff format . && biome check --write ."

[tasks.lint]
description = "Read-only lint and format checks"
run = "ruff check . && ruff format --check . && biome ci ."

[tasks.scan]
description = "Vulnerabilities, secrets, IaC misconfiguration"
run = "trivy fs --severity HIGH,CRITICAL --exit-code 1 ."

[tasks.check]
description = "Everything the agent and CI must pass"
depends = ["lint", "scan"]

Tool names above are mise registry short names (backed by aqua: for ruff, biome, golangci-lint, trivy, opentofu, and tflint). Add only the tools your repo uses; Go and IaC tasks follow in their sections. mise docs document mise use node@24 to add a tool, mise install to install everything in mise.toml, mise run <task> to run a task, mise tasks ls to list tasks, and depends to chain tasks.

Lockfile. Run mise lock to write mise.lock, or set lockfile = true under [settings] so mise creates and updates it automatically. It records the exact resolved versions with download URLs and checksums where the backend provides them. Commit mise.toml and mise.lock. In CI use mise install --locked (or MISE_LOCKED=1), which fails instead of resolving a version that is not in the lockfile.

Supply-chain verification. mise re-runs backend provenance checks on each install, such as SLSA, Cosign, Minisign, and GitHub attestations, and requires an attestation to name the artifact's repository. MISE_PARANOID=1 turns on every category for one command, and mise settings paranoid=true turns it on for all commands. The setting is global-only, so a project cannot weaken it. Turn it on for client work.

Tell the agent about it in AGENTS.md (see AGENTS.md, CLAUDE.md, and Rules):

AGENTS.md (excerpt)
## Commands
- Setup: `mise install`
- Fix: `mise run fix`
- Verify before every commit: `mise run check`

Step 2: Ruff (Python)​

What it is. A Python linter and formatter written in Rust by Astral. It replaces Flake8 (with plugins), isort, and Black; the formatter is a drop-in replacement for Black. The README claims 10-100x faster than existing linters and formatters.

Why agents like it. It is fast enough to run after every edit, it fixes many problems itself, it ships as one binary, and --output-format supports json, sarif, github, and others.

Install. ruff = "0.17.2" in mise.toml.

pyproject.toml
[tool.ruff.lint]
extend-select = ["B"] # flake8-bugbear, in addition to the defaults
ignore = ["E501"]

[tool.ruff.format]
quote-style = "double"

Agent command.

ruff check --fix . # safe fixes only by default
ruff format .
ruff check --output-format json . # when a script needs to parse results

By default Ruff applies only safe fixes with --fix, so the agent can run it without fear of semantic changes. For type checking, Astral also ships ty; check its status page before adopting it, as its stability is not covered here.

Step 3: Biome (JavaScript and TypeScript)​

What it is. A formatter and linter for JS, TS, JSON, CSS, and related files in one binary. biome check runs format, lint, and assist actions (such as import sorting); biome ci does the same without modifying files.

Why agents like it. One command and one config, quick runs, safe autofix with --write, and many reporters (json, github, gitlab, junit, checkstyle, rdjson, sarif). Biome v2 also offers type-aware rules (for example noFloatingPromises) through an opt-in scanner; the docs measured about 800 ms without it and about 2 s with it on roughly 2,000 files.

Install. biome = "2.6.2" in mise.toml.

biome.json
{
"$schema": "https://biomejs.dev/schemas/2.6.2/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"formatter": { "enabled": true, "indentStyle": "tab" },
"linter": { "enabled": true, "rules": { "preset": "recommended" } },
"assist": {
"enabled": true,
"actions": { "source": { "organizeImports": "on" } }
}
}

(biome init generates this shape; the vcs values here turn on .gitignore support.)

Agent command.

biome check --write . # fix
biome ci --reporter=json . # verify, read-only, structured output

Step 4: golangci-lint (Go)​

What it is. A fast runner for Go linters and formatters. Version 2 requires version: "2" in the config, and golangci-lint migrate converts a v1 config.

Why agents like it. One command runs many linters, --fix applies autofixes, golangci-lint fmt formats code, and output formats include JSON, SARIF, checkstyle, JUnit, and others, configured under output.formats.

Install. golangci-lint = "2.15.0" in mise.toml.

.golangci.yml
version: "2"

linters:
default: standard

formatters:
enable:
- gofmt
- goimports

output:
formats:
text:
path: stdout

Agent command.

golangci-lint fmt
golangci-lint run --fix
golangci-lint run --output.json.path stdout # JSON for scripts

Add golangci-lint run and golangci-lint fmt --diff to your lint task for Go repositories.

Step 5: Trivy (scanning)​

What it is. An open-source scanner from Aqua Security for vulnerabilities, misconfiguration, secrets, licenses, and cryptographic assets. In a repo, trivy fs scans for vulnerabilities and secrets by default.

Why it matters for agents. Agents add dependencies and write IaC. Trivy checks lockfiles for known vulnerable versions, finds committed secrets, and flags insecure Terraform, Kubernetes, and Dockerfile settings. It is a safety net for the hallucinated-package problem above: a package that does not exist cannot be vetted, so review every new dependency the agent adds, and let the scan catch known-bad ones.

trivy fs --severity HIGH,CRITICAL --exit-code 1 . # deps + secrets
trivy config --severity HIGH,CRITICAL ./infra # IaC misconfiguration
trivy fs --scanners vuln,secret,misconfig --format sarif -o trivy.sarif .

--exit-code sets the exit code when issues are found; --format supports table, json, sarif, and others.

Pin it. Trivy's own release pipeline was compromised in March 2026. The details and our rules (pin GitHub Actions to full commit SHAs, pin scanner binaries and images by version and checksum or digest) are in How We Build; do not repeat them here, but follow them. In mise.toml pin an exact version and commit mise.lock so the binary checksum is recorded. The advisory lists v0.69.2 and v0.69.3 as safe versions of the era; the current release (v0.76.1 as of 2026-10) is well past the affected range.

Step 6: OpenTofu and TFLint (IaC an agent can write)​

What it is. OpenTofu is the open-source, Linux Foundation fork of Terraform; basics and our module conventions are in How We Build. TFLint is a pluggable linter for Terraform and OpenTofu code.

Why agents like it. tofu fmt, tofu validate, and tofu test are fast, offline-friendly checks with clear exit codes. TFLint catches provider-specific mistakes that validate misses.

tofu fmt -check -recursive -diff # formatting (drop -check to rewrite)
tofu init -backend=false # providers only; no state access
tofu validate
tofu test # runs .tftest.hcl files
tflint --init # install plugins
tflint --recursive --format json

A test an agent can write and run:

tests/basic.tftest.hcl
run "test" {
assert {
condition = file(local_file.test.filename) == "Hello world!"
error_message = "Incorrect content in ${local_file.test.filename}."
}
}
.tflint.hcl
plugin "terraform" {
enabled = true
preset = "recommended"
}

Plan review, never auto-apply. Let the agent write code and run tofu plan, then a human reads the plan before anything applies. Concretely:

  1. The agent's credentials can read state and run plan against dev only.
  2. tofu apply runs from CI after a reviewed pull request, with an approval step for staging and production.
  3. The agent never holds production apply credentials.

Add IaC steps to mise.toml when the repo has them:

mise.toml (IaC additions)
[tasks.iac]
description = "Format, validate, lint IaC"
run = "tofu fmt -check -recursive && tofu init -backend=false && tofu validate && tflint --recursive"

Then extend check with depends = ["lint", "scan", "iac"]. Keep tofu fmt in the fix task without -check.

Best practices​

  • One entry point: mise run check locally, in hooks, and in CI. See Hooks, Pre-commit, and Quality Gates for wiring it into Claude Code hooks and pre-commit.
  • Pin exact versions (ruff = "0.17.2"), commit mise.lock, and update on purpose with a reviewed PR.
  • Split fix (mutating) from check (read-only) so the agent knows which is safe in a hook.
  • Ask the agent to run mise run check before it says a task is done, and to paste the failing output when it cannot fix it. Put that in AGENTS.md.
  • Use structured output (json, sarif) in CI and for scripts; use text for the agent's normal loop.
  • Review every new dependency the agent adds, by name, before the scan.
  • Enable MISE_PARANOID=1 on client work.

Pitfalls to design around​

  • Keep tool versions in mise.toml only; remove duplicate pins in package.json scripts, CI YAML, and Dockerfiles, or they drift.
  • Let a human decide rule changes: if the agent disables a lint rule to pass, that belongs in review. Config files can be protected with a hook (see the hooks page).
  • Run the autofix and the check in that order; running only check makes the agent do by hand what Ruff and Biome do for free.
  • Scope slow scans: run trivy fs in CI and pre-push, and keep the per-edit loop to fast linters.
  • Version claims age fast: re-check the latest releases before a new engagement and pin what you tested.
  • Do not rely on text parsing of tool output in scripts; use --format json or --output-format json.

Try it​

Lab (20 min)

  1. In a repo with Python or TypeScript, add mise.toml with the matching tools and the fix, lint, scan, and check tasks above.
  2. Run mise install, then mise lock, and commit both files.
  3. Run mise run check and note the failures. Ask your agent: "Run mise run fix, then mise run check, and fix what remains. Do not disable rules."
  4. Add a dependency the agent suggests, and check it exists on the registry and passes trivy fs.
  5. If the repo has OpenTofu, add the iac task and confirm the agent can run tofu plan but not tofu apply.
  6. Continue with Lab: Make a Repository Agent-Ready.

Checklist​

  • mise.toml pins every tool and defines fix, lint, scan, and check
  • mise.lock is committed and CI uses mise install --locked
  • AGENTS.md names the setup, fix, and verify commands
  • Formatter and linter run with autofix; CI runs read-only mode
  • Trivy scans dependencies, secrets, and IaC; Trivy itself is pinned
  • IaC runs fmt, validate, test, and TFLint; plans are reviewed by a human
  • The agent has no production apply credentials
  • New dependencies are reviewed by name

Sources​