ggshield
Detect secrets from all sources using GitGuardian's brains
What it is and what it does
ggshield is a command-line security scanner that integrates with GitGuardian's threat detection API to find secrets and vulnerabilities in your codebase. It runs locally or in CI/CD pipelines and can scan files, Git repositories, Docker images, and PyPI packages. The tool sends only metadata (call time, request size, scan mode) to GitGuardian—your actual files and secrets remain local and are not stored on their servers. You authenticate once with a personal access token, then use simple commands like `ggshield secret scan path` to check directories or `ggshield secret scan repo` to scan a repository. It's designed to catch credential leaks before they reach version control, supporting integration as Git hooks (pre-commit, pre-push, pre-receive) and CI/CD workflows.
The package depends on 24 runtime libraries including click for CLI handling, cryptography and pyjwt for authentication, requests and oauthlib for API communication, and rich for terminal output formatting. It requires a non-EOL Python version (3.9 or later) and git. The tool is actively maintained, with recent releases and ongoing repository updates, making it suitable for teams implementing secrets detection as part of their development security workflow.
Use it for:
- Prevent accidental commits of API keys, database passwords, or OAuth tokens to Git repositories.
- Scan Docker images before deployment to detect embedded credentials or secrets in layers.
- Integrate into CI/CD pipelines to block builds or pull requests containing detected secrets.
- Set up pre-commit Git hooks to catch secrets locally before they reach the repository.
- Audit PyPI packages for embedded credentials or leaked secrets in dependencies.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ggshield is a CLI tool that scans files, repositories, Docker images, and PyPI packages to detect more than 500+ types of secrets and potential vulnerabilities using GitGuardian's API.
Yes. ggshield is actively maintained, has low installation friction, carries a permissive MIT license, and solves a critical security problem (preventing secrets in code). It integrates cleanly into development workflows via Git hooks or CI/CD, requires no complex setup beyond authentication, and has no known vulnerabilities. Install it if your team needs automated secrets detection.
Install
ggshield on PyPI
pip
pip install ggshielduv
uv add ggshieldpoetry
poetry add ggshieldInstalling ggshield
Before you install
Low friction installation with a pure Python wheel and 24 runtime dependencies. Active maintenance with a recent release 17 days ago and ongoing repository activity. Supports current Python versions (3.9–3.13) and follows the Python release cycle.
License in practice
MIT license (permissive) means you can use, modify, and distribute ggshield freely in commercial and private projects with minimal restrictions, provided you include the license notice.
Quickstart
pipx install ggshield
ggshield auth login
ggshield secret scan path -r .
Requires a supported (non-EOL) version of Python and git. Authentication via GitGuardian API key (GITGUARDIAN_API_KEY environment variable or interactive login) is required before scanning.
Verify before relying
- Whether the '500+ types of secrets' detection claim is current and what categories are covered.
- Performance characteristics and scan time for large repositories or Docker images.
- Whether pre-commit hook integration is automatic or requires manual configuration.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 24 — charset-normalizer, click, configupdater, cryptography, filelock, keyring, marshmallow-dataclass, marshmallow, notify-py, oauthlib, packaging, platformdirs, pygitguardian, pyjwt, python-dotenv, pyyaml, requests, rich, sigstore, tomli, truststore, typing-extensions, unearth, urllib3 |
| Maintenance | actively maintained — 17 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 513,108/month — #6,253 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ggshield-1.53.0-py3-none-any.whl
Keywords: cli, devsecops, gitguardian, secrets-detection, security-tools
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
pygitguardianAPI client library for GitGuardian's secret…
permissive · top 15,000 on PyPI
cycodeCycode is a command-line security scanner that…
permissive · top 15,000 on PyPI
kingfisher-binKingfisher is a command-line secret scanner…
permissive · top 15,000 on PyPI
truffleHogScans Git repositories and other sources for…
unclear · top 15,000 on PyPI
trufflehog3Scans Git repositories and source code for…
unclear · top 15,000 on PyPI
bc-detect-secretsDetects secrets (API keys, tokens, credentials)…
permissive · top 5,000 on PyPI
detect-secretsDetects secrets (API keys, tokens, credentials)…
permissive · top 5,000 on PyPI
semgrepSemgrep is a static analysis tool that searches…
copyleft · top 1,000 on PyPI
detect-installerDetects which package manager installed a given…
permissive · top 5,000 on PyPI
prowlerProwler automates security and compliance…
permissive · top 15,000 on PyPI