aicoolies logo
Gitleaks logo
Gitleaks logo

Gitleaks

Open-source secret detection for Git repositories

open sourceupdated Aug 16, 2026

Gitleaks is an open-source secret scanner with 27K+ GitHub stars that detects hardcoded passwords, API keys, tokens, and private keys in Git repositories, files, directories, and full Git history. It integrates via GitHub Actions, pre-commit hooks, CI/CD pipelines, and single-binary local scans.

Read our Gitleaks review

A detailed review by the aicoolies team — click to read

Gitleaks scans Git repositories for hardcoded secrets using a comprehensive set of detection rules covering API keys, passwords, tokens, private keys, and other sensitive credentials across dozens of service providers. Unlike simple regex scanners, Gitleaks understands Git history and can scan every commit to find secrets that were committed and later removed but remain in the repository history where attackers can find them.

The tool integrates into development workflows at multiple points: as a pre-commit hook that prevents secrets from being committed locally, as a CI/CD pipeline step that blocks merges containing credentials, or as a scheduled scan that audits existing repositories. Configuration via a TOML file allows teams to define custom rules, allowlists for false positives, and path exclusions for generated files.

With over 16,000 GitHub stars, Gitleaks is one of the most widely adopted secret detection tools in the developer security ecosystem. It is frequently paired with AI-driven triage tools to prioritize findings by risk level. The tool is completely free and open-source, written in Go for cross-platform performance, and regularly updated with new detection patterns for emerging cloud services and API providers.

Pricing

Free and open-source (MIT License)

Platforms

Git, GitHub Actions, GitLab CI, any CI/CD

Categories

Tags

Use Cases

Related Tools

computed discovery: shared active categories · kept separate from editor-verified Alternatives

ToolHive mascot logo

ToolHive

Run and govern MCP servers across desktop, CLI and Kubernetes

Open-source MCP runtime and governance platform that runs servers in isolated containers, curates registries, enforces access policies, and operates gateways across desktop, CLI, and Kubernetes.

Open Source
Anamorpher parent Trail of Bits mark

Anamorpher

Craft image-scaling prompt-injection payloads to red-team multimodal AI systems

Open-source red-team toolkit from Trail of Bits that generates image-scaling attack payloads — images that look benign at full resolution but reveal a hidden prompt injection after a multimodal system downsamples them.

freeOpen Source
cai

CAI (Cybersecurity AI)

AI agent framework for offensive security and penetration testing

Alias Robotics' agent framework for building AI-driven offensive-security workflows — reconnaissance, exploitation, privilege escalation, and lateral movement — with multi-agent handoffs and human-in-the-loop control. Source-available, but the core is licensed for non-commercial research use only.

freemiumTelemetry
MEDUSA logo

MEDUSA

AI-first security scanner for LLM, agent, MCP, and RAG codebases

MEDUSA is an AGPL-3.0 AI-first security scanner from Pantheon Security that checks AI and machine-learning applications, LLM agents, MCP workflows, RAG pipelines, repository-poisoning risks, secrets, and agent-specific compromise patterns.

Open Source
iFixAi logo

iFixAi

Open-source diagnostic for AI operational misalignment

iFixAi is an Apache-2.0 diagnostic tool for scoring AI agents and models against operational-misalignment risks such as hallucination, manipulation, sabotage, sandbagging, and oversight evasion.

Open Source
Inspect AI parent UK AISI mark

Inspect AI

UK AI Security Institute framework for LLM safety evaluations

Inspect AI is an MIT-licensed framework from the UK AI Security Institute for running large language model evaluations, including tool use, multi-turn dialogue, model-graded scoring, and reusable evaluation tasks.

Open Source

Used in Stacks

Comparisons

Gitleaks vs TruffleHog vs Snyk — Secret Detection Comparison

Secret detection tools prevent hardcoded credentials from reaching production, with leaked secrets remaining a top breach vector. Gitleaks is the most adopted open-source secret scanner with over 25,000 GitHub stars, focused on speed as a pre-commit hook and CI tool. TruffleHog scans beyond git repos into Slack, S3, and Docker images while verifying if leaked credentials are still active. Snyk includes secret detection as part of its broader developer security platform.

FAQ

What is Gitleaks?

Gitleaks is an open-source secret scanner with 27K+ GitHub stars that detects hardcoded passwords, API keys, tokens, and private keys in Git repositories, files, directories, and full Git history. It integrates via GitHub Actions, pre-commit hooks, CI/CD pipelines, and single-binary local scans.

Is Gitleaks free?

Yes — Gitleaks is open source and free to use. Free and open-source (MIT License)

Is Gitleaks open source?

Yes — Gitleaks is open source.

What are the best Gitleaks alternatives?

The top editor-verified Gitleaks alternatives are TruffleHog, Snyk, Semgrep.

How does Gitleaks score in our review?

Our hands-on review scores Gitleaks 84/100 overall, based on speed, privacy, and developer-experience testing.