Trivy
$ trivy Official Low Risktrivy scans filesystems, container images, SBOMs, and Terraform/Kubernetes manifests for CVEs, misconfigurations, and hardcoded secrets. Its uniform --format json, --severity filters, and --quiet flags make security gating effortless for coding agents.
brew install trivy Running trivy fs --format json locally avoids uploading source trees to external scanners and gives instant structured CVE output.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --format json (plus sarif, cyclonedx, spdx-json), --severity filtering, --quiet, and non-interactive exit codes.
- Native
--format json,--quiet, and--exit-codeflags
Read-only scanner against target files/images; only writes its own vulnerability DB cache under ~/.cache/trivy.
- Zero mutation of scanned targets
Single Go binary across brew, apt, Docker images, and GitHub releases.
- Cross-platform static binary
Unifies dependency CVEs, container scanning, IaC misconfigs, and secret detection in one CLI.
- Multi-scanner coverage (
vuln,misconfig,secret,license)
Flagship Aqua Security OSS project with continuous vulnerability DB updates.
- Official
aquasecurity/trivyrepository
Comprehensive documentation covering JSON schemas, scanners, and air-gapped caches.
- Detailed official docs at aquasecurity.github.io/trivy
Security, Auth & Guardrails
No credentials needed for local filesystem/IaC scans; caches vulnerability DB in ~/.cache/trivy and optionally uses Docker/registry auth.
100% free and open-source (Apache-2.0).
# Trivy Agent Rules - Always pass `--format json --quiet` (and `--severity HIGH,CRITICAL` on large repos) so progress bars and low-noise findings do not bloat context. - Use `--skip-db-update` when running offline with an existing `~/.cache/trivy` database.
Agent-Ready Command Recipes
Safe Read-Only Queries
trivy fs --scanners vuln,misconfig,secret --severity HIGH,CRITICAL --format json --quiet .
Performs read-only CVE, IaC, and secret checks and outputs clean JSON.
trivy image --severity CRITICAL --format json --quiet alpine:3.20
Reports critical vulnerabilities inside an image with progress bars suppressed (--quiet).
Strengths for Agents
- + All-in-one CVE, IaC misconfiguration, and secret scanner with clean
--format json --quietoutput. - + Zero-auth local filesystem scanning with flexible
--severityfiltering.
Caveats & Pitfalls
- ! First run downloads ~50MB+ vulnerability DB unless
--skip-db-updateis used with a pre-warmed cache. - ! Full
--format jsonon large projects can be verbose—filter with--severityorjq.