ggshield
$ ggshield Official Med Riskggshield (ggshield) detects hardcoded API keys, tokens, credentials, and IaC misconfigurations across directories, git commits, and pre-commit hooks using GitGuardian's detection engine. Provides --json, --exit-zero, and GITGUARDIAN_API_KEY support for automated CI and agent workflows.
brew install ggshield ggshield walks local git history and staged diffs directly in the workspace and returns compact --json findings.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Consistent --json output, --exit-zero, --yes, and headless GITGUARDIAN_API_KEY execution across secret and IaC scans.
- Native
--jsonoutput onsecret scanandiac scan - Non-interactive via
GITGUARDIAN_API_KEY
Read-only locally and masks secrets by default unless --show-secrets is passed, though scanned file chunks are sent to GitGuardian's API.
- Default secret redaction in output (
--show-secretsis opt-in) - Transmits scanned snippets to GitGuardian cloud/self-hosted API
Available via brew, pip, uvx, Docker, and standalone binaries across macOS, Linux, and Windows.
- Broad package availability across platforms
High-precision secret detection (500+ detectors) plus IaC and honeytoken checks in one CLI.
- Low false-positive rate with GitGuardian detectors
First-party GitGuardian CLI (GitGuardian/ggshield) under MIT license.
- Official
GitGuardian/ggshieldrepository
Extensive official docs at docs.gitguardian.com and crisp Click --help output.
- Well-structured docs and CI examples
Security, Auth & Guardrails
Reads GITGUARDIAN_API_KEY from environment or saved auth config (~/.config/ggshield/auth_config.yaml).
MIT open-source CLI; requires a GitGuardian API key (free tier available for individuals and small teams).
# ggshield Agent Rules - Export `GITGUARDIAN_API_KEY` in CI/agent environments so `ggshield` does not attempt `auth login` browser OAuth. - Always pass `--json` (and avoid `--show-secrets` so raw credentials do not enter agent logs).
Agent-Ready Command Recipes
Safe Read-Only Queries
ggshield secret scan path -r --json .
Recursively scans . (-r) for hardcoded credentials and outputs structured --json findings.
ggshield secret scan pre-commit --json
Audits staged diffs in git with --json output and exits non-zero when secrets are detected.
Strengths for Agents
- + Masks leaked secrets by default unless
--show-secretsis explicitly enabled. - + Structured
--jsonacrosspath,repo,pre-commit, andiacscans.
Caveats & Pitfalls
- ! Requires
GITGUARDIAN_API_KEYand outbound HTTPS access to GitGuardian's API (cannot run fully air-gapped without self-hosted GitGuardian).