Zum Hauptinhalt springen
Version: Next 🚧

Agent Workflows

DepCheck earns its keep when it runs inside an agent's edit loop, not as an afterthought. This page is the playbook Cert-IX uses on its own monorepo, distilled so you can apply it to yours.

The core discipline: check before you add​

The rule is simple and it is the whole game:

Before writing any dependency into a manifest, or pinning or upgrading one, check it with DepCheck. Write it only when the verdict is OK; otherwise pick a published, clean version instead.

Wired this way, a vulnerable version never lands in the first place, and neither does a package that does not exist. There is no "scanner caught it in CI a day later, now unwind the change" loop, because the bad version was never chosen.

The loop​

Agent is about to add or bump a dependency
│
▼
check_package(ecosystem, name, version)
│
├── OK ──────────────────▶ write the version
├── VULNERABLE ──────────▶ suggest_safe_version(ecosystem, name),
│ write that version instead
├── NOT FOUND ───────────▶ do not install: find the real package
├── VERSION NOT FOUND ───▶ pick a published version
└── CANNOT VERIFY ───────▶ confirm the name and version in the
registry before writing anything

After editing:
scan_dependencies(lockfile) ← nothing vulnerable, nothing left unchecked?

The five verdicts are described in the Tools reference.

Dropping it into an agent's instructions​

The most reliable way to make an agent do this is to put the rule in its project instructions (a CLAUDE.md, .cursorrules, agent system prompt, or equivalent). Here is a policy you can paste, based on the one Cert-IX uses in its own monorepo:

## Dependency safety (DepCheck, MANDATORY)

Before adding, pinning, or upgrading ANY dependency (go.mod, package.json,
Cargo.toml, requirements.txt, pyproject.toml, pom.xml, composer.json), check it
with the DepCheck MCP tools:

- `check_package(ecosystem, name, version)` BEFORE writing a new dependency
into a manifest. Write it only when the verdict starts with OK.
- VULNERABLE: pick the version with `suggest_safe_version(ecosystem, name)`;
never hand-pick a version with known Critical/High advisories.
- NOT FOUND / VERSION NOT FOUND: the package or the version does not exist.
Do not install it; find the real name or a published version.
- CANNOT VERIFY: not a clean result. Confirm the name and version in the
registry before writing it.
- After editing a manifest (or when starting significant work in a service),
run `scan_dependencies` on the lockfile (its text as `manifest_content`, its
file name as `manifest_name`) and fix what it reports, upgrading to the
`upgrade_to` versions. A row with `upgrade_partial_to` instead leaves the
advisories in `upgrade_remaining` open: report them. If the verdict says
"NOT checked" or "NOT fully checked", the result is partial: say so.
- `get_advisory(id)` for detail when deciding whether a finding is exploitable
in context.
- Advisories flagged `exploitation: kev` (on CISA KEV, known exploited in the
wild) are being actively attacked: fix those FIRST, ahead of
higher-CVSS-but-unexploited issues; `high_epss` (predicted) comes next.
`get_cve_intel(id)` gives the KEV/EPSS/CVSS detail for prioritisation.

Versions from ranges (`^`, `~`, `>=`) are checked at their declared minimum:
the scan verdict names each one; scan the lockfile for installed truth.

Adapt the manifest list and tool names to your stack; the shape is what matters.

Common plays​

Adding a new dependency​

"Add a Redis client to this Go service."

The agent resolves a candidate (github.com/redis/go-redis/v9 at some version), calls check_package, and, if the verdict is OK, writes it. If it is VULNERABLE, the agent calls suggest_safe_version and writes that. If it is NOT FOUND, the agent was about to install a name that does not exist (a typo, or a package a model made up) and it looks for the real one instead. You get a safe dependency on the first try.

Auditing an existing service​

"Are this service's dependencies safe?"

