# Git Secret Leak Scan (Zero Plaintext)

> Find leaked credentials in git repos without printing the secrets themselves.

Git Secret Leak Scan (Zero Plaintext) is a free AI agent skill on Agensi by Drizzt Studio, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Drizzt Studio](https://www.agensi.io/creators/drizztstudio)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0
- Last updated: 2026-11-19
- Security: scan passed (2026-11-19); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/git-secret-leak-scan-zero-plaintext
- Tags: security, git, devsecops, secrets

## About this skill

A defensive audit skill for checking your own repositories before they go public, or after you suspect a leak. The bundled scanner reports file, line, category, and match length only — never the secret string. It does not make network calls. The write-up also explains optional, manual live-key checks and self-revocation against provider APIs, plus Windows/WSL2 history cleanup with git-filter-repo and a force-push. Use those steps only on accounts and keys you are authorised to operate.

## Requires

- Python 3 (standard library only)
- Git
- Optional: gh (GitHub Trees API inventory)
- Optional: WSL2 with git_filter_repo.py (Windows history rewrite)

Offline scanner: one Python script, no network calls. Everything else — GitHub Trees API inventory, SQLite row counts, live-key status checks, WSL2 history rewrite and force-push — is documented manual steps you run and authorise yourself. No history-purging script is included.

## Known limitations

Text scanning skips every binary file, including SQLite databases; those are reported by path only, so you must inspect them yourself. History cleaning on Windows requires WSL2. Remote history removal also requires manually deleting orphaned backup branches, and the default branch name must be resolved before force-pushing.

## 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 Git Secret Leak Scan (Zero Plaintext) 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

### How does this skill keep discovered secrets out of my chat logs?

The bundled scanner never prints a matched string — findings carry file, line, category and match length only, and patterns are matched at full length so a short prefix cannot leak. This guarantee covers the scanner's own output. The optional live-key checks described in the skill mean you handle the key value yourself, so treat those runs like any other command that carries a credential.

### Does the history cleanup work on Windows?

The documented route runs git-filter-repo through WSL2, because running it natively on Windows fails during fast-export (OSError: Errno 22) and git filter-branch breaks on MSYS path conversion. WSL2 is therefore required on Windows; the same single-file git_filter_repo.py can be run directly on Linux or macOS. Either way you must re-clone the repository and verify afterwards.

### Can I inventory an entire GitHub account without cloning every repository?

Yes, by hand. The skill documents gh api commands that list a repository's file tree through the GitHub Trees API, so you can spot tracked .env, *.db and *.pem files before cloning anything. It returns file paths only, never file contents, and typically takes tens of seconds for dozens of repositories. This is a documented manual step, not an automated script in the package.

### Does the tool just find strings, or can it tell me if a leaked key is still active?

The scanner only finds strings. Checking whether a key is live is a manual follow-up documented in the skill: you issue read-only requests such as GET /user/balance (DeepSeek), GET /user (GitHub) or GET /v3/user/account (SendGrid) and read only the HTTP status code — 200 means still valid, 401 means revoked.

### What is included in the Git Secret Leak Scan skill?

You receive one Python script (scripts/scan_repos_secrets.py) for local, offline secret scanning, plus a SKILL.md that documents the manual workflows: a GitHub Trees API file inventory, manual SQLite row-count checks, optional live-key verification and self-revocation, and WSL2-based history rewriting with git-filter-repo. History purging is not shipped as a script — you run the documented commands yourself.

### Can this skill detect secrets inside encrypted files or non-SQLite binaries?

No. The scanner skips any file that contains null bytes in its first 4096 bytes, so binaries and encrypted blobs are never read. SQLite databases are reported by path only — the skill documents a manual sqlite3 command you run yourself to count rows per table and judge the exposure.

---

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.
