Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

RefHound

Git repository security and forensic analysis tool.

RefHound deeply inspects git repositories in order to surface information that is no longer visible in the current working tree:

  • deleted branches, lost / unreachable commits, dangling objects
  • secrets that were introduced and later removed
  • historical versions of credentials, keys and configuration
  • suspicious CI/CD, authentication and deployment changes
  • timeline, identity and force-push anomalies

It behaves like a combination of git forensics, repository archaeology, secret scanning, history analysis, security audit and repository inventorying. It answers the question:

What happened in this repository, what information is still findable, and where should a security reviewer look?

RefHound is a defensive tool for repositories you are authorized to analyse. It never attempts to bypass an access control, brute-force object IDs or validate/reuse found credentials.

Full documentation is available at https://refhound.readthedocs.io/.

Installation

During development:

uv sync --all-extras

(Once packaged: pipx install refhound.)

Quick start

refhound scan .                  # standard profile
refhound scan . --deep           # deep archaeology (unreachable + lost chains)
refhound scan . --format json    # machine-readable output
refhound scan . --fail-on high   # exit 1 if a HIGH (or worse) finding exists

refhound secrets .
refhound lost .
refhound timeline .
refhound interesting .
refhound stats .
refhound doctor .
refhound report . --format markdown -o report.md
refhound analyze churn .

Completed scans are persisted locally. Run refhound scan URL --deep once; all reporting and analysis commands then reuse its complete snapshot while refs and relevant settings remain unchanged. scan itself also uses the cache unless --fresh is passed. Remote mirrors are reused and are not automatically downloaded again. Use --refresh-remote to fetch/prune a mirror, --fresh to rerun analysis without fetching, and --offline to prohibit network acquisition. Full secret values are never stored; scan, repository, commit, author, finding, and redacted secret metadata are.

Exit codes: 0 clean / 1 findings above --fail-on threshold / 2 usage or configuration error / 3 git, repository or provider error / 4 internal error / 5 scan incomplete because a recoverable component failed.

Project structure

refhound/
|-- pyproject.toml
|-- docs/                Sphinx (Read the Docs) documentation
|-- src/refhound/
|   |-- cli.py           command line interface
|   |-- config.py        profiles and .refhound.yml
|   |-- git/             centralised git command layer
|   |-- models/          pydantic data models
|   |-- detectors/       secret detectors
|   |-- scanners/        scan pipeline stages
|   |-- analysis/        correlation, scoring, anomaly analysis
|   |-- providers/       internal GitHub/GitLab adapter scaffold (not public in v0.1)
|   |-- storage/         SQLite persistence (SQLAlchemy)
|   |-- reporting/       console, JSON, Markdown, SARIF
|   `-- util/            hashing, redaction, date/path helpers
`-- tests/               unit + integration tests over fixture repos

Security promises

  • Found secrets are redacted by default (ghp_ABCD...IJK); only fingerprints, prefixes and suffixes are persisted.
  • Full secret values are never written to console, JSON, Markdown, SQLite, logs or exceptions.
  • No token validation, no login attempts, no credential reuse, no enumeration of private repositories.
  • Facts and interpretation are strictly separated; heuristic results carry an explicit confidence value.

See SECURITY.md.

Development

uv sync --all-extras
uv run ruff check .
uv run ruff format --check .
uv run mypy src/refhound
uv run pytest

Documentation build

uv sync --all-extras
uv run sphinx-build docs docs/_build

License

MIT - see LICENSE. Copyright (c) 2026 Michael Weiss.

Metadata

Release files for refhound 0.1.0b1

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

Source distribution (sdist)

Source distribution for refhound 0.1.0b1
File Size Uploaded Provenance Actions
refhound-0.1.0b1.tar.gz 213.8 kB With provenance Details for refhound-0.1.0b1.tar.gz

Built distribution (wheel)

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

Total release size: 332.3 kB

Release files / refhound-0.1.0b1.tar.gz

Download URL refhound-0.1.0b1.tar.gz
Size 213.8 kB
Tags Source
SHA-256 checksum
How to use checksums
90241259138a9f40789911f05b758fa85cbed847446bf767efbe9e56de792b7a
BLAKE2b-256 checksum
How to use checksums
48c8411357473f2452710f0aa0e98b2ebb433b71137cc71ba739c6727201f5fa
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 4, 2026.

Transparency log

Release files / refhound-0.1.0b1-py3-none-any.whl

Download URL refhound-0.1.0b1-py3-none-any.whl
Size 118.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b7d675455e29cd9885f01594947dad93f5871db7d5a4ac1a8f427affe4a9b4c
BLAKE2b-256 checksum
How to use checksums
d33634ff264b6b1ec4bc12fa734eb71bb18368f81ff9ab7269671fd45e8ca486
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 4, 2026.

Transparency log

Security for refhound 0.1.0b1

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 refhound-0.1.0b1.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 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.

Release history Release notifications | RSS feed

This release
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