The Agent-Ready Toolchain: mise, Ruff, Biome, golangci-lint, Trivy, OpenTofu
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).
- Agents write code faster than people review it, so the feedback loop must be fast, deterministic, and machine-readable.
- One
mise.tomlpins every tool version and defines a singlechecktask; the agent, your laptop, and CI all runmise 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:
| Source | Finding |
|---|---|
| Veracode, 2025 GenAI Code Security Report | AI-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
| Property | Why the agent benefits |
|---|---|
| Fast | The agent can run it after every edit without stalling the session |
| Deterministic and pinned | Same input and version give the same result on every machine |
| Autofix | Mechanical problems are fixed by the tool, so the agent spends tokens on real problems |
| Single binary | Nothing 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 code | Pass or fail is unambiguous |
The loop
Tool summary (versions as of 2026-10)
| Tool | Language or target | Replaces | Latest release | Agent command | Machine-readable output |
|---|---|---|---|---|---|
| mise | all (tool and task runner) | asdf, nvm, pyenv, Makefile glue | v2026.10.17 | mise run check | n/a |
| Ruff | Python | Flake8, isort, Black | 0.17.2 | ruff check --fix then ruff format | --output-format includes json, sarif, github |
| Biome | JS, TS, JSON, CSS | ESLint and Prettier for most projects | 2.6.2 | biome check --write | biome ci --reporter=json or sarif |
| golangci-lint | Go | running many Go linters separately | v2.15.0 | golangci-lint run --fix and golangci-lint fmt | JSON, SARIF, checkstyle, JUnit via config |
| Trivy | repos, images, IaC | separate vuln, secret, and IaC scanners | v0.76.1 | trivy fs . and trivy config . | --format json or sarif |
| OpenTofu | IaC (Terraform-compatible) | Terraform CLI | v1.13.2 | tofu fmt -check, tofu validate, tofu test | text |
| TFLint | Terraform and OpenTofu code | manual review of provider mistakes | v0.65.0 | tflint --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.
[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):
## 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.
[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.
{
"$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.
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:
run "test" {
assert {
condition = file(local_file.test.filename) == "Hello world!"
error_message = "Incorrect content in ${local_file.test.filename}."
}
}
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:
- The agent's credentials can read state and run plan against dev only.
tofu applyruns from CI after a reviewed pull request, with an approval step for staging and production.- The agent never holds production apply credentials.
Add IaC steps to mise.toml when the repo has them:
[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 checklocally, 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"), commitmise.lock, and update on purpose with a reviewed PR. - Split
fix(mutating) fromcheck(read-only) so the agent knows which is safe in a hook. - Ask the agent to run
mise run checkbefore it says a task is done, and to paste the failing output when it cannot fix it. Put that inAGENTS.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=1on client work.
Pitfalls to design around
- Keep tool versions in
mise.tomlonly; remove duplicate pins inpackage.jsonscripts, 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
checkmakes the agent do by hand what Ruff and Biome do for free. - Scope slow scans: run
trivy fsin 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 jsonor--output-format json.
Try it
Lab (20 min)
- In a repo with Python or TypeScript, add
mise.tomlwith the matching tools and thefix,lint,scan, andchecktasks above. - Run
mise install, thenmise lock, and commit both files. - Run
mise run checkand note the failures. Ask your agent: "Runmise run fix, thenmise run check, and fix what remains. Do not disable rules." - Add a dependency the agent suggests, and check it exists on the registry and passes
trivy fs. - If the repo has OpenTofu, add the
iactask and confirm the agent can runtofu planbut nottofu apply. - Continue with Lab: Make a Repository Agent-Ready.
Checklist
-
mise.tomlpins every tool and definesfix,lint,scan, andcheck -
mise.lockis committed and CI usesmise install --locked -
AGENTS.mdnames 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
- mise: release v2026.10.17, configuration, tasks, dev tools, lockfile, paranoid mode, tool registry
- Ruff: release 0.17.2, README, linter, formatter, configuration; output formats from
ruff check --help(0.16.10) - Biome: release 2.6.2, getting started, CLI reference, linter
- golangci-lint: release v2.15.0, migration guide, configuration file, formatters
- Trivy: release v0.76.1, docs, secret scanning, misconfiguration, reporting, advisory GHSA-69fq-xp46-6x23
- OpenTofu: release v1.13.2,
tofu test; TFLint: repository, release v0.65.0. CLI flags checked withtofu fmt -help,trivy fs --help, andtflint --helpon OpenTofu 1.13.1, Trivy 0.75.0, and TFLint 0.64.0 - Veracode 2025 GenAI Code Security Report
- GitClear: AI Copilot Code Quality 2025
- Spracklen et al., "We Have a Package for You!" (arXiv 2406.10279)