secrets-detection

Detect exposed secrets and credentials in git repositories with gitleaks.

44|6|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/Habitat-Thinking/ai-literacy-superpowers --skill secrets-detection-habitat-thinking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: secrets-detection
Source: https://github.com/Habitat-Thinking/ai-literacy-superpowers/tree/main/ai-literacy-superpowers/skills/secrets-detection
Command: npx skills add https://github.com/Habitat-Thinking/ai-literacy-superpowers --skill secrets-detection-habitat-thinking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Secrets such as API keys, tokens, passwords, and private keys often get accidentally committed to git and persist in history, creating immediate and long-term security risks; this Skill provides a structured audit and remediation workflow to find, baseline, and remove those secrets and to harden CI and harness controls.

Core Features & Use Cases

  • Repository scanning: Run working-tree, staged-change, and full git-history scans to surface exposed credentials.
  • Baseline & allowlist management: Create and use baselines and .gitleaks.toml rules to manage false positives without masking real secrets.
  • CI and harness enforcement: Integrate gitleaks into GitHub Actions and project HARNESS.md to deterministically fail builds and maintain ongoing checks.

Quick Start

Run gitleaks detect --source . --exit-code 1 to scan the repository history and fail on any findings so you can triage, rotate, and remove exposed secrets.

Frequently Asked Questions about secrets-detection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scan git history for exposed API keys and secrets?

To scan git history for exposed secrets, run a gitleaks detect command to audit working tree, staged changes, and past commits for API keys, tokens, and private keys. This fails the build on findings so you can triage and rotate exposed credentials.

What is secrets detection in source code repositories?

Secrets detection identifies accidentally committed API keys, tokens, passwords, and private keys in git repositories. It surfaces exposed credentials across the working tree, staged changes, and full git history to mitigate immediate and long-term security risks.

Can I integrate gitleaks into GitHub Actions CI pipelines?

Yes, you can integrate gitleaks into GitHub Actions CI pipelines to deterministically fail builds when exposed secrets are detected. This enforces ongoing scanning across repository history and prevents new credentials from being committed.

How do I manage false positives during secrets detection?

Manage false positives during secrets detection by creating baselines and customizing .gitleaks.toml rules. This allows you to configure allowlists and ignore known false positives without masking real exposed secrets in the repository.

What is the best way to prevent secrets from being committed to git?

The best way to prevent secrets from being committed to git is applying pre-commit checks and CI pipeline enforcement using gitleaks. This catches exposed credentials in staged changes and full history scans before they persist and create long-term security risks.

Why do I need to scan full git history for secrets?

You need to scan full git history for secrets because accidentally committed API keys and tokens persist in past commits, creating long-term security risks even if removed from the current working tree. Historical scans surface exposed credentials for rotation and remediation.