secret-guard

Detect API keys, tokens, and private keys in git staged changes.

17|45|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/XSpoonAi/spoon-awesome-skill --skill secret-guard-xspoonai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: secret-guard
Source: https://github.com/XSpoonAi/spoon-awesome-skill/tree/main/enterprise-skills/code-review/secret_guard
Command: npx skills add https://github.com/XSpoonAi/spoon-awesome-skill --skill secret-guard-xspoonai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Secret Guard prevents accidental leakage of credentials by scanning git staged changes for API keys, tokens, and private keys before they are committed.

Core Features & Use Cases

  • Pre-commit safety: scans only staged files to keep checks fast and relevant.
  • Zero dependencies: pure Python script with no external libraries.
  • Multi-pattern detection: detects common secret patterns like API keys, tokens, and private keys.

Quick Start

Place this skill under your agent's skill directory and run the provided scan script to verify staged changes.

Frequently Asked Questions about secret-guard

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

FAQPage Schema
How do I prevent accidental secret leaks in git staged changes before commit?

To prevent secret leaks before commit, you can use a pre-commit hook to scan staged changes. This approach inspects added lines for API keys, tokens, and private keys using regex patterns, blocking the commit if secrets are detected.

Can I detect API keys and tokens in pre-commit workflows without external dependencies?

Yes, you can detect API keys and tokens without external dependencies by using a pure Python script. It leverages built-in regex patterns to inspect git staged files, requiring no external libraries to identify and block credentials.

What is the best way to scan only staged files for private keys during code review?

The best way to scan staged files for private keys is applying a pre-commit check that targets only added lines. This keeps the code review process fast and relevant by preventing credentials from being committed without scanning the entire repository.

How does pre-commit secret detection work with git staged changes?

Pre-commit secret detection works by inspecting git staged changes via git commands. It applies Python regex patterns to added lines to identify formatted API keys, tokens, and private keys, blocking the commit when a match is found.

Do I need to install external libraries to block API keys in my pre-commit hook?

No, you do not need external libraries to block API keys in a pre-commit hook. The scan runs as a zero-dependency pure Python script, using standard regex pattern matching to detect tokens and block commits.