secrets-scan

Detect hardcoded secrets in source code and configuration files.

141|14|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/OWASP/secure-agent-playbook --skill secrets-scan-owasp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: secrets-scan
Source: https://github.com/OWASP/secure-agent-playbook/tree/main/skills/secrets-scan
Command: npx skills add https://github.com/OWASP/secure-agent-playbook --skill secrets-scan-owasp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Detect hardcoded secrets, API keys, tokens, and credentials in source code and configuration files to prevent accidental exposure during development and deployment.

Core Features & Use Cases

  • Automated Secret Scanning: Use scanners such as trufflehog, gitleaks, and detect-secrets to identify potential secrets in codebases.
  • Manual Pattern Analysis: Inspect files for high-risk patterns (keys, tokens, credentials) and assess blast radius.
  • Preventive Controls Verification: Ensure .gitignore, pre-commit hooks, and secret-management processes are in place.

Quick Start

Run a secret-detection workflow across the repository using scanners like trufflehog and gitleaks, with redacted findings.

Frequently Asked Questions about secrets-scan

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

FAQPage Schema
How do I scan my source code for hardcoded secrets and API keys?

Scanning source code for hardcoded secrets uses automated tools like trufflehog, gitleaks, and detect-secrets alongside manual pattern analysis to identify exposed credentials in repositories and configuration files. This workflow outputs redacted findings to prevent further leakage during code reviews.

When do I need to run secret detection during the development lifecycle?

Secret detection is needed during code reviews, repository audits, and CI pipelines to catch leaked credentials before deployment. Running these scans at pre-commit and CI stages ensures that hardcoded tokens are identified and preventive controls are verified before code reaches production environments.

Does gitleaks work for scanning configuration files across multiple languages?

Gitleaks works for scanning configuration files and source code across multiple languages and environments. It identifies high-risk patterns like keys and tokens, allowing you to assess the blast radius of exposed credentials and verify that appropriate .gitignore and pre-commit hook controls are in place.

What's the best way to verify preventive controls after detecting leaked credentials?

The best way to verify preventive controls after detecting leaked credentials is to check for properly configured .gitignore files, active pre-commit hooks, and established secret-management processes. This ensures that automated scanners like detect-secrets catch future leaks before they enter the repository history.

Why should I redact secret scanning findings in my repository audit?

Redacting secret scanning findings in a repository audit prevents re-exposing sensitive credentials in generated reports and logs. By redacting the identified keys, tokens, and API credentials, you safely document the blast radius and verify preventive controls without circulating the leaked secrets.

Can I use trufflehog and detect-secrets together in a CI pipeline?

You can use trufflehog and detect-secrets together in a CI pipeline to improve hardcoded secret detection coverage. Combining multiple scanners with manual pattern analysis helps catch diverse credential formats across multiple languages, ensuring comprehensive repository security before deployment.