Skip to content
Published

Last reviewed: 2026-09-08

Quality Gates

Configure dependency quality thresholds that warn or forbid packages when maintainers, activity, security, or license checks fail.

What Quality Gates do

Quality Gates are organization policies made of rules. A rule fires when a dependency fails one or more thresholds you set. The rule then raises a warning or forbids the package. There is no Allow action on quality rules: packages that meet every filled threshold simply pass.

Quality Gates are separate from Category Governance (business allow/forbid/warn by category) and from license policies.

They are also not the same as PR / API severity thresholds (prCheckSeverityThreshold, apiGateSeverityThreshold). Those fields gate GitHub PR checks / GitLab MR External Status Checks (vulns / secrets / SAST) and Public API wait / CLI --wait / MCP wait respectively, and are not linked to Quality Gate rules. See PR checks and Scans API.

Configure in Settings

Open Settings → Quality Gates. Create a policy, then add rules.

Each rule has:

  1. Action — Warning (flag / score impact) or Forbid (non-compliant; can fail PR checks).
  2. Scope — Ecosystems (none selected means all: npm, PyPI, RubyGems, Maven, Cargo, Composer, Go/gomod) and optional dependency categories.
  3. Mode — Thresholds (form fields) or Expressions (compose package facts with allowlisted operators). Exactly one mode per rule.

Thresholds that work

ThresholdBehaviorLimits
Minimum maintainersFails when maintainer count is below the valueWeaker coverage on Maven
Maximum days since last releaseFails when a known release date is older than N days—
Must match organization license policiesFails when the package license does not satisfy active license policiesExact SPDX / alias match (same engine as License policy); MIT-0 ≠ MIT
Allowed / forbidden licensesWhitelist / blacklist on the package license string—
Must be marked maintainedFails only when the package is explicitly marked not maintainedMissing data does not fail this check
Must be marked popularFails only when the package is explicitly marked not popularMissing data does not fail this check
GitHub stars, forks, open issues, commitsFail against synced GitHub factsNeed a linked GitHub repo
Minimum downloads (30 days)Fail against download factsMost reliable for npm; other ecosystems may report 0
Minimum total downloadsFail against lifetime download factsnpm sums registry history in ≤18-month windows from package creation
Maximum known vulnerabilitiesFails when OSV advisory count exceeds the valueCount filled during facts sync (package-level; latest version when known)
Minimum release frequencyFails when estimated releases/year is below the valueHeuristic from registry release history
Maximum package size (bytes)Fails when synced size exceeds the valueRegistry-reported size when available
Maximum direct dependenciesFails when direct dependency count exceeds the value—

Expressions (policy 1.1.0)

Expression mode builds rules as { fact, operator, value } rows with match all or any. Operators are allowlisted (eq, neq, gt, gte, lt, lte, in, not_in, is_true, is_null) — no free-form scripts. Facts are package sync fields (for example vulnerabilityCount, maintainersCount, daysSinceLastRelease). Missing-fact behavior still follows factsSync.onMissingFact. License allow/forbid lists and “must match license policies” remain Thresholds-only.

Missing package facts

Behavior is controlled in Settings → Dependency Advisor (factsSync.onMissingFact), not per rule:

SettingEffect on quality rules that need the missing fact
Allow (default)Skip that threshold — missing facts do not fail the rule
WarningTreat the rule as matched (warning / score impact)
ForbidTreat the rule as matched (non-compliant)

Synced values of 0 (for example zero maintainers after a successful sync) are real data and are still evaluated. Package stats are filled gradually over the week; first scans often have pending facts. Vulnerability count is omitted until OSV sync succeeds (null on failure), so missing-fact settings apply.

Manage with MCP / LLM

With a service token that includes package-finder:read and policy:read (plus policy:write to import), you can ask an MCP client things like:

  • “Evaluate lodash on npm against our org policies.” → evaluate_package
  • “Export our Quality Gates as a policy bundle.” → export_policy_bundle with kind=quality
  • “Validate this quality bundle, then dry-run import it.” → validate_policy_bundle / import_policy_bundle with dryRun=true
  • “Add a rule that forbids packages with more than 0 known vulnerabilities.” → export the quality bundle, edit a rule conditions.maxVulns: 0 (or an expression on vulnerabilityCount), validate, then import. Bundles use apiVersion: codecleared.io/policy/1.1.0.

Related documentation