The agent reads the lockfile and calls scan_dependencies. The answer first says what it could not check, then lists the vulnerable packages with their upgrade targets, ordered so that known-exploited issues come first, and any names or versions that do not exist. What a parser skips (a local path, a git or URL dependency, a workspace member, a module of your own Maven build, a SNAPSHOT version) is named, so the agent can report it instead of calling the scan clean. The agent proposes the bumps; you review and apply. If the agent scanned a manifest such as package.json instead, the answer names every version range it checked only at its lower bound, and the Coverage sentence reminds it that transitive dependencies were not checked. Scan the lockfile as well.

Triaging a noisy result​

Not every advisory matters for how your code uses a package. When a scan returns something borderline:

  1. Count vulnerabilities, not entries. Entries that share a group are records of one vulnerability published by several databases (GitHub, PyPA, Go, RustSec): one problem, not several. When those records disagree about the fixed version or the affected range, conflicts says so, and the upgrade target has been checked against all of them.
  2. Read the upgrade status. partial means no release fixes everything: the target (upgrade_partial_to) clears the rest, and each advisory in upgrade_remaining needs a decision of its own. For a Go module, the note names the import paths it is limited to, so you can check whether your code imports them.
  3. get_advisory(id): read the CVSS vector and the affected code path. Does your usage touch it? Given a CVE ID, it returns the package advisory about that CVE; note says when the record returned is not the ID you asked for, or was withdrawn by its publisher.
  4. get_cve_intel(id): is it on CISA KEV, or high-EPSS? If it is KEV-listed, it does not matter how narrow the path looks; treat it as urgent. If the answer says KEV status UNKNOWN, the exploitation data was stale: that is not a "no"; check the CISA KEV catalogue.

This keeps the team fixing the things that are actually dangerous instead of chasing every low-signal finding.

Why this beats scan-in-CI alone​

CI scanning is still worth having as a backstop, but on its own it is reactive: the vulnerable version is already committed, the PR is already open, and a human has to loop back. DepCheck-in-the-loop is preventive: the agent never chooses the bad version, so there is nothing to unwind. Use both: prevent at authoring time, verify at merge time.

Gating a build on a scan​

Cert-IX's own build gate runs scan_dependencies on each service's dependencies and fails closed: an unreachable scanner, a dependency not fully checked (unchecked_count above 0), an advisory the scan could not list or fetch, or a NOT FOUND / VERSION NOT FOUND dependency fails the build. An advisory blocks the build when:

  • its severity is on the gate's list (Critical and High, for example);
  • it names a fixed version that the build did not take, whatever its severity (Unknown means unreviewed, not low); or
  • it is a malicious-package record, an OSV MAL- ID. Such a record has no score and names no fix, because the package itself is the threat, so neither rule above would catch it. The remedy is removing the package.

An exception names one advisory and has an expiry date. A permanent exception is accepted only for an advisory that has no fix at any version, and never for a MAL- advisory: "no fix exists" is always true of malware, so it proves nothing. If you build your own gate on DepCheck, these rules are a good starting point.

Honest limits to design around​

  • DepCheck reports what the advisory databases know at lookup time, and advisories_as_of dates that data (on the hosted endpoint, normally at most about 6 hours old). Re-scan periodically; new advisories land for versions that were "clean" yesterday.
  • A manifest such as package.json or pom.xml lists direct dependencies only; transitive ones are checked only when you scan the lockfile. DepCheck does not analyse your application code.
  • A range is checked at its lower bound, and the registry check only asks whether some published version lies inside it. The installed version can be any release in the range: scan the lockfile for what is installed.
  • What a parser cannot check is listed under skipped, never dropped silently. Sections a parser does not read, such as <profiles> in a pom.xml, are not counted at all.
  • The registry check sees public registries only: a private package reads NOT FOUND, and for Packagist, Hex and Pub, DepCheck cannot verify that a package exists.
  • An OK means nothing known, not proven safe. Keep your other controls (SAST, review, least privilege): DepCheck removes the known-bad, it does not certify the unknown.

See Security & data handling for what leaves the perimeter when the agent makes these calls.

War diese Seite hilfreich?