secret-scanner

Detect exposed secrets and block commits containing sensitive credentials.

763|165|Updated Sep 16, 2025
One-click install
npx skills add https://github.com/alirezarezvani/claude-code-tresor --skill secret-scanner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: secret-scanner
Source: https://github.com/alirezarezvani/claude-code-tresor/tree/main/skills/security/secret-scanner
Command: npx skills add https://github.com/alirezarezvani/claude-code-tresor --skill secret-scanner

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automatically detects and prevents accidental exposure of sensitive information like API keys, database credentials, and private tokens in your codebase. It provides real-time alerts and can even block commits, safeguarding your project from critical security breaches.

Core Features & Use Cases

  • Real-time Detection: Scans for a wide range of secrets (AWS keys, Stripe keys, passwords, JWTs) as you code or before commits.
  • Pre-Commit Protection: Integrates with Git to block commits that contain exposed secrets, ensuring they never reach your repository.
  • Use Case: You accidentally hardcode const stripeKey = 'sk_live_1234567890abcdef';. The skill immediately alerts you to the critical exposure, suggesting you move it to an environment variable and add .env to .gitignore.

Quick Start

The skill activates automatically on file saves or before commits.

Write some code that might contain a secret:

const myApiKey = 'your_hardcoded_api_key_here';

The skill will instantly alert you if a secret pattern is detected.

Frequently Asked Questions about secret-scanner

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

FAQPage Schema
How do I prevent API keys and credentials from being committed to my repository?

Secret-scanner detects and blocks commits containing exposed API keys, database credentials, and tokens before they reach your repository. It integrates with Git pre-commit hooks to catch hardcoded secrets like AWS keys, Stripe tokens, and JWTs in real time, alerting you to move sensitive data to environment variables.

What types of secrets does a pre-commit security scanner detect?

Secret detection tools identify patterns matching AWS access keys, private keys, database credentials, API tokens, JWTs, and other common secret formats across source files and configuration files. Detection applies automatically during file saves and before commits to cover development workflows.

Can I use secret scanning with my existing Git workflow?

Yes, secret-scanner integrates directly into Git as a pre-commit hook, blocking commits containing secrets without disrupting your development process. It works across repositories and applies automatically when you save files or attempt to commit.

How do I fix a hardcoded secret that's been detected?

When secret-scanner flags exposed credentials, it suggests moving them to environment variables and adding sensitive files like `.env` to `.gitignore`. This prevents re-exposure and follows secret-management best practices.

Does secret scanning catch all types of sensitive information?

Secret-scanner uses pattern-based detection to identify common secret formats including API keys, private keys, tokens, and passwords. While it covers standard patterns, some custom or obfuscated credentials may require additional review or custom pattern rules.