Secret Guard: Catch Leaked Keys Before You Commit

    1

    Audit staged git changes for API keys and credentials with masked previews and remediation steps.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Secret Guard: Catch Leaked Keys Before You Commit

    Example session with this skill installed

    I just staged some changes for the new auth module. Can you check if I accidentally included any API keys or tokens before I commit?

    • Read your context and instructions
    • Compiled the secret guard

    I have scanned your staged changes using git diff --cached. I found one sensitive item that needs to be addressed before you proceed with the commit.

    Secrets Audit Results

    FileLineTypeMasked PreviewAction Required
    src/config/auth.ts12AWS Access KeyAKIA****************Unstage and move to .env

    The scan also checked package.json and src/index.ts, which are clean.

    Next steps

    1. Unstage the file: Run git restore --staged src/config/auth.ts.
    2. Secure the key: Move the value to your local .env file and ensure .env is listed in your .gitignore.

    Rotate if necessary: If this key was ever pushed to a remote branch in a previous commit, it is compromised and must be rotated in the AWS console.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Staging credentials in git by mistake leads to compromised infrastructure and hours of rotation work. This skill acts as a pre-commit audit tool to identify sensitive strings before they hit your history.

    What it does

    • Staged scanning identifies API keys, tokens, and private keys in your current git diff --cached.
    • Secret masking displays identified leaks with only the first four characters visible to prevent further exposure.
    • Context filtering ignores common placeholders, documentation examples, and test fixtures.
    • Remediation guidance provides exact commands to unstage files and move secrets to environment variables.
    • Exposure alerts warns users to rotate credentials if they have been previously committed or pushed.

    How it works

    1. Use the guard command to trigger the scripts/guard.py scan on staged files.
    2. Review the list of hits which includes the file name, line number, and secret type.
    3. Follow the generated instructions to unstage the sensitive files.
    4. Update your .gitignore or move values to a secrets manager as directed.

    Frameworks & tools

    This skill utilizes Git for diff analysis and Python for the scanning logic. It is designed to work with standard .env files, cloud provider credentials, and common API token formats.

    Why this beats prompting it yourself

    Generic prompts often fail to distinguish between a real secret and a documentation placeholder, leading to false positives. This skill follows a strict verification logic and ensures that the agent never inadvertently displays the full secret in the chat logs.

    Use cases

    • Auditing a PR before pushing to a public repository.
    • Cleaning up accidentally staged .env files.
    • Verifying that local configuration changes haven't leaked cloud provider keys.
    • Teaching junior developers proper secrets hygiene during the commit process.

    Known limitations

    This only checks staged changes, not the entire repository history or unstaged files. It relies on git diff --cached and requires the repository to be initialized with git.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.

    Only scans staged changes, not full git history or unstaged files. Requires git to be initialized in the workspace.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed today

    • Free with an Agensi account

    Software
    Git

    Permissions

    Terminal / Shell
    Write Files
    Listedtoday

    What's inside

    Frequently Asked Questions

    Secret Guard scans your `git diff --cached` for sensitive data like API keys and private tokens, providing masked previews and specific remediation steps to prevent credentials from ever entering your repository history.

    The skill is designed for any AI agent or terminal environment with access to a Git repository and a Python interpreter, making it ideal for integration into local dev workflows or CI/CD pipelines.

    Yes, Secret Guard is built with context filtering to distinguish between active secrets and common placeholders, test fixtures, or documentation examples to minimize false positives.

    You will receive the `guard` command suite, the core scanning engine, and a set of remediation templates that guide users through unstaging files and securing credentials properly.

    Unlike general prompts, this skill uses specialized logic to mask identified secrets (only showing the first four characters) to ensure that the sensitive data itself is never fully exposed in your AI chat logs.

    Currently, Secret Guard focuses specifically on staged changes (`git diff --cached`) to catch errors before they are committed; it does not scan your entire historical commit log or unstaged files.

    New in Security

    Free