implementing-secret-scanning-with-gitleaks

implementing-secret-scanning-with-gitleaks is a skill for Claude Code, Codex from KunanonJ/ai-skills-hub. It costs 63 tokens per session (2,900 once invoked), scanned A, original, MIT.

A guide to using Gitleaks, a tool that searches Git repositories for exposed secrets such as API keys, passwords, tokens, and private keys.

In plain words
What is it for?
Use it to add pre-commit checks, CI scans, custom detection rules, baselines for existing findings, and remediation workflows.
Why use it?
It helps prevent secrets from entering commits and finds secrets already present in a repository's history so they can be removed and rotated.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to add pre-commit checks, CI scans, custom detection rules, baselines for existing findings, and remediation workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kunanonj/ai-skills-hub/implementing-secret-scanning-with-gitleaks
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add KunanonJ/ai-skills-hub --skill implementing-secret-scanning-with-gitleaks
Clone the repo
git clone --depth 1 https://github.com/KunanonJ/ai-skills-hub

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for implementing-secret-scanning-with-gitleaks

README.md
[![agentmods](https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/implementing-secret-scanning-with-gitleaks/github.svg)](https://agentmods.dev/skills/kunanonj/ai-skills-hub/implementing-secret-scanning-with-gitleaks)
Your own site
<a href="https://agentmods.dev/skills/kunanonj/ai-skills-hub/implementing-secret-scanning-with-gitleaks"><img src="https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/implementing-secret-scanning-with-gitleaks/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for implementing-secret-scanning-with-gitleaks

Your own site · 80×15
<a href="https://agentmods.dev/skills/kunanonj/ai-skills-hub/implementing-secret-scanning-with-gitleaks"><img src="https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/implementing-secret-scanning-with-gitleaks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,900 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00063 $0.02900
Opus 5 $0.00032 $0.01450
Sonnet 5 $0.00013 $0.00580
Haiku 4.5 $0.00006 $0.00290

Measured 12d ago against content hash b4edc041a407, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

implementing-secret-scanning-with-gitleaks scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/agent.py, scripts/process.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

wget -q https://github.com/gitleaks/gitleaks/releases/download/v8.21.2/gitleaks_8.21.2_linux_x64.tar.gz
.agents/skills/implementing-secret-scanning-with-gitleaks/SKILL.md · 346 lines

How it starts

The opening of the file, as written. The whole thing — 346 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Implementing Secret Scanning with Gitleaks

When to Use

  • When developers may accidentally commit API keys, passwords, tokens, or private keys to repositories
  • When establishing pre-commit gates that prevent secrets from entering the git history
  • When scanning existing repository history for previously committed secrets that need rotation
  • When compliance requirements mandate secret detection across all source code repositories
  • When migrating from manual secret audits to automated continuous scanning

Do not use for detecting secrets in running applications or memory (use runtime secret detection), for managing secrets after detection (use Vault or AWS Secrets Manager), or for scanning container images (use Trivy or Grype).

Prerequisites

  • Gitleaks v8.18+ installed via binary, Go install, or Docker
  • Pre-commit framework installed for local hook integration
  • Git repository with history to scan
  • CI/CD platform access (GitHub Actions, GitLab CI, or equivalent)

Workflow

Step 1: Install and Run Initial Repository Scan

Perform a baseline scan of the repository to identify all existing secrets in the git history.

# Install Gitleaks
brew install gitleaks  # macOS
# or download binary from https://github.com/gitleaks/gitleaks/releases

# Scan entire git history for secrets
gitleaks detect --source . --report-format json --report-path gitleaks-report.json -v

# Scan only staged changes (for pre-commit)
gitleaks protect --staged --report-format json --report-path gitleaks-staged.json

# Scan specific commit range
gitleaks detect --source . --log-opts="HEAD~10..HEAD" --report-format json

# Scan without git history (filesystem only)
gitleaks detect --source . --no-git --report-format json

Step 2: Configure Pre-Commit Hook

Set up Gitleaks as a pre-commit hook to prevent secrets from being committed.

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/gitleaks/gitleaks
    rev: v8.21.2
    hooks:
      - id: gitleaks
        name: gitleaks
        description: Detect hardcoded secrets using Gitleaks
        entry: gitleaks protect --staged --verbose --redact
        language: golang
        pass_filenames: false

Read the full file on GitHub · 346 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 346 lines · 63 tokens per session scan A b4edc041a407

Subscribe to this mod's changes

implementing-secret-scanning-with-gitleaks is a skill published in the GitHub repository KunanonJ/ai-skills-hub (5 stars, last pushed yesterday), licensed MIT. It adds 63 tokens to every session and 2,900 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

implementing-secret-scanning-with-gitleaks

This skill covers implementing Gitleaks for detecting and preventing hardcoded secrets in git repositories. It addresses configuring pre-commit hooks, CI/CD pipeline integration, custom rule authoring for organization-specific secrets, baseline management for existing repositories, and remediation workflows for…

xalgorix/xalgorix · 63 tokens

integrating-sast-into-github-actions-pipeline

This skill covers integrating Static Application Security Testing (SAST) tools—CodeQL and Semgrep—into GitHub Actions CI/CD pipelines. It addresses configuring automated code scanning on pull requests and pushes, tuning rules to reduce false positives, uploading SARIF results to GitHub Advanced Security, and…

adriannoes/awesome-agentic-ai · 84 tokens

integrating-dast-with-owasp-zap-in-pipeline

This skill covers integrating OWASP ZAP (Zed Attack Proxy) for Dynamic Application Security Testing in CI/CD pipelines. It addresses configuring baseline, full, and API scans against running applications, interpreting ZAP findings, tuning scan policies, and establishing DAST quality gates in GitHub Actions and GitLab…

adriannoes/awesome-agentic-ai · 76 tokens

performing-sca-dependency-scanning-with-snyk

This skill covers implementing Software Composition Analysis (SCA) using Snyk to detect vulnerable open-source dependencies in CI/CD pipelines. It addresses scanning package manifests and lockfiles, automated fix pull request generation, license compliance checking, continuous monitoring of deployed applications, and…

adriannoes/awesome-agentic-ai · 77 tokens

securing-github-actions-workflows

This skill covers hardening GitHub Actions workflows against supply chain attacks, credential theft, and privilege escalation. It addresses pinning actions to SHA digests, minimizing GITHUBTOKEN permissions, protecting secrets from exfiltration, preventing script injection in workflow expressions, and implementing…

adriannoes/awesome-agentic-ai · 68 tokens

implementing-code-signing-for-artifacts

This skill covers implementing code signing for build artifacts to ensure integrity and authenticity throughout the software supply chain. It addresses signing binaries, packages, and containers using GPG, Sigstore, and platform-specific signing tools, establishing trust chains, and verifying signatures in deployment…

adriannoes/awesome-agentic-ai · 62 tokens