• Codex
  • Claude Code
  • VS Code
  • GitHub Copilot
  • Cursor
  • Cline
  • Windsurf
  • Google Anti-gravity
  • OpenCode
  • Pi
  • Gemini CLI
  • Hermes Agent
  • Zed
  • Junie
  • Qwen Code
  • Kiro
  • Kilo Code
  • Factory Droid

Set up GitHits for your agents

Run this command:

<> bash
npx githits@latest init

What happens next:

  1. Opens your browser to authorize GitHits
  2. Asks whether to set up GitHits at the user or project level
  3. Detects your supported AI coding tools
  4. Lets you choose which tools to configure
  5. Configures the selected tools
Back to blog

October 13, 2026 · 9 min read

A faster dependency check using the GitHits API

Before upgrading a dependency, check which known security issues it fixes or adds. We tested a small agent that gathers the data through GitHits.

Your coding agent proposes upgrading a library your application depends on. Before accepting the change, you want to know which known security issues the upgrade fixes, whether it introduces others, and how large a version jump it makes.

Answering those questions means looking up package releases and security advisories: published reports of vulnerabilities and the versions they affect. A coding agent can do the investigation, but it repeats many of the same lookups each time a dependency changes.

We built a small agent for this recurring check. It uses the GitHits API, an interface a program can call directly, to retrieve package data. Python code compares the versions and counts the advisories. The model receives those results and writes the report.

In our October 14, 2026 test session, this agent with Gemma 4 31B completed a check in a median of 4.6 seconds, meaning half the runs took less time and half took more. Its accuracy was comparable to Codex’s, with the ranking depending on how we counted advisory records. Below, we explain the check, the comparison, and that scoring difference.

The question

Every run answered the same question for a set of dependencies pinned to specific versions:

Our app is upgrading these dependencies to their latest versions: … For each: is it a major/breaking upgrade, how many high/critical advisories affect the current version, how many are fixed by the target, and does the target introduce any new high/critical advisories? Answer as a table.

For scoring, we treated a change in the first version number, such as 1.x to 2.x, as a major upgrade. The prompt calls this “breaking,” but our check doesn’t establish whether the application’s code will break. That requires inspecting how the application uses the library.

How the agent works

The agent is about 200 lines of Python. It runs four steps before calling the model:

  1. Fetch the latest published version of each package from GitHits.
  2. Compare the installed and proposed versions of all packages in one upgrade-review request. The response includes advisories for both versions.
  3. Read GitHub’s reviewed severity labels from the OSV.dev vulnerability database. Keep advisories rated high or critical.
  4. Combine records whose identifiers refer to the same vulnerability. Count which affect the installed version, which the upgrade fixes, and which appear in the proposed version alone.

The model then writes the report from the question and the computed results, with no tools available.

Here is a condensed version of the code. The helper functions handle requests, advisory counting, and report formatting:

def depcheck(pkgs, model):
    # 1. latest version of each package, from the GitHits index
    latest = [get(f"/v1/packages/{reg}/{name}?fields=package")
              ["package"]["latest_version"] for reg, name, _ in pkgs]

    # 2. one batched upgrade review: advisories for current and latest
    batch = [{"registry": reg, "name": name,
              "current_version": cur, "target_version": tgt}
             for (reg, name, cur), tgt in zip(pkgs, latest)]
    reviews = post("/v1/package-upgrade-reviews?fields=security.direct",
                   {"packages": batch})

    # 3 + 4. GitHub severity labels from OSV.dev, aliases merged, counted
    rows = count_high_critical(pkgs, latest, reviews["reviews"], github_label)

    # 5. the only model call: turn the computed table into the report
    return model(prompt(question(pkgs), rows))

If security data is unavailable, the agent retries once and then marks the row as unknown rather than returning a count of zero.

How we tested it

We compared Codex on its own with our GitHits agent, using two models for each. We tested 35 packages pinned to older versions, divided into four sets:

  • Two sets of ten packages from npm, the JavaScript package registry.
  • One set of ten packages from PyPI, the Python package registry.
  • One mixed set: moment, node-fetch, and socket.io from npm, plus aiohttp and tornado from PyPI.

Each of the four setups ran every set five times in shuffled order. That gave us 20 runs per setup and 80 runs in the October 14 session. The Codex-only setups had the GitHits tool connection disabled and no GitHits API key in their environment.

We prepared the answer key from npm, PyPI, and OSV.dev before the runs. A package’s answer counted as correct when all four fields matched: major version change, advisories affecting the current version, advisories fixed, and advisories new in the target. Each setup had 175 answers to score: 35 packages checked five times.

Time, cost, and token use

We first compared both approaches using gpt-6.1-sol. Codex looked up versions, advisories, affected version ranges, and severity labels during the run. The GitHits agent fetched and processed that data in code before calling the model.

Median time fell from 61.2 to 12.8 seconds, about 4.8 times faster. Mean model cost fell from $0.133 to $0.0093, about 14 times lower.

