Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Secrets Management?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-secrets-management-anvil)
---
name: secrets-management
description: "Keep secrets out of code, logs and agent context: env vars, secret stores, rotation and leak response"
---
<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->
# Secrets management
Use whenever code touches credentials, tokens or keys, and whenever a secret may have leaked.
## Storage
- Never commit secrets. Use environment variables locally (`.env` listed in `.gitignore`, `.env.example` committed with placeholders) and a secret manager in deployed environments.
- Read secrets at startup from the environment or the secret store, and fail fast with a clear message if one is missing. Do not hardcode fallback values.
- Give each environment and each service its own credentials, with least privilege.
## In code and logs
- Redact secrets in logs, errors and telemetry. Never log full request headers or connection strings.
- Do not pass secrets in URLs or tool arguments. They end up in logs and transcripts.
- Keep `.env` and key files out of agent context: ANVIL Guard asks before agents read them, and `anvil install --hooks` denies `.env` reads in Claude Code.
## Rotation
Prefer short-lived credentials (OIDC from CI to cloud, workload identity). Rotate long-lived keys on a schedule and immediately when people leave.
## If a secret leaks
1. Revoke or rotate it first. Deleting the commit is not enough, because history, forks and caches keep it.
2. Check the provider's logs for use of the key.
3. Remove it from history if needed, add a scanner (`anvil shield`, gitleaks) to CI, and record what happened.
## Verify
Run `anvil shield` and a secret scanner on the repo, and confirm the app starts with secrets coming only from the environment.