secrets-management
Skill6 starsChanged 8 months agoMITView on GitHub
Use when handling API keys, database credentials, tokens, certificates, or any sensitive configuration values.
- Reads credentials
26 other projects use a version of this.
Adopted by
Most recently taken up by
- nahid-sparktales/agent-dispatchertheir own version, first seen Sep 21, 2026
- sammasak/claude-code-skillstheir own version, first seen Sep 14, 2026
- socialadsmentor/sam-agentic-harnesstheir own version, first seen Sep 3, 2026
- TheHiddenDeveloper/jarvis-skillstheir own version, first seen Aug 19, 2026
- Zephyrex21/claude-skills-vettedtheir own version, first seen Aug 9, 2026
- arjunprabhulal/agent-skillstheir own version, first seen Aug 3, 2026
Used with
Projects with it also use secure-code-review, api-security and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Robotti-ioSkillsecure-code-review
Repeatable process for an application security code review that produces prioritized findings and fix guidance.
Also in 3 projects that use this
jefflesterSkillapi-security
API security best practices and common vulnerability prevention. Enforces security checks for authentication, input validation, SQL injection, XSS, and OWASP Top 10 vulnerabilities. Use when building or modifying APIs.
Also in 3 projects that use this
Svenja-devSkille2e-testing
Also in 3 projects that use this
Other versions26 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 26
- UnitOneAI/SecuritySkills★ 78same name
- nahid-sparktales/agent-dispatcher★ 59same name
- Hack23/European-Parliament-MCP-Server★ 28same name
- nimadorostkar/Claude-Skills-collection★ 28same name
- Fandry96/k3-agentic-skills★ 27same name
- acedergren/oci-agent-skills★ 21same name
- Sir-chawakorn/sanook-cli★ 9same name
- vanara-agents/skills★ 9same name
- xfstudio/skills★ 9same name
- YepAPI/skills★ 8same name
16 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository64 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-backward-compatibilitySkill
- api-design-standardsSkill
- api-versioningSkill
- database-designSkill
- distributed-systemsSkill
- observability-by-defaultSkill
- performance-budgetsSkill
- resilience-patternsSkill
- twelve-factor-appSkill
- codex-cross-reviewSkill
- dispatching-parallel-agentsSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- architecture-awarenessSkill
- intent-to-specSkill
- project-diagnosisSkill
- using-shipworthySkill
- systematic-debuggingSkill
- documentation-as-codeSkill
- accessibilitySkill
- frontend-standardsSkill
- retrospectiveSkill
- writing-skillsSkill
- ci-cd-awarenessSkill
- context-managerSkill
- environment-setupSkill
- feature-flag-disciplineSkill
- finishing-a-development-branchSkill
- guardrail-audit-logSkill
- incident-responseSkill
- mcp-integrationSkill
- migration-strategiesSkill
- production-readinessSkill
- scope-creep-detectionSkill
- session-memorySkill
- slo-sli-definitionSkill
- tech-debt-trackingSkill
- using-git-worktreesSkill
- zero-downtime-migrationsSkill
- brainstormingSkill
- decision-frameworksSkill
- design-documentsSkill
- executing-plansSkill
- writing-plansSkill
- code-complexitySkill
- confidence-based-strictnessSkill
- error-handling-patternsSkill
- feedback-driven-adaptationSkill
- quality-gatesSkill
- response-schema-validationSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- adaptive-securitySkill
- bias-detectionSkill
- compliance-awarenessSkill
- container-securitySkill
- dependency-managementSkill
- pii-detectionSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 25 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
If you find a hardcoded secret during code review, treat it as an incident: rotate the secret immediately, then fix the code.
- Very specific: line 45
Every project with a .env file must have it in .gitignore.
- Distinctive: line 64
Service account tokens: Prefer short-lived tokens (1 hour) with automatic refresh over long-lived tokens.
- Distinctive: line 74
Never copy production secrets into a development environment for debugging.
- Distinctive: line 89
If a secret was committed to git -- even briefly, even on a branch that was deleted -- it is compromised.
- Very specific: line 109
Automate renewal: Use Let's Encrypt with ACME clients (certbot, acme.sh) for TLS certificates.
- Distinctive: line 116
When creating API keys for third-party services:
- Distinctive: line 118
Request the minimum permissions needed: If you only need read access, do not request write access.
“Common” is measured: kept by at least 6 in 10 of the 25 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Secrets Management
Core Rule
A secret that touches source code, logs, or version history is a compromised secret. Treat it as such immediately.
Never Hardcode Secrets
This is absolute. No exceptions. Not in source code, not in config files checked into git, not in Dockerfiles, not in CI scripts, not in comments, not in documentation with "example" values that are actually real.
# ALL OF THESE ARE WRONG
DATABASE_URL = "postgres://admin:password123@prod-db:5432/app"
api_key = "sk-live-abc123..."
ENV SECRET_KEY=mysecretkey # in Dockerfile
echo $API_TOKEN # in CI script logsIf you find a hardcoded secret during code review, treat it as an incident: rotate the secret immediately, then fix the code.
Environment Variables with Startup Validation
Environment variables are the standard mechanism for injecting secrets at runtime. But they must be validated:
// Validate ALL required secrets at startup, fail fast if missing
const required = ['DATABASE_URL', 'JWT_SECRET', 'STRIPE_KEY'] as const;
for (const key of required) {
if (!process.env[key]) {
throw new Error(`Missing required environment variable: ${key}`);
}
}Why validate at startup? A missing secret discovered mid-request causes a confusing 500 error and a debugging session. A missing secret discovered at startup causes a clear error message and a 10-second fix.
.env Files in .gitignore
Every project with a .env file must have it in .gitignore. No exceptions.
# .gitignore — secrets
.env
.env.*
!.env.exampleProvide a .env.example file with placeholder values (not real secrets) so developers know which variables to configure. The .env.example file is committed; the .env file is not.
Secret Rotation Strategies
Secrets are not permanent. They leak, employees leave, and compliance frameworks require rotation.
- API keys: Rotate every 90 days minimum. Support dual active keys during rotation (old key works for 24 hours after new key is generated).
- Database passwords: Rotate quarterly. Use connection poolers that can reload credentials without downtime.
- JWT signing keys: Rotate annually. Support multiple active verification keys (the
kidheader in JWT selects the correct key). - TLS certificates: Automate renewal with Let's Encrypt or ACME. Set monitoring alerts for certificates expiring within 30 days.
- Service account tokens: Prefer short-lived tokens (1 hour) with automatic refresh over long-lived tokens.
Different Secrets Per Environment
Development, staging, and production must use completely different secrets. Sharing secrets across environments means a dev environment breach compromises production.
- Development: local-only secrets, can be less complex
- Staging: unique secrets, similar rotation policy to production
- Production: strongest secrets, strictest rotation, access audited
Never copy production secrets into a development environment for debugging. Reproduce the issue with staging or synthetic data.
Production Secret Stores
For production deployments, use a dedicated secret management service:
- HashiCorp Vault: Self-hosted, supports dynamic secrets, lease-based rotation, and audit logging.
- AWS Secrets Manager: Managed, integrates with IAM, supports automatic rotation for RDS, Redshift, and DocumentDB.
- GCP Secret Manager: Managed, integrates with IAM, versioned secrets.
- Azure Key Vault: Managed, supports HSM-backed keys, certificate management.
Never read secrets from environment variables in production if a secret store is available. Secret stores provide audit logging, access control, automatic rotation, and encryption at rest. Environment variables provide none of these.
Git History Remediation
If a secret was committed to git -- even briefly, even on a branch that was deleted -- it is compromised. Git history is permanent and cloneable.
- Rotate the secret immediately. This is step one, before anything else. The secret is compromised.
- Remove from history using
git filter-repo(preferred) orBFG Repo Cleaner. Do not usegit filter-branch-- it is slow and error-prone. - Force push the cleaned history. All collaborators must re-clone or rebase.
- Invalidate caches: GitHub caches repository data. Contact support if the secret appeared in a public repository.
- Post-mortem: Determine how the secret was committed and add a pre-commit hook to prevent recurrence.
Pre-Commit Hooks for Secret Detection
Install a secret detection hook that scans every commit before it is created:
- gitleaks: Fast, configurable, supports custom patterns. Add a
.gitleaks.tomlconfig. - detect-secrets (Yelp): Generates a baseline of known secrets and alerts on new ones.
- trufflehog: Scans for high-entropy strings and known secret patterns.
Configure in .pre-commit-config.yaml or as a git hook. The hook must block the commit if secrets are detected, not just warn.
Certificate Management
- Automate renewal: Use Let's Encrypt with ACME clients (certbot, acme.sh) for TLS certificates. Manual renewal processes lead to expiration outages.
- Monitor expiration: Set alerts at 30, 14, and 7 days before expiration.
- Store private keys securely: Private keys must be readable only by the service that uses them. File permissions:
0600. Never commit private keys to git. - Use separate certificates per service and environment. A shared wildcard certificate means one compromised service exposes all services.
API Key Scoping (Least Privilege)
When creating API keys for third-party services:
- Request the minimum permissions needed. If you only need read access, do not request write access.
- Use separate keys per service. The key your backend uses to call Stripe should be different from the key your batch processor uses.
- Use separate keys per environment. Development, staging, and production each get their own key.
- Set IP restrictions where supported. Restrict API keys to known server IP ranges.
- Set expiration dates where supported. A key that never expires is a key that will eventually leak.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

