sanitize-git-repo

Detect and replace sensitive information in git repositories and history.

134|21|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/letta-ai/skills --skill sanitize-git-repo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sanitize-git-repo
Source: https://github.com/letta-ai/skills/tree/main/ai/benchmarks/letta/terminal-bench-2/trajectory-only/sanitize-git-repo
Command: npx skills add https://github.com/letta-ai/skills --skill sanitize-git-repo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a disciplined approach to detecting and sanitizing credentials, API keys, and tokens from both working trees and, critically, git history.

Core Features & Use Cases

  • Secret detection: Pattern-based and file-based scanning to identify secrets.
  • Working directory sanitization: Replace sensitive values with safe placeholders while preserving file validity.
  • Git history sanitization: Thorough cleanup using tools like BFG or git-filter-repo to purge secrets from history.

Quick Start

Example: scan a repository for AWS keys and replace them with placeholders, then purge the history to remove traces.

Frequently Asked Questions about sanitize-git-repo

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

FAQPage Schema
How do I remove secrets and credentials from my git repository history?

Secret removal from git history requires scanning for sensitive patterns, replacing values with placeholders in your working tree, then purging traces using specialized tools like BFG or git-filter-repo to eliminate secrets across all commits and branches.

What's the best way to detect API keys and tokens before sharing a repository?

Pattern-based and file-based scanning identifies API keys, tokens, and credentials across your codebase. Once detected, replace sensitive values with safe placeholders to preserve file validity while removing exposure risk.

Can I sanitize git history without rewriting all my commits?

Git history sanitization requires rewriting affected commits to remove secrets completely. Tools like BFG and git-filter-repo handle this systematically, but you must force-push changes and coordinate with collaborators afterward.

Why should I clean secrets from git history, not just the working directory?

Secrets left in git history remain accessible through commit logs even after deletion from current files. Comprehensive history cleanup ensures credentials cannot be recovered by cloning older commits or reviewing the repository timeline.

What should I verify after removing secrets from my repository?

Post-replacement verification confirms placeholders are valid for your file types, functionality remains intact, and sensitive patterns no longer appear in scans across the entire history and working tree.