The repository or configuration that created this release differ from a previous release. View details.
leakscan
Find leaked API keys and secrets in your code, git history, notebooks, archives, Docker images and packages.
Quick start
pipx install leakscan # or: pip install leakscan / brew install vasishta03/leakscan/leakscan
leakscan scan . # scan the current project
leakscan install-hook # block commits that contain secrets
Every finding tells you what the key can do if someone else has it, and where to rotate it.
What it scans
| Target | Command |
|---|---|
| A folder or file | leakscan scan ./src |
| Staged changes (pre-commit) | leakscan scan . --staged |
| Only what a PR adds | leakscan scan . --pr or --base main or --since-commit abc123 |
| Git history | leakscan scan . --history --since 2024-01-01 |
| Jupyter notebooks (per cell and output) | leakscan scan notebooks/ |
| Zip, tar, wheel and jar files | leakscan scan . --archives |
| stdin or a string | cat .env | leakscan scan - or leakscan scan --text "..." |
| Any git remote (GitHub, GitLab, Bitbucket) | leakscan scan https://gitlab.com/group/project |
| A whole GitHub org | leakscan scan --github-org my-org --resume org.json |
| A Docker image, layer by layer | leakscan scan docker://myapp:latest |
| A published package | leakscan scan pypi:requests==2.32.3 or npm:left-pad@1.3.0 |
| A log as it grows | leakscan scan app.log --follow |
There are 208 rules, each with a stable ID like LS-AWS-001. They cover cloud providers, AI and ML APIs (OpenAI, Anthropic, Mistral, Groq, xAI, Hugging Face and more), payment providers, CI tokens, databases, and secrets hardcoded in Dockerfiles, Terraform, Kubernetes manifests and GitHub Actions workflows. Run leakscan rules list to see them all.
Fewer false positives
- Placeholders like
EXAMPLE,changeme,xxxx,${VAR}and<your-key>are ignored. - GitHub tokens are checked against their built-in CRC32 checksum, card numbers against Luhn, and JWTs must decode.
- Each finding has a confidence score. It goes up near words like
secretortoken, and down in tests, fixtures and docs. - To ignore one line, add
# leakscan:ignore LS-AWS-001(or just# leakscan:ignore).# nosecand# gitleaks:allowalso work.
Check if a key is still live
leakscan scan . --verify
leakscan scan . --verify --verify-only github,openai --verify-timeout 3
This sends each key to its own provider (one read-only "who am I" style request) and marks it active, inactive, unknown or error. It supports 51 secret types. For anything you don't own (a remote repo, an org, an image or a package), you have to pass --yes. The verification docs list exactly which URL each check calls.
CI
GitHub Actions:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: Vasishta03/leakscan@v1
with:
mode: pr # full, pr or history
fail-on: HIGH
pr-comment: true
This uploads SARIF to code scanning and writes a job summary. Recipes for GitLab CI, Jenkins and CircleCI are in the docs.
pre-commit:
repos:
- repo: https://github.com/Vasishta03/leakscan
rev: v0.5.1
hooks:
- id: leakscan
Output formats: terminal, json (versioned schema), sarif, html, junit, markdown, csv, sonarqube, defectdojo. Exit codes: 0 clean, 1 findings at or above --fail-on (default HIGH), 2 error.
Python API
import leakscan
result = leakscan.scan_path("src/")
for f in result.findings:
print(f.rule_id, f.file, f.line_number, f.confidence)
leakscan.scan_text(open(".env").read(), filename=".env")
AI coding agents
leakscan hook stops Claude Code or Cursor from writing a secret into a file or a shell command. leakscan mcp runs an MCP server so an agent can scan text or files before it commits. Setup is in the agent docs.
How it compares
All three are good tools. Pick the one that fits.
| leakscan | gitleaks | trufflehog | |
|---|---|---|---|
| Install | pip, pipx, brew, Docker, binaries | Go binary, brew, Docker | Go binary, brew, Docker |
| Built-in detectors | 208 | about 200 | 800+ |
| Live key verification | 51 types, opt-in | No | Yes, most detectors |
| Staged / diff scanning | Yes | Yes (--staged) |
Yes (--since-commit) |
| Archives and decoding | Yes (opt-in) | Yes | Yes |
| Docker images, GitHub orgs | Yes | No | Yes, plus S3, GCS, Postman and more |
| PyPI / npm packages | Yes | No | No |
| Notebook cell and output locations | Yes | No | No |
| Blast radius and rotation link per finding | Yes | No | No |
| Python API | Yes | Go library | No |
| SARIF | Yes | Yes | Yes |
Use gitleaks if raw speed matters most. In our benchmark it scanned the requests repo's full history 4.4x faster than leakscan. Use trufflehog if you need verification across hundreds of services or sources like S3 and Postman. leakscan is the easiest of the three to drop into a Python project or a notebook workflow.
More
- Docs: configuration (
.leakscan.yaml, allowlists, per-directory overrides, rule packs), every CLI flag, the rule catalog, and notifications (Slack, Discord, Teams, email, webhooks) - Changelog
- Contributing. Adding a new rule takes about 10 minutes.
- Security policy
leakscan sends no telemetry. It only makes network calls when you ask for them (--verify, remote targets, --notify).
If leakscan caught something for you, a star helps other people find it.
MIT licensed.
Metadata
Release files for leakscan 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Change of provenance
The repository or configuration that created these release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| leakscan-0.5.1.tar.gz | 102.4 kB | With provenance | Details for leakscan-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| leakscan-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for leakscan-0.5.1-py3-none-any.whl |
Total release size: 198.2 kB
Release files / leakscan-0.5.1.tar.gz
Change of provenance
This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
| Download URL | leakscan-0.5.1.tar.gz |
|---|---|
| Size | 102.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea2cfc41cd9421a5bad9c8f316c8c00a6431adc56cd387cfff1d795cdf863afe
|
|
BLAKE2b-256 checksum How to use checksums |
69edd77923b8175516927583f4244109c3f75589063b1d65e326759f466dc948
|
| 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 15, 2026.
Transparency logRelease files / leakscan-0.5.1-py3-none-any.whl
Change of provenance
This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
| Download URL | leakscan-0.5.1-py3-none-any.whl |
|---|---|
| Size | 95.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3fedb1d32a81ab82c50ebc8362c68b93065c0087039a6d710f8d33b07850d28
|
|
BLAKE2b-256 checksum How to use checksums |
209080830e5a95c8ae664d28e723efb88422fc96c1e3e758840492c3320f8d70
|
| 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 15, 2026.
Transparency logSecurity for leakscan 0.5.1
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.
Change of provenance
The repository and configuration that created this release differ from a previous release.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Repository
- Removed 0.5.0 github.com/Vasishta03/secret-scanner
- Added 0.5.1 github.com/Vasishta03/leakscan
Attestation for leakscan-0.5.1.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 15, 2026.
Transparency logA 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.