Skip to main content

patchbot

Bring-your-own-scanner, bring-your-own-feed vulnerability scanning, with Claude Code / Codex opening the fix PR.

inventory ──► feeds (match pkg@ver) ──┐
                                      ├──► findings ──► report (table/json/sarif)
scanners (trivy/grype/osv-scanner/sarif/any cmd) ──┘        └──► fix (agent → branch → PR)
  • Inventory: built-in npm/pnpm/yarn/pip/go/cargo manifest+lockfile parsers, plus any CycloneDX SBOM (syft, cdxgen, or your own).
  • Feeds: OSV.dev by default. Bring your own threat feed as an OSV-schema JSON file or URL — no custom format to write.
  • Scanners: bring your own scanner. Built-in wrappers for trivy, grype, osv-scanner, or point command at any tool that emits trivy/grype/osv-scanner/SARIF JSON.
  • Fix: claude or codex CLI bumps the vulnerable package, re-scans to confirm the advisory is gone, and opens a PR per package.

Install

pip install -e .

(Not yet published to PyPI — install from a local clone or a git URL for now.)

Quickstart

patchbot scan                          # table report, uses OSV by default
patchbot scan --format sarif -o out.sarif
patchbot fix --agent claude --dry-run  # print the fix prompt, make no changes
patchbot fix --agent claude --pr       # open PRs for real (needs `claude` + `gh` on PATH)

Config (patchbot.toml)

[inventory]
paths = ["."]
# sbom = "sbom.cdx.json"

[feeds.osv]
enabled = true

[feeds.internal]
type = "url"          # or "file" with `path = "..."`
url = "https://intel.example.com/osv-feed.json"

[scanners.trivy]
enabled = true

[scanners.mine]
type = "command"
cmd = "./scan.sh"
format = "sarif"       # or trivy | grype | osv-scanner

[report]
fail_on = "high"        # critical | high | medium | low | none
ignore = ["GHSA-xxxx-xxxx-xxxx"]

[fix]
agent = "claude"        # or "codex"
max_prs = 5
test_cmd = "npm test"

CLI flags override the config file.

Bring your own scanner

Any command that emits trivy, grype, osv-scanner, or SARIF JSON on stdout works:

[scanners.custom]
type = "command"
cmd = "my-scanner --json"
format = "sarif"

cmd runs via the shell using your config, so only point it at commands you trust.

Bring your own threat feed

Any URL or file serving OSV schema JSON (a bare array of vuln records, or {"vulns": [...]}):

[feeds.mine]
type = "file"
path = "./our-advisories.json"

Writing a plugin

Register a scanner, feed, or agent from your own pip package via entry points — no fork of patchbot required:

# your_package/pyproject.toml
[project.entry-points."patchbot.scanners"]
mytool = "your_package.scanner:run"          # def run(cwd: str, config: dict) -> list[Finding]

[project.entry-points."patchbot.feeds"]
myfeed = "your_package.feed"                 # module with match(packages, config) -> list[Finding]

[project.entry-points."patchbot.agents"]
myagent = "your_package.agent"               # module with run(prompt: str, cwd: str) -> int

patchbot plugins lists everything currently registered.

GitHub Actions

- uses: ./  # or a published action ref once this is published
  with:
    fail-on: high
    fix: false

See action.yml for all inputs, including fix: true to open auto-fix PRs (requires ANTHROPIC_API_KEY or OPENAI_API_KEY, and permissions: { contents: write, pull-requests: write }).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

patchbot-0.1.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

patchbot-0.1.0-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file patchbot-0.1.0.tar.gz.

File metadata

  • Download URL: patchbot-0.1.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for patchbot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ad8ae51be5a033b5b0de26ce2a3d0b632b8360013afa23a1554f486d344bc181
MD5 236d0aad9296730645721863f5109357
BLAKE2b-256 ecfd4bf8fcb0d8ed3a2957f88bc7deb81140ba476beb05232adf352e86b28766

See more details on using hashes here.

File details

Details for the file patchbot-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: patchbot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for patchbot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5248d61342eae9435a73a5857a3bcd44b0f83ffbf132b5dc61edab4ca1e02a53
MD5 83a8131dd3b42911dc01f1b57dc34205
BLAKE2b-256 6a832e1f7cba322337dc8421eff7dc1bcd18495b69e792120e70c1600688774f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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