The short answer: run OSV-Scanner when your question is specifically about known vulnerabilities in your project’s dependencies and you want Google’s officially supported frontend to the OSV database; run Trivy when one tool should also cover container images, misconfigurations, secrets, and license checks across far more target types. Security teams with container workloads usually end up standardizing on Trivy, while dependency-only projects get the tightest signal-to-noise from OSV-Scanner - and the two are often used together.
What each scanner actually is
OSV-Scanner is developed under the OSV.dev project and documented as an officially supported frontend to the OSV vulnerability database. It connects a project’s dependency manifests and lockfiles to vulnerabilities recorded in OSV, which makes its reports narrowly about the question: which packages this project depends on have known advisories?
Trivy, maintained by Aqua Security, documents much broader target coverage. A single binary scans container images, filesystems, code repositories, virtual machine images, and Kubernetes clusters, and its scanner covers not only vulnerabilities but also misconfigurations, exposed secrets, and license compliance.
Head-to-head at a glance
| Decision factor | OSV-Scanner | Trivy |
|---|---|---|
| Primary focus | Dependency vulnerabilities via the OSV database | Broad scanning: vulnerabilities plus misconfigurations, secrets, licenses |
| Target types | Project manifests and lockfiles | Container images, filesystems, repositories, VM images, Kubernetes |
| Backing | Documented as the official OSV.dev frontend | Maintained by Aqua Security; widely adopted in CI |
| Best fit | Dependency audits with minimal noise | One-tool coverage across infrastructure and code |
Choosing between them
Choose OSV-Scanner when the workflow is dependency hygiene: pre-commit checks, scheduled repository audits, or feeding OSV-backed advisories into triage. Its narrow scope keeps results focused on package-level findings rather than infrastructure findings that a pure code project cannot act on.
Choose Trivy when the scan surface includes anything beyond a manifest - built images, base layers, Infrastructure-as-Code files, or clusters. Where secrets are the specific concern, our Gitleaks vs TruffleHog comparison covers dedicated secret-scanning tools in depth. Teams that need a single scanner wired into CI for mixed estates tend to accept the broader report volume in exchange for one integration.
The combination is common and defensible: OSV-Scanner for deep dependency review where its database alignment matters, Trivy as the wide CI gate. Neither tool requires uploading proprietary source code to a third party to scan it. Container-focused teams can also read how container-focused scanners differ for a scope-first evaluation of two image-oriented scanners.
Wiring either scanner into CI
Both tools ship as single binaries or containers, which keeps CI wiring simple. The practical differences show up in report handling: dependency-only reports tend to be short enough to fail a build on any finding, while broad scans usually need severity thresholds or an ignore file so unrelated infrastructure findings do not drown the gate. Decide the policy before standardizing - a scanner nobody tolerates in the pipeline gets bypassed within a month.
Practical decision checklist
- If the question is only “are my declared dependencies vulnerable?”, start with OSV-Scanner.
- If images, IaC, secrets, or licenses are in scope, start with Trivy.
- Run both during an evaluation week on the same repository and compare finding quality against your team’s triage capacity before standardizing.
Frequently asked questions
Can OSV-Scanner and Trivy be used together?
Yes. Both read local projects without requiring uploads, so teams commonly use OSV-Scanner for dependency-focused review and Trivy for wider infrastructure and image scanning in CI.
Which scanner finds more vulnerabilities?
Neither universally “finds more.” Trivy covers more target types by design; OSV-Scanner aligns its findings with the OSV advisory database for dependencies. Result counts differ because scopes differ, not because one database is simply better.
Do these scanners send my code anywhere?
OSV-Scanner queries the OSV database for advisory data about identified packages. Trivy downloads vulnerability databases locally and then scans offline. Check each project’s current documentation for details before adopting either in a sensitive environment.
Sources
- OSV-Scanner documentation Retrieved
- Trivy Vulnerability Scanning documentation Trivy Documentation Retrieved
- aquasecurity/trivy repository GitHub Retrieved



