secrets-and-config-management
Skill1 starsChanged 47 days agoMITView on GitHub
Language-agnostic framework for managing secrets, credentials, environment variables, and application configuration. Triggers whenever an agent is asked to "add an API key", "set up environment variables", "I committed a secret by accident", "how should I store this credential?", "secrets in CI", "manage config", or "configure secret scanning". Covers secret vs config classification, local .env.example discipline, centralized config loaders, CI encrypted secrets, production vaults (AWS Secrets Manager, Vault, Doppler), rotation playbooks, and Gitleaks scanning.
- Reads credentials
In this repository15 other files it gives its agents.
- accessibility-auditSkill
- agent-skills-authoringSkill
- api-designSkill
- ci-cd-pipelineSkill
- code-reviewSkill
- design-system-adapterSkill
- docker-and-containersSkill
- docs-and-adrSkill
- git-commit-workflowSkill
- package-security-vettingSkill
- replicate-apiSkill
- testing-strategySkill
- ui-cloneSkill
- ui-slop-remediationSkill
- universal-coding-standardsSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 29
Before storing any value, categorize it strictly:
- Very specific: line 41
Verify that .gitignore contains entries for all local secret files:
- Very specific: line 50
Always maintain a committed .env.example documenting all required variables with dummy values:
- Distinctive: line 61
If a secret is committed, you must rotate the secret immediately at the provider, not merely delete the file.
- Very specific: line 63
Never scatter direct process.env.MY_VAR or os.environ.get("MY_VAR") calls across controllers and UI components.
- Distinctive: line 74
Ensure secret values are masked in CI execution logs.
- Distinctive: line 85
Use cloud-native secrets managers (AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault, or Doppler) to inject secrets at runtime via …
- Distinctive: line 89
Never point a development or staging environment at production databases, Stripe live keys, or production third-party webhooks as a …
- Distinctive: line 99
When an exposure is identified, revoke and rotate the secret immediately at the provider.
- Distinctive: line 101
Keep a documented catalog mapping each external credential to the applications, CI pipelines, and environments that depend on it to prevent …
- Very specific: line 110
When a scanner flags a simulated test fixture or documentation example, allowlist the specific fingerprint in the scanner configuration …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Secrets & Configuration Management
A language-agnostic operational standard for handling secrets, environment variables, and configuration across local development, CI/CD, and production environments.
Sibling Standards:
- For pre-commit scanning and verifying staged diffs before committing, see
git-commit-workflow.- For avoiding malicious packages that steal environment variables, see
package-security-vetting.- For application-level input sanitization and security baselines, see
universal-coding-standards.
1. Secret vs. Configuration Classification
Before storing any value, categorize it strictly:
| Category | Definition | Examples | Storage Rule |
| Secret | Confidential data that proves identity or grants access. Compromise leads directly to unauthorized system access or financial loss. | Database passwords, API tokens (Stripe, OpenAI), private SSH/TLS keys, JWT signing keys, OAuth client secrets. | NEVER in Git. Local .env (gitignored), CI secret vaults, or cloud secrets managers. |
| Configuration | Non-sensitive runtime parameters that control application behavior without granting access. | Port numbers, log levels (INFO, DEBUG), timeout thresholds (30s), pagination limits, public CDN URLs, feature flags. | Safe to commit in version control (e.g. config/default.json, settings.py) or inject via environment variables. |
2. Local Development Standards
- 2.1 Strict
.gitignoreProtection:- Verify that
.gitignorecontains entries for all local secret files:.env .env.* !.env.example *.pem *.key
- Verify that
- 2.2 Commit
.env.examplewith Safe Placeholders:- Always maintain a committed
.env.exampledocumenting all required variables with dummy values:# Database DATABASE_URL=postgresql://user:password@localhost:5432/dev_db # Third-Party APIs (Do not commit real keys!) STRIPE_SECRET_KEY=sk_test_placeholder_key_here OPENAI_API_KEY=sk-placeholder
- Always maintain a committed
- 2.3 Never Commit Secrets "Temporarily":
- A secret committed to Git is permanent in history, even if deleted in the very next commit.
- If a secret is committed, you must rotate the secret immediately at the provider, not merely delete the file.
- 2.4 Centralized Configuration Loader:
- Never scatter direct
process.env.MY_VARoros.environ.get("MY_VAR")calls across controllers and UI components. - Load and validate all configuration in a single, typed central configuration module (e.g., using
Zod,Pydantic, or a Config class) that fails loudly at application startup if required keys are missing.
- Never scatter direct
3. CI/CD Pipeline Practices
- 3.1 Encrypted Platform Stores Only:
- Store CI secrets strictly within the hosting platform's encrypted secret store (GitHub Actions Secrets, GitLab CI Masked Variables, CircleCI Contexts).
- Never hardcode tokens inside pipeline YAML files (e.g.,
.github/workflows/deploy.yml).
- 3.2 Automatic Log Masking:
- Ensure secret values are masked in CI execution logs.
- 🚫 Never
echoor print secrets to stdout for pipeline debugging.
- 3.3 Minimum Job Scoping (Least Privilege):
- Inject deployment credentials only into the specific
deployjob, never globally across all linting or unit test jobs.
- Inject deployment credentials only into the specific
4. Production Secret Architecture
- 4.1 Dedicated Secrets Managers Over Static Files:
- In production, avoid placing static
.envfiles on production virtual machines or baking secrets into Docker image layers. - Use cloud-native secrets managers (AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault, or Doppler) to inject secrets at runtime via IAM service identities (see
references/tooling-notes.md).
- In production, avoid placing static
- 4.2 Service-Level Isolation:
- Give each microservice or component access only to the exact secrets it requires, rather than sharing a single monolithic environment blob.
- 4.3 Strict Environment Separation:
- Never point a development or staging environment at production databases, Stripe live keys, or production third-party webhooks as a "shortcut".
5. Secret Rotation & Incident Response
- 5.1 Scheduled vs. Emergency Rotation:
- Rotate database passwords and API tokens on a defined schedule (e.g. every 90 days).
- Trigger immediate emergency rotation upon any suspected leak (committed to Git, printed in Sentry/Datadog logs, or exposed in a client-side bundle).
- 5.2 The Incident Rule: Rotate First, Investigate Second:
- When an exposure is identified, revoke and rotate the secret immediately at the provider. Never leave an exposed credential active while investigating how it happened.
- 5.3 Maintain a Secret Inventory:
- Keep a documented catalog mapping each external credential to the applications, CI pipelines, and environments that depend on it to prevent unexpected outages during rotation.
6. Automated Secret Detection
- 6.1 Pre-Commit & CI Scanning:
- Enforce automated secret scanners (e.g.
gitleaks,trufflehog) in local pre-commit hooks and CI pull request gates.
- Enforce automated secret scanners (e.g.
- 6.2 Handling Scanner False Positives:
- When a scanner flags a simulated test fixture or documentation example, allowlist the specific fingerprint in the scanner configuration (e.g.
.gitleaksignore). - 🚫 Never disable the scanner to bypass a build failure.
- When a scanner flags a simulated test fixture or documentation example, allowlist the specific fingerprint in the scanner configuration (e.g.
Detailed References
references/tooling-notes.md: Setup commands and configuration examples for Gitleaks, TruffleHog, AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault, Doppler, and the Git History Scrubbing Playbook (git-filter-repo).
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.

