Skip to main content

borehole

Technical due diligence, read from your repository on your own machine.

borehole reads a git repository on the machine you run it on and sends a bundle of facts about it: counts, file paths, line numbers, dates, names of dependencies, and matched lines of up to 120 characters. The repository stays on your machine, and whole files are never sent. You get back a report with a commit, a path and a line range behind every finding.

pip install borehole
export BOREHOLE_TOKEN=bh_…          # from borehole.dev/account
borehole collect . --dry-run        # print exactly what would be sent
borehole collect .                  # send it, get a report

Run --dry-run first

It prints the entire bundle and sends nothing about your repository. You are being asked to send facts about your codebase to a third party, and you should be able to read those facts before the first time and whenever you like afterwards.

Run it with your token set. The detection patterns are not in this package; they are fetched for each run, and a dry run with a token fetches them too, so it prints the quoted lines a real run would send. That fetch is the only request it makes, and its body is empty.

Without a token it makes no network request at all, and prints everything except the pattern matches.

What leaves, precisely

Sent Not sent
Commit SHAs, dates, subjects, insertion and deletion counts File contents
Which files changed in which commit Author names and email addresses
The list of tracked file paths, and tags with their commit and date Anything not produced by a registered extractor
Whether each changed file was binary (0.4.0)
Pattern matches in notebooks, committed .env files, web templates and mobile manifests, under the same rules as any file (0.5.0) The value of any setting named like a credential: a match records the name only
Each locked dependency from a public registry: ecosystem, name, version, and whether the lockfile marks it as shipping (0.4.0) Dependencies from a private registry, a git URL or a local path
The remote's host and path, or the directory name if there is none
Where a pattern matched: path and line number
Up to 120 characters of the matched text The text of anything that looks like a credential
Where a credential-shaped string was ever committed: commit, path, kind; from 0.7.0, whether its line was a comment, named a local or example host, or was an environment fallback The line
Names found in lines the history added or removed (a feature-flag key, an API version, a dependency, a CI platform), with dates (0.6.0) The line itself
Which packages of your published Go dependencies the code imports (0.6.1) Your own package paths
Which tracked paths are symbolic links (0.6.1) Where they point
Which vendored files open with a licence notice, and which phrase (0.6.2) The notice itself
Which vendored components a notices file names, and which file (0.6.2) The notices file's text
A status line on the README's first screen, such as "no longer maintained", without addresses or handles (0.7.0) The rest of the README
Where a contributing, security or governance file states a policy: a mirror, no pull requests, one maintainer, an AI policy, a named foundation (0.7.0) The line itself
The licence identifier of each past version of the root licence file, with its commit and date (0.7.0) The licence text
Submodule paths (0.7.0)
Two counts about the tree: files, lines

Author names and addresses are hashed before they leave, with HMAC-SHA256 under a random key the collector makes for one survey, holds in memory and never sends or writes down. The same person is the same identity within one survey and not across surveys. Every measurement counts and compares; none of them needs a name.

Without that key nobody, Borehole included, can test whether a guessed address belongs to one of a bundle's authors. Collectors before 0.7.12 salted the hash with the repository's head commit, which is in the bundle, so anyone holding one of their bundles could. The hash is still a pseudonym, not anonymity: each commit's id, date and subject cross beside it, and anyone who can read the repository can look its author up. A report stores authorship only as counts and bands, never a name, an address or one person's exact share.

One honest caveat. Four checks quote the line they matched, because for those the line is the evidence — a TODO's wording, a commit subject, an unpinned dependency, and (from 0.7.0) a status line on the README's first screen such as "no longer maintained". If somebody wrote a colleague's name in a TODO, that text crosses; addresses and @handles are removed from a README status line before it does. --dry-run shows you, and the report's owner can strip quoted evidence afterwards.

What this rests on

The detection patterns come from Borehole's server on each run, so what is sent also depends on what the server asks for. From 0.6.1 the collector does not take that on trust:

  • It refuses a pattern that matches ordinary text rather than something a check looks for, before reading anything.
  • It refuses to send a bundle carrying more than 6,000 characters of matched text from any one file, or 1,000,000 in all.
  • A history pattern can send back only a short name, never a line.

The connection uses TLS; the collector does not pin a certificate. And --dry-run shows you the whole bundle before anything is sent.

In your own cloud, with proof

For a reader who needs proof the facts were not edited, the collector also runs as a container inside a Confidential VM in your own Google Cloud project. Google signs the exact bytes it sends, and the report carries that signature. Your repository never leaves your project. Instructions and the setup script are at https://borehole.dev/confidential.

Your token, from a script

The token in BOREHOLE_TOKEN can also make two calls of its own, each for the account the token belongs to, when it was made with their scopes. Send it as Authorization: Bearer bh_….

A token carries the scopes ticked when it was made on the account page: collect (the collector itself, and the default), delete and survey. A call outside a token's scopes answers 403 and names the scope it needs. To add one, make another token with it ticked.

Delete needs delete, and survey needs survey.

Delete one of your private reports. Name it by the scan_id the collector was answered with, or by the address it printed, from /r/ on:

curl -X DELETE -H "Authorization: Bearer $BOREHOLE_TOKEN" \
  https://borehole.dev/api/report/acme/payments/1a2b3c4

It is the same deletion as the account page's, and it cannot be undone. The report's verification code then says it was deleted. A report that is not one of this account's private reports answers 404, whoever surveyed it: another account's, any public report, and one already deleted.

Survey a public repository as your account:

curl -H "Authorization: Bearer $BOREHOLE_TOKEN" \
  -d '{"repo": "owner/name"}' https://borehole.dev/api/survey

It is the site's free survey, counted against your account's allowance. A commit already read answers 200 with its report. A new one answers 202, and report is a page that becomes the report. Add "paid": true to spend one use of your account's key instead, as the redeem page does.

Any git repository

GitHub, GitLab, Bitbucket, Azure DevOps, a self-hosted install of any of them — or no host at all. A bare repository on a file server, a clone inside a data room, a laptop with the wifi off. If git log works, this works.

Without a host to ask there are no stars, no language breakdown and no repository size. That is audience data rather than engineering data, and a private repository never had it either.

What this package is not

This is the collector. The assessment itself — the thresholds, the bands, the rejection reasons, the wording that makes a finding worth acting on — runs on Borehole's servers and is not in this package. Detection patterns are fetched for each run rather than shipped here.

So reading this source tells you exactly what leaves your machine, which is the question this package exists to let you answer. It does not tell you how the judgement is made. Both of those are deliberate.

Requires

Python 3.10 or newer, and git on the PATH. No other dependencies.


borehole.dev · what happens to your code · terms

Metadata

Release files for borehole 0.7.13

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

Built distribution (wheel)

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

Release files / borehole-0.7.13-py3-none-any.whl

Download URL borehole-0.7.13-py3-none-any.whl
Size 130.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
662b5a873c5f7fc4f37b0f7614747c2680b96269fcc6de394a9176e26e433200
BLAKE2b-256 checksum
How to use checksums
2f6bfc0ee7c95838d15d4310aa85433b2ed4d2a7347e56aebf6c16987df9160e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Security for borehole 0.7.13

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

1 file in this release has been uploaded with provenance metadata.

Attestation for borehole-0.7.13-py3-none-any.whl

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 Oct 4, 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