TokenGuard

A zero-dependency pre-commit scanner for detecting API keys and credentials in staged Git changes.

Package:PyPI: tokenguard-cliRuntime:Python >= 3.10Dependencies:0 (Stdlib)Standard:SARIF v2.1.0License:MIT
RUN LOCALLY
pip install tokenguard-cli && tokenguard --help

Developers need a fast local gate that catches tokens, private keys and high-entropy strings before commit — without sending code anywhere.

TokenGuard scans staged changes with pattern rules plus Shannon entropy analysis, and lets teams suppress accepted test credentials through an explicit baseline file.

Pure Python standard library, zero external dependencies; results are emitted as OASIS SARIF v2.1.0 for GitHub Code Scanning integration.

Every finding carries a severity, masked value preview, entropy score and a concrete remediation action — no vague warnings. Available on PyPI as tokenguard-cli. It scans staged changes, masks detected values in reports and supports pre-commit hooks and SARIF output.

  • Teams that want to block API keys, tokens, and high-entropy secrets in staged changes before git push via a fast local pre-commit hook.
  • Python and CI pipelines that need OASIS SARIF v2.1.0 reports for GitHub Code Scanning without external binaries or SaaS uploads.
  • Suppressing known test fixtures via an explicit baseline file while catching real production credential leaks with zero network calls.
# Install and scan staged changes
pip install tokenguard-cli
tokenguard scan --staged

# Emit SARIF v2.1.0 report for GitHub Code Scanning
tokenguard scan --staged --format sarif > tokenguard.sarif