# Secret History Scan (Free, Offline Git Leak Check)

> Scans a repo's working tree and full git history for leaked API keys, private keys, DB passwords and committed .env files, with redacted output.

Secret History Scan (Free, Offline Git Leak Check) is a free AI agent skill on Agensi by Colton Mcclain, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Colton Mcclain](https://www.agensi.io/creators/colton-mcclain)
- Category: [Security](https://www.agensi.io/skills/security)
- Uses: 2
- Version: 1.0
- Last updated: 2026-10-17
- Security: scan passed (2026-10-17); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/secret-history-scan-free-offline-git-leak-check
- Tags: security, devsecops, git

## About this skill

Deleting a secret from the latest commit does not remove it from history, and anyone who cloned or forked already has it. This finds secrets in both places so the user can rotate what is actually exposed.

A git repository folder. History scanning runs `git log --all -p` (read-only) over at most `--max-commits` commits (default 2000) and reports the first commit that added each distinct value. Use `--no-history` for a quick working-tree pass or for a non-git folder.

This skill bundles one standard-library Python file, `scripts/secret_history_scan.py` (sha256 `2af2cd5cecdb049e90bc30d11155dfd8476040a00d856d46cf91955ea80743ce`). If it is not already on disk:

1. Write the bundled script text verbatim to a temp file outside the user's project, e.g. `T=$(mktemp --suffix=.py)`.
2. Check `sha256sum "$T"` equals `2af2cd5cecdb049e90bc30d11155dfd8476040a00d856d46cf91955ea80743ce`. If it differs, rewrite it; never edit it.
3. Run `python3 "$T" "/path/to/repo" [--no-history] [--max-commits 2000] [--json]` with each user path as a separately quoted argument.
4. Delete the temp file. Do not save the script into the project.

## Requires

- Python
- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Secret History Scan (Free, Offline Git Leak Check) skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does Secret History Scan (Free, Offline Git Leak Check) do?

Scans a repo's working tree and full git history for leaked API keys, private keys, DB passwords and committed .env files, with redacted output.

### Which AI agents support Secret History Scan (Free, Offline Git Leak Check)?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use Secret History Scan (Free, Offline Git Leak Check)?

Connect your AI agent to Agensi through MCP, then ask it to use Secret History Scan (Free, Offline Git Leak Check) on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
