Skip to main content

KeyLeak Detector

Find the API keys and open Supabase/Firebase tables your running app actually ships.

PyPI License GitHub stars

Static scanners read your source. KeyLeak watches the running app (traffic, JS bundles, headers) and tests whether your backend is readable with the public key. You get a verdict, redacted evidence, fix steps, and a re-test command. Reports stay on your machine. Website: keyleakdetector.com

KeyLeak scan ending in BLOCK SHIP

Only scan apps you own or are authorized to test. Probes are read-only. Reports redact credential values.

Try it

  • Chrome extension (browse your app, see findings as pages load): Chrome Web Store

  • CLI (Python 3.12 or newer required; older Pythons install the outdated 0.5.0 release):

    pip install keyleak-detector
    keyleak local . --launch-profile launch-gate --fail-on high
    python -m playwright install chromium   # once, for browser scans
    keyleak browser-scan https://your-owned-app.example --baas-validate
    
  • Browser app (scans pasted text and files on your device, no Python): build and serve it locally.

Example result

keyleak local . --launch-profile launch-gate --fail-on high on a copy of the repository's fake-key fixture (fixtures/vulnerable-demo), trimmed:

BLOCK SHIP: 4 critical, 1 high, 4 medium, 1 low
5 high/critical exposure(s); static detections — verify before relying on them. Fix before release.
Re-test: keyleak local /private/tmp/acme-app --include ci,code,config,docker,env,logs,mcp,sourcemaps --launch-profile launch-gate --packs leak --fail-on high
Coverage: complete; 3/3 checks completed; 0 skipped, 0 failed.
- CRITICAL openai_api_key at /private/tmp/acme-app/.env.leaky: [redacted:8003d7c8]
- CRITICAL database_url at /private/tmp/acme-app/.env.leaky: [redacted:a15e8e37]
- CRITICAL openrouter_api_key at /private/tmp/acme-app/app.js.map: [redacted:f21e9200]
- HIGH mcp_config_secret at /private/tmp/acme-app/.env.leaky: [redacted:540d08fb]
...

Add --markdown, --html, --json, or --sarif for the full report. Each finding carries its fix:

### CRITICAL: openai_api_key
- Source: `/private/tmp/acme-app/.env.leaky`
- Evidence: `[redacted:9162cc36]`
- Fix steps:
    1. Rotate the OpenAI key, remove it from client/config files, and load it server-side from a secret manager.

The command exits 2 when findings reach --fail-on or coverage is incomplete.

Why not just gitleaks or trufflehog

  • The secrets that hurt are the ones users receive: injected at build time, served in bundles, or exposed by a backend with RLS off.
  • Source scanners read the repository, so they miss what only exists in the built or running app.
  • Use KeyLeak next to your source scanner, not instead of it.

What it detects

  • API credentials, private keys, and JWT risks in browser responses, JS bundles, source maps, and local files.
  • Supabase, Firebase, Appwrite, PocketBase, and Convex configuration or access-control issues.
  • Risky npm lifecycle hooks, CI workflow settings, and exposed local configuration.
  • Opt-in application-security leads, labeled for review when they are not validated exploits.

Safe use

  • Scan only systems you own or have permission to test.
  • --baas-validate sends active read-only probes to the Supabase/Firebase project the app uses, with the key found in the app; leave it off unless you are authorized.
  • Apart from that, detected keys are never sent to their provider to check whether they are live. Details: security model.

CI

- uses: actions/checkout@v4
- uses: Amal-David/keyleak-detector@v0.8.0
  with:
    mode: local
    fail-on: high

Browser mode, SARIF upload, and preview-deployment examples: GitHub Action guide.

More

Contributing, security, license

See CONTRIBUTING.md to set up a checkout and add detectors. Report vulnerabilities privately through SECURITY.md; review ownership is in MAINTAINERS.md. MIT licensed: LICENSE.

Metadata

Release files for keyleak-detector 0.8.1

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

Source distribution (sdist)

Source distribution for keyleak-detector 0.8.1
File Size Uploaded Provenance Actions
keyleak_detector-0.8.1.tar.gz 205.2 kB With provenance Details for keyleak_detector-0.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for keyleak-detector 0.8.1
File Interpreter ABI Platform Actions
keyleak_detector-0.8.1-py3-none-any.whl Python 3 none any Details for keyleak_detector-0.8.1-py3-none-any.whl

Total release size: 436.8 kB

Release files / keyleak_detector-0.8.1.tar.gz

Download URL keyleak_detector-0.8.1.tar.gz
Size 205.2 kB
Tags Source
SHA-256 checksum
How to use checksums
168e6269d9acf65c48a36a06544b845522d37730f4eecb092390d675ff40de4e
BLAKE2b-256 checksum
How to use checksums
db155c8460e74a432aee159488d235fa2fa3fba674b821f22838e724945ed0fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.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.

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 20, 2026.

Transparency log

Release files / keyleak_detector-0.8.1-py3-none-any.whl

Download URL keyleak_detector-0.8.1-py3-none-any.whl
Size 231.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62bc181abbf0f4f229c68ea2ccf58c04c4507640948dee86ab10b2ecd49d43f0
BLAKE2b-256 checksum
How to use checksums
33c40d1a3d342855d3ab473bc82124403d35081b9b5e5fe9563f36b13285ff71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.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.

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 20, 2026.

Transparency log

Security for keyleak-detector 0.8.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for keyleak_detector-0.8.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 20, 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