Skip to content
Back to skills

Secrets Management

ASecurity

Keep secrets out of code, logs and agent context: env vars, secret stores, rotation and leak response

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 30, 2026
ai-agentsgitdevopssecurity

Works with

  • claude code

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill secrets-management --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Secrets Management?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Secrets Management
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-secrets-management/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-secrets-management)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Keep secrets out of code, logs and agent context: env vars, secret stores, rotation and leak response
profile: minimal
tags: security, devops, secrets
---

# 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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.