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 pointcommandat any tool that emits trivy/grype/osv-scanner/SARIF JSON. - Fix:
claudeorcodexCLI 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad8ae51be5a033b5b0de26ce2a3d0b632b8360013afa23a1554f486d344bc181
|
|
| MD5 |
236d0aad9296730645721863f5109357
|
|
| BLAKE2b-256 |
ecfd4bf8fcb0d8ed3a2957f88bc7deb81140ba476beb05232adf352e86b28766
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5248d61342eae9435a73a5857a3bcd44b0f83ffbf132b5dc61edab4ca1e02a53
|
|
| MD5 |
83a8131dd3b42911dc01f1b57dc34205
|
|
| BLAKE2b-256 |
6a832e1f7cba322337dc8421eff7dc1bcd18495b69e792120e70c1600688774f
|