igbuend/grimbard/hardcoded-secrets-anti-pattern
Claude Code and agent skill by igbuend/grimbard
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Security anti-pattern for hardcoded credentials and secrets (CWE-798). Use when generating or reviewing code that handles API keys, passwords, database credentials, encryption keys, or any sensitive configuration. Detects embedded secrets and recommends environment variables or secret managers.
Install
npx vskill@latest install igbuend/grimbard/hardcoded-secrets-anti-patternSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Hardcoded Secrets Anti-Pattern
Severity: Critical
Summary
Hardcoded secrets embed sensitive credentials (API keys, passwords, database credentials) directly in source code. Anyone with code access—developers, version control history, or attackers—can extract these secrets. AI models frequently generate hardcoded secrets, trained on public code with this common bad practice. Secrets committed to public repositories are discovered and exploited by automated bots within minutes.
The Anti-Pattern
Never store secrets, credentials, or sensitive configuration values in files tracked by version control.
BAD Code Example
GOOD Code Example
Language-Specific Examples
JavaScript/Node.js:
Java/Spring Boot:
C# (ASP.NET Core):
Detection
- Use secret scanning tools: Scan repository history automatically:
gitleaks detect --source . --verbosetrufflehog git file://. --only-verifiedgit-secrets --scan(pre-commit hook integration)- Search for keywords: Grep for common patterns:
rg -i '(password|secret|api_?key|token|credential)\s*=\s*["\']'rg 'sk-[a-zA-Z0-9]{32,}'(OpenAI API keys)- Detect high-entropy strings: Identify random 32+ character strings:
trufflehog --entropy=Truedetect-secrets scan --baseline .secrets.baseline- Check configuration files: Audit committed configs:
git log --all --full-history -- "*.env" "config.json" "settings.py"- Review files that should be in .gitignore
Prevention
- [ ] Never hardcode any credentials, API keys, or secrets in your source code.
- [ ] Use environment variables to store secrets in development and other non-production environments.
- [ ] Use a dedicated secrets management service for production environments (e.g., AWS Secrets Manager, HashiCorp Vault, Google Secret Manager).
- [ ] Add a `.env` file (or similar) to your
.gitignoreto prevent accidental commits of local development secrets. - [ ] Integrate secret scanning tools into your CI/CD pipeline and pre-commit hooks to block commits that contain secrets.
- [ ] Implement a secret rotation policy to limit the impact of a compromised secret.
Related Security Patterns & Anti-Patterns
- Weak Encryption Anti-Pattern: Secrets, even when stored, need to be encrypted at rest.
- JWT Misuse Anti-Pattern: The secret key for signing JWTs is a common hardcoded secret.
- Verbose Error Messages Anti-Pattern: Debug screens can leak environment variables, which may contain secrets.
References
- OWASP Top 10 A07:2025 - Authentication Failures
- OWASP GenAI LLM02:2025 - Sensitive Information Disclosure
- OWASP API Security API2:2023 - Broken Authentication
- OWASP Secrets Management Cheat Sheet
- CWE-798: Use of Hard-coded Credentials
- CAPEC-191: Read Sensitive Constants Within an Executable
- PortSwigger: Information Disclosure
- Source: sec-context
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/hardcoded-secrets-anti-pattern/SKILL.md
Popularity
- Repository stars
- 4
- Repository forks
- 1
- 7-day trend score
- 8
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 13 Apr 2026, 7 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/igbuend/grimbard/hardcoded-secrets-anti-pattern)