hardcoded-secrets-anti-pattern

Detect hardcoded credentials and API keys in source code.

8|1|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/igbuend/grimbard --skill hardcoded-secrets-anti-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hardcoded-secrets-anti-pattern
Source: https://github.com/igbuend/grimbard/tree/main/skills/hardcoded-secrets-anti-pattern
Command: npx skills add https://github.com/igbuend/grimbard --skill hardcoded-secrets-anti-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the critical security vulnerability of hardcoding sensitive credentials like API keys, passwords, and database connection strings directly into source code, which can lead to severe data breaches.

Core Features & Use Cases

  • Detects Hardcoded Secrets: Identifies embedded sensitive information in code across various languages.
  • Provides Secure Alternatives: Offers best practices and code examples for using environment variables and secret management systems.
  • Use Case: When reviewing code or generating new code, use this Skill to ensure no secrets are accidentally embedded, preventing immediate exposure and future compromise.

Quick Start

Review this code snippet for any hardcoded secrets.

Frequently Asked Questions about hardcoded-secrets-anti-pattern

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

FAQPage Schema
How do I detect hardcoded secrets and API keys in source code?

To detect hardcoded secrets in source code, analyze code snippets for embedded sensitive credentials like API keys and passwords. This process identifies CWE-798 vulnerabilities and helps prevent data breaches by flagging exposed credentials.

What are secure alternatives to hardcoding credentials in source code?

Secure alternatives to hardcoding credentials include using environment variables or dedicated secret management systems. These methods keep sensitive data out of source code while remaining accessible across all programming languages and development workflows.

Does hardcoded secrets detection work across all programming languages?

Hardcoded secrets detection works across all programming languages and development workflows. It identifies embedded sensitive information universally, ensuring that no API keys or passwords are accidentally exposed regardless of the language used.

How do I review code snippets for hardcoded credentials?

Review code snippets for hardcoded credentials by submitting the source code for analysis. The system detects embedded sensitive information like database connection strings and provides guidance on secure credential management practices to prevent compromise.

Why does hardcoding sensitive credentials cause security vulnerabilities?

Hardcoding sensitive credentials causes security vulnerabilities because it exposes API keys and passwords directly in source code, leading to severe data breaches. This anti-pattern creates immediate exposure and risks future compromise if the code is shared.

What is CWE-798 and how do I prevent it in my code?

CWE-798 is the use of hard-coded credentials, a critical security vulnerability where sensitive information is embedded in source code. Prevent it by enforcing secure credential management practices using environment variables and secret managers.