Safeguard
Security Guides•

Does my audit tool check transitive and dev dependencies?

Defaults differ: Yarn checks direct packages, NuGet depends on target framework, composer includes dev packages. Check yours before trusting a clean run.

Safeguard Security Team
3 min read

It depends on the tool, and the defaults differ. Yarn's audit covers direct dependencies unless you add the recursive option. NuGet audits direct packages by default before .NET 10 and all packages from net10.0. Composer audits dev packages unless told not to. Read the default for your tool before trusting a clean run.

Definitions

Direct dependency. A package you declared.

Transitive dependency. A package pulled in by another package.

Dev dependency. A package used for building or testing.

Defaults by tool

ToolTransitive by defaultDev by default
yarn npm auditNo, add the recursive optionIncluded, use the environment option to filter
NuGet audit on restoreDirect before net10.0, all from net10.0Not applicable
dotnet package list, vulnerableNeeds the transitive optionNot applicable
composer auditAudits installed packages, or the lock file with the locked optionIncluded, use the no dev option to skip
npm auditReport covers your configured dependenciesOmitted when NODE_ENV is production
pnpm auditInstalled packagesFilter with production or dev options
pip-auditWhatever is installed or resolved from your inputWhatever the input contains

For NuGet, when a project targets several frameworks and any one of them selects all, the audit uses all for every target.

Why this matters

A scan limited to direct packages misses most of a typical tree. A scan that skips dev packages can miss risk to your build pipeline. A scan that includes everything can bury runtime issues. The right choice is to run a broad scan for visibility and a narrow one for release gating.

Steps

  1. Look up the default in your tool's documentation.
  2. Run a deliberately broad scan once, and count findings by direct, transitive and dev.
  3. Compare that with your normal command's output. If counts differ, your default is narrower than you thought.
  4. Set options in CI explicitly instead of relying on defaults.
  5. Review the settings after a major tool or SDK upgrade, since defaults can change.

An example of default drift

NuGet changed the audit mode default for projects targeting .NET 10, moving from direct to all. A team that upgraded would see new findings without changing a line of their own code. Pin the setting in your repository so the behaviour is stable.

Try it yourself

Click through it at your own pace, or open it full screen.

Expand each level of the inventory and count direct and transitive packages.

Quick check

Which is safer, auditing everything or production alone?

Do both. Gate releases on production findings, and review the full list on a schedule.

Can defaults change under me?

Yes. NuGet changed its mode default for .NET 10 projects. Set options explicitly.

Safeguard SBOM and dependency scanning inventories direct and transitive packages together. Run a free scan to see the split.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.