We also tested Codex with gpt-6-astra at high reasoning effort and with web search enabled. For the fourth setup, we replaced gpt-6.1-sol in the GitHits agent with Gemma 4 31B through OpenRouter.

Times are medians, so half the runs finished sooner and half took longer. Costs and token counts are averages per run. Tokens are the units of text the model reads and writes; cached input is text reused from an earlier request. These are model costs, excluding GitHits API fees.

SetupMedian timeMean model costTotal tokensInput (of which cached)Output
Codex alone, gpt-6.1-sol61.2 s$0.133312.1k309.6k (268.8k)2.5k
Codex alone, gpt-6-astra, high effort, web search enabled100.2 s$0.897306.7k303.0k (257.7k)3.7k
GitHits agent + Codex (gpt-6.1-sol)12.8 s$0.009315.0k14.7k (12.3k)0.33k
GitHits agent + Gemma 4 31B4.6 s$0.000150.71k0.53k (0.13k)0.18k

Median time per dependency check for four setups, on a log scale. Codex alone takes 61.2 and 100.2 seconds; the GitHits agent takes 12.8 seconds with Codex and 4.6 seconds with Gemma 4 31B.

Mean cost per dependency check for four setups, on a log scale. Codex alone costs $0.133 and $0.897 per check; the GitHits agent costs $0.0093 with Codex and $0.00015 with Gemma 4 31B.

The Gemma setup completed the check in a median of 4.6 seconds, about 22 times faster than Codex with gpt-6-astra.

The Codex runs used a ChatGPT subscription, so we calculated model costs from logged token usage and list prices. Gemma’s cost came from OpenRouter.

Although web search was enabled for gpt-6-astra, its logs recorded no web calls. It used shell tools instead, averaging 7.8 calls per run.

Why we scored the answers three ways

Two advisory records can describe the same vulnerability or disagree about which versions it affects. Whether we combine those records, and which version ranges we use, changes the expected answer.

We scored the same answers against three rules:

  • Group linked records (“merged”). Combine records linked by aliases and count them once. GitHub Security Advisory (GHSA) and Common Vulnerabilities and Exposures (CVE) records can give the same vulnerability different identifiers.
  • Count advisory IDs separately (“strict”). Count distinct advisory IDs separately, even when they share aliases. For lodash, two GHSA IDs counted as two under this rule and one under the merged rule.
  • Use GitHub’s affected versions (“GitHub ranges”). Use GitHub’s reviewed version ranges to decide whether an advisory affects a package version. Those ranges can differ from the matches returned by OSV.

The scores below show correct package answers out of 175 under each rule.

SetupGroup linked recordsCount IDs separatelyUse GitHub’s affected versions
Codex alone, gpt-6.1-sol158/175163/175168/175
Codex alone, gpt-6-astra, high effort, web search enabled160/175165/175170/175
GitHits agent + Codex (gpt-6.1-sol)175/175170/175165/175
GitHits agent + Gemma 4 31B175/175170/175165/175

Both GitHits setups scored 175/175 under the merged rule, which is also the rule their code uses. They led under the merged and separate-ID rules; Codex with gpt-6-astra led under GitHub’s affected version ranges.

For cryptography and pillow, OSV matched an extra record that GitHub’s reviewed version ranges did not include. Along with lodash, these cases explain most of the score differences. Codex alone also made two isolated errors, one involving mongoose and one involving nuxt.

Give the model a smaller job

Version lookups and advisory counts followed a fixed sequence in this experiment. Moving that sequence into code reduced the number of times we called the model and the amount of text it processed.

Here, the model only had to write the report, and Gemma was sufficient. Deciding which upgrades to make and how to adapt the application takes more reasoning. That is where we want the coding agent to focus.

GitHits lets agents retrieve source, documentation, and package data for the versions they are investigating. An existing coding agent can choose its own queries through the command-line interface (CLI) or Model Context Protocol (MCP) connection. For this recurring check, we wrote the sequence ourselves using the API.

Run the check when a dependency changes

In a software factory, a workflow coordinates agents that build and maintain an application. This check could run after an agent changes a manifest or lockfile, the files that record dependencies and their versions. The next step would receive the report and could investigate flagged packages before continuing. The 4.6-second median came from this test session; it is a useful starting point for evaluating that workflow.

Build it with the GitHits API

The upgrade-review endpoint accepts multiple packages in one request. Here is a comparison of two pinned dependencies and their target versions:

curl -X POST https://api.githits.dev/v1/package-upgrade-reviews \
  -H "Authorization: Bearer $GITHITS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "packages": [
      {
        "registry": "npm",
        "name": "lodash",
        "current_version": "4.17.20",
        "target_version": "4.18.1"
      },
      {
        "registry": "pypi",
        "name": "urllib3",
        "current_version": "1.26.4",
        "target_version": "2.8.0"
      }
    ]
  }'

See the API documentation for the full set of operations. The REST API is available for evaluation; its v1 contract is still being finalized.

If you’re building a workflow that checks dependency changes, book a call to discuss integrating the API.

Get started

GitHits in one command

Install GitHits or refresh an existing setup with the same command.

npx -y githits@latest init