Vigil Selectors

A Vigil selector is the JSON expression that says which alerts a policy rule or an alert resolution applies to. It is the vigil_selector field in the policy rules and alert resolutions API endpoints. The dashboard's rule editor builds one for you visually, but over the API you write it by hand.

A selector is an object whose keys are dotted field paths under finding., location., or artifact.:

{
  "finding.alertType": "criticalCVE",
  "finding.severity": { "$in": ["critical", "high"] },
  "artifact.type": "npm"
}

Top-level fields are implicitly AND-logic: for the selector to match, every field in the object must match.

Fields

Fields describe three families of facts. The values each field takes are the same ones the dashboard's rule editor offers. See Policies for the full value lists.

location.* — where the dependency was found

FieldTypeNotes
location.repostringRepository full name, e.g. my-org/payments-api
location.repoLabelstringThe repository label grouping several repositories
location.manifeststringRepo-relative path of the manifest or lockfile, e.g. services/api/package.json

artifact.* — the package itself

FieldTypeNotes
artifact.typestringEcosystem: npm, pypi, maven, gem, golang, nuget, cargo, composer, github, vscode, huggingface
artifact.namestringPackage name without namespace, e.g. express
artifact.namespacestringNamespace or scope, e.g. @angular; empty string for unscoped packages
artifact.versionstringe.g. 4.17.1 — exact, prefix, suffix, or substring; there are no version ranges
artifact.publisheddatePublication date — YYYY-MM-DD or a relative window with $before / $after
artifact.scores.overallnumberSocket overall health score, 0100
artifact.scores.licensenumberLicense score, 0100
artifact.scores.maintenancenumberMaintenance score, 0100
artifact.scores.qualitynumberQuality score, 0100
artifact.scores.vulnerabilitynumberVulnerability score, 0100
artifact.scores.supplyChainnumberSupply chain score, 0100

finding.* — what the alert says

FieldTypeNotes
finding.alertTypestringe.g. criticalCVE, malware, installScripts
finding.categorystringsupplyChainRisk, vulnerability, quality, maintenance, license, other
finding.severitystringcritical, high, medium, low
finding.prioritystringSocket's composite priority: critical, high, medium, low
finding.cvssnumberCVSS base score, 0.010.0
finding.cveIdstringe.g. CVE-2024-29041
finding.ghsaIdstringe.g. GHSA-xvch-5gv4-984h
finding.reachabilitystringreachable, maybe_reachable, unreachable, pending, missing_support, direct_dependency, undeterminable_reachability, unknown, error
finding.fixAvailablebooleanAn upstream fixed version exists
finding.hasKEVbooleanThe CVE is in the CISA Known Exploited Vulnerabilities catalog
finding.cvePatchStatusstringpatch_unavailable, patch_available, patch_applied — Socket's patch, distinct from fixAvailable

Operators

A bare value means equality. For anything else, use an operator object:

OperatorMeaning
$neNot equal
$in / $ninMatches any / none of a list
$gt, $gte, $lt, $lteNumeric comparison
$prefix, $suffix, $includesString starts with, ends with, contains
$containsArray field contains the value
$before, $afterDate comparison; a date like 2026-01-31 (YYYY-MM-DD), or relative like now-7d, now-2w, now-6m, now-1y (lowercase units: d, w, m, y)
$existsWhether the field is present at all

Combining Clauses

Nest selectors with $and, $or, and $not:

{
  "$and": [
    { "finding.category": "vulnerability" },
    { "finding.severity": { "$in": ["critical", "high"] } },
    { "$not": { "location.repo": "my-org/sandbox" } }
  ]
}

This is how the dashboard expresses exceptions: a rule with exceptions becomes a selector whose conditions are ANDed with $not of the exception clauses.

Absent Fields Fail Closed

If a fact is absent for an alert, any condition on that field fails — including negated ones. The common case is location.manifest: transitive dependencies often have no attributed manifest, so a location.manifest condition — even $ne or $nin — will not match those dependencies. Use manifest conditions to narrow, never for catch-alls.

Related Pages

  • Policies — the rules selectors power, and the value lists for each field.
  • Resolve Alerts — resolutions take the same selector as their scope.
  • Updating API Integrations — mapping older Socket API endpoints onto their replacements.

Did this page help you?