GitGuardian Explained: Secrets Detection, ggshield, Honeytokens and How to Run the Incident Workflow
How GitGuardian finds leaked secrets in repositories and public GitHub, how the ggshield CLI blocks them in pre-commit hooks, CI and AI coding assistants, how validity checks prioritise incidents, and what honeytokens add.
- MADE BY
- GitGuardian
- TYPE
- Commercial platform
- CATEGORIES
- Secrets
- ALSO KNOWN AS
- ggshield (open-source CLI)
- FACTS CHECKED
- 13 November 2026 against the official documentation
Leaked credentials are one of the most common starting points for cloud breaches, and they leak in boring ways: a test file, a .env committed by mistake, a CI log, a public fork. GitGuardian is a platform built around finding those secrets, getting them revoked, and stopping the next one before it is committed.
What it is
GitGuardian has three main parts:
- Internal Monitoring connects to your version control systems and other sources, scans history and new commits, and turns each leaked secret into an incident with an owner and a status.
- Public Monitoring watches public GitHub for secrets linked to your organisation's developers, which is where personal side projects and forks leak company keys.
- ggshield, the open-source (MIT) command-line tool, scans files, repositories, Docker images and packages, and runs as a pre-commit or pre-push hook, in CI and on the server as a pre-receive hook.
It also offers honeytokens (decoy credentials) and NHI Governance, which inventories non-human identities across secrets managers such as HashiCorp Vault, AWS Secrets Manager and Azure Key Vault. GitGuardian is independent and raised a Series C in February 2026.
How it works
Detected
commit, history, public fork
Validity check
is it still live?
Assigned
to the developer or owner
Revoked
rotate at the issuer
Resolved
reopens if seen again
Detection combines provider-specific detectors, which recognise a token's exact format, with generic detectors for passwords and connection strings. Validity checks test a detected secret against its provider where that is possible, so a live production key rises above an expired test token. An incident is closed as Resolved when the secret has been revoked, or Ignored when it is a false positive, a test credential or an accepted low risk; a resolved secret that appears again reopens the incident.
ggshield does its pattern matching through the GitGuardian API, which is why it needs an API key: developers usually sign in with ggshield auth login, and CI uses a service account key in GITGUARDIAN_API_KEY.
How to use it
Day one: connect sources and scan history
Connect your VCS to Internal Monitoring and let the historical scan run. Expect a large first batch: years of history usually contain hundreds of secrets, most of them dead. Use validity, where the secret was found (a public repository is worse) and the secret type to sort them.
Week one: work the incidents and add prevention
- Revoke live secrets first, then close incidents as Resolved. Rotation is the fix; history rewriting is optional.
- Install the hook for developers:
ggshield auth login
ggshield install --mode global # pre-commit hook for every repository
ggshield secret scan repo . # scan an existing repository's history
- Add a CI step so commits from machines without the hook are still checked, and consider a pre-receive hook on self-hosted Git servers, minding GitHub Enterprise Server's short time limit for pre-receive hooks.
- Record false positives with
ggshield secret ignore --last-found, which writes to.gitguardian.yaml, or ignore them in the dashboard, which ggshield also honours.
Every day: cover new places secrets leak
AI coding assistants now write files and run commands on developers' machines. Since 2026, ggshield machine setup installs hooks for tools including Cursor, Claude Code, Codex and Copilot CLI, so a secret is caught before an assistant writes or sends it. Plant honeytokens in places an intruder would search, such as CI variables, internal wikis or a developer laptop's credentials file, and route their alerts to incident response, not the secrets queue: a triggered honeytoken means someone is already inside.
Where it stops
- Scanning needs the API. Content leaves the machine for detection unless you run a self-hosted instance.
- Generic secrets are harder. A random password with no recognisable format may be missed or misclassified; validity checks only work for providers that offer a way to test.
- Hooks can be skipped. A developer can bypass a local hook, so server-side and CI scanning still matter.
- Finding is not fixing. The tool cannot rotate a key in a system it does not control; the owner must.
How it comes up in interviews
- "You find 600 secrets in git history. What do you do first?" Validity, exposure (public versus private), privilege of the secret, and revoke before clean-up.
- "A developer says they deleted the commit, so the key is safe." Explain forks, clones, caches and why only revocation ends the risk.
- "Where would you put honeytokens, and who gets the alert?" Show that you understand deception as detection.
Sources
Checked on 13 November 2026: GitGuardian documentation for ggshield getting started, pre-commit and pre-receive integrations, ggshield secret ignore, the AI hook (ggshield secret scan ai-hook and ggshield machine setup), validity checks, incident statuses, honeytokens and NHI Governance integrations; ggshield GitHub repository README; GitGuardian Series C announcement (11 February 2026).
Interview questions and lessons on the problems this tool is used for:
Compare with
FAQ
ggshield runs locally but sends the content it scans to the GitGuardian API for detection, so it needs an API key and network access. Self-hosted GitGuardian instances are supported for organisations that cannot use the SaaS.
An independent explainer for interview preparation. AISecurityInterviews is not affiliated with or endorsed by GitGuardian, and product names are trademarks of their owners. Products change quickly; check the vendor's documentation before you rely on a detail. All security tools