Skip to main content

PatchSight

Know which vulnerable Python dependencies your code actually calls.

PyPI Python 3.12+ License: Apache-2.0 ci

Dependency scanners flag a package version as vulnerable. PatchSight checks whether your code references the vulnerable functions.

An LLM reads each PyPI security fix offline and records which functions carry the bug. Your scan looks those functions up and checks your code with static analysis: no LLM, no server, and your code never leaves your machine. Only package names and versions are sent to OSV.

Quick start

pip install patchsight

patchsight db update      # download the latest symbol database (SHA-256 verified)
patchsight scan .         # scan the lockfile and the code under .
Option What it does
--lockfile PATH Scan a specific lockfile: requirements.txt, uv.lock or poetry.lock (default: the first found, in that order)
--format json Machine-readable output
--format sarif SARIF 2.1.0 for GitHub code scanning and other SARIF readers
--fail-on called Exit 1 if any alert is CALLED: a CI gate (unknown also fails on UNKNOWN)
--db PATH Use a specific database file (or set PATCHSIGHT_DB)
patchsight explain ID Why the database lists an advisory's symbols: confidence, models, rationale and the changed lines; or why it has none
patchsight report ID Draft a GitHub issue saying an advisory's symbols look wrong, filled with the explain output. Nothing is sent: you review and submit it
patchsight db info Show which database a scan uses, and its age

In GitHub Actions, the PatchSight action scans and uploads the SARIF report to code scanning:

- uses: professor3333/PatchSight@v0.6.0
  with:
    fail-on: called

Verdicts

Verdict Meaning
🔴 CALLED A reference in your code resolves to a vulnerable function, its class, or an entry point that reaches it. Fix these first.
🟢 IMPORTED, NOT CALLED The package is imported, but no vulnerable symbol is referenced. Given only for high-confidence data, which is withheld for now.
⚪ NOT IMPORTED Your code never imports the package directly. It may still be used through other dependencies.
🟡 UNKNOWN No symbol data (the alert says why, for example "the fix changes no Python code"), only low-confidence data, or code the scanner can't follow: dynamic imports, a vulnerable method called on an object of unknown type, a template filter, or a package whose import name isn't known.

Fail towards noise, never towards silence. Every alert is shown. Low-confidence data can raise an alert to CALLED but never lower it, and "not called" covers only direct use that can be resolved statically. PatchSight supports triage; it doesn't judge whether your deployment is vulnerable.

Results

On the Go benchmark of Dunlap et al. (DIMVA 2024), 280 vulnerability reports:

System Precision Recall F1
Every changed function (naive baseline, reproduced) 0.225 0.893 0.360
Best open model in the paper (Mixtral 8x7B) 0.60 0.74 0.66
PatchSight: Qwen3.8-27B, 4-bit 0.751 0.621 0.680

The F1 95% interval is 0.62 to 0.74. The reports and a one-command offline reproduction are in the repository.

On 20 real projects pinned to their May 2024 lockfiles, 74.3% of 3,579 alerts have symbol data, and a scan of a project with 200 or more dependencies takes 1.96 s at the median and 4.96 s at p95, OSV query included (report). On 58 small programs with a known answer, no program that uses the vulnerable code is labelled "not called" or "not imported" (fixtures).

Status: early release

  • Reads requirements.txt (exact == pins only), uv.lock and poetry.lock. Packages without a PyPI release version (unpinned requirements, git, URL or local sources) are listed, not guessed.
  • The symbol database is updated every night and covers about 3,500 PyPI vulnerabilities, all at low confidence so far: every function the fix changed, plus the model's picks where the backfill has reached. High-confidence records are withheld until the confidence rule meets its safety target, so expect UNKNOWN where a later release may say IMPORTED, NOT CALLED.
  • Transitive use and dynamic code (getattr with a computed name, importlib, star imports) aren't analysed. They give UNKNOWN or NOT IMPORTED, never a false "not called".

Code: Apache-2.0. Advisory data: OSV.dev, the GitHub Advisory Database and the PyPA Advisory Database, all CC BY 4.0. No third-party source code is redistributed.

Metadata

Release files for patchsight 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for patchsight 0.6.0
File Size Uploaded Provenance Actions
patchsight-0.6.0.tar.gz 164.2 kB With provenance Details for patchsight-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for patchsight 0.6.0
File Interpreter ABI Platform Actions
patchsight-0.6.0-py3-none-any.whl Python 3 none any Details for patchsight-0.6.0-py3-none-any.whl

Total release size: 361.5 kB

Release files / patchsight-0.6.0.tar.gz

Download URL patchsight-0.6.0.tar.gz
Size 164.2 kB
Tags Source
SHA-256 checksum
How to use checksums
af3ab5fb8b00bbcc0fbf67a3e5e077212cd2aa47d5189bce35b1959c75310287
BLAKE2b-256 checksum
How to use checksums
05754143d792c32f433c2fdd00221a2f441222eb2a2893d08bdf878e1affe82f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / patchsight-0.6.0-py3-none-any.whl

Download URL patchsight-0.6.0-py3-none-any.whl
Size 197.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d56ba98f4100efccaae7d828bfa90796b781ebe8f1a2202a3778eeef090ac9f3
BLAKE2b-256 checksum
How to use checksums
a6dacec32180aea4529bebf0c15e5f16079b83c2b458a32852a0c931d84c49a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for patchsight 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for patchsight-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page