Back to Featured Skills

secret-guard

0xBrick-Li
0xBrick-Li
Enterprise-skills

A security automation skill that scans git staged files for accidental secret leakage (AWS, OpenAI, GitHub tokens) before committing code. It acts as an intelligent pre-commit check within the agent workflow.


Install Command

npx skills add https://github.com/XSpoonAi/spoon-awesome-skill/tree/master/enterprise-skills/code-review/secret_guard

Content

3 files
Skill.md
2.1 KB
enterprise-skills
code-review
secret_guard
SKILL.md
scripts
scan.py

Skill.md

/ Read Only

Secret Guard Skill

Secret Guard is a lightweight security automation skill designed to prevent accidental leakage of sensitive credentials. It scans the git staged area for potential secrets (API keys, private keys, tokens) before they are committed to the codebase.

Features

  • šŸ›”ļø Pre-commit Safety: Scans only staged files (git diff --cached), ensuring speed and relevance.
  • šŸ”’ Zero Dependencies: Written in pure Python (Standard Library only), no pip install required.
  • šŸ‘ļø Privacy Focused: Detected secrets are masked (e.g., sk-123***) in the output to prevent secondary leakage in logs.
  • šŸ“¦ Multi-Pattern Support: Detects AWS Keys, OpenAI Keys, GitHub Tokens, and Generic Private Keys.

Quick Start

Installation

Copy the secret-guard folder into your agent's skill directory (e.g., .claude/skills/).

Usage

This skill is triggered naturally when you ask the agent to check code or prepare for a commit.

Example Prompts:

  • "Check my staged files for security issues."
  • "I'm ready to commit, can you scan for secrets?"
  • "Run secret-guard."

Configuration

No environment variables are required. The script relies on the system having git installed and initialized in the current directory.

VariableRequiredDescription
N/ANoThis skill works out-of-the-box.

Error Handling

  • Exit Code 0: No secrets found. The agent will proceed.
  • Exit Code 1: Potential secrets found. The agent will alert the user and block the recommendation to commit until resolved.
  • Git Missing: If git is not installed, the tool will return a friendly error message.

Supported Patterns

Currently detects the following patterns via Regex:

  • AWS Access Key ID
  • AWS Secret Key
  • OpenAI API Key
  • GitHub Personal Access Token
  • Standard Private Key Headers (RSA/DSA/EC)
  • Generic "api_key" / "secret_token" assignments

Directory Structure

secret-guard/ ā”œā”€ā”€ SKILL.md # Skill definition and metadata ā”œā”€ā”€ README.md # Documentation └── scripts/ └── scan.py # Core scanning logic (Pure Python)

Installations

338

Skills Information

Created
2026-02-04
Last Updated
2026-03-18