secret-hygiene

secret-hygiene is a skill for Claude Code from smicolon/ai-kit. It costs 62 tokens per session (1,813 once invoked), scanned A, original, MIT.

A set of rules for finding hardcoded credentials and handling sensitive configuration with Infisical. Hardcoded secrets are private values written directly into source code or configuration files.

In plain words
What is it for?
Use it to detect common secret formats, decide what to flag, create environment files safely, and move sensitive values into Infisical.
Why use it?
It helps prevent API keys, tokens, passwords, and connection strings from being exposed in the repository or used inconsistently through local environment variables.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the infisical plugin — 3 skills shipped together

Good fit Use it to detect common secret formats, decide what to flag, create environment files safely, and move sensitive values into Infisical.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/smicolon/ai-kit/secret-hygiene
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add smicolon/ai-kit --skill secret-hygiene
Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit

Made for: Claude Code.

Or install infisical, the plugin that ships this one along with the rest of its 3 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for secret-hygiene

README.md
[![agentmods](https://agentmods.dev/badge/skills/smicolon/ai-kit/secret-hygiene/github.svg)](https://agentmods.dev/skills/smicolon/ai-kit/secret-hygiene)
Your own site
<a href="https://agentmods.dev/skills/smicolon/ai-kit/secret-hygiene"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/secret-hygiene/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for secret-hygiene

Your own site · 80×15
<a href="https://agentmods.dev/skills/smicolon/ai-kit/secret-hygiene"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/secret-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,813 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.01813
Opus 5 $0.00031 $0.00907
Sonnet 5 $0.00012 $0.00363
Haiku 4.5 $0.00006 $0.00181

Measured 6d ago against content hash 238b1c526712, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

secret-hygiene scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packs/infisical/skills/secret-hygiene/SKILL.md · 307 lines

How it starts

The opening of the file, as written. The whole thing — 307 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Secret Hygiene

Patterns for detecting, preventing, and remediating hardcoded secrets in codebases.

Detection Patterns

Common Secret Patterns

Watch for these patterns in code:

# AWS
AKIA[0-9A-Z]{16}                    # AWS Access Key ID
[0-9a-zA-Z/+]{40}                    # AWS Secret Access Key

# API Keys
sk_live_[0-9a-zA-Z]{24,}            # Stripe secret key
sk_test_[0-9a-zA-Z]{24,}            # Stripe test key
SG\.[0-9A-Za-z\-_]{22}\.[0-9A-Za-z\-_]{43}  # SendGrid
xoxb-[0-9]{11}-[0-9]{11}-[0-9a-zA-Z]{24}    # Slack bot token

# Tokens
ghp_[0-9a-zA-Z]{36}                 # GitHub personal access token
glpat-[0-9a-zA-Z\-_]{20}            # GitLab personal access token
eyJ[A-Za-z0-9-_]+\.eyJ[A-Za-z0-9-_]+  # JWT token

# Database
postgres://.*:.*@                    # PostgreSQL connection string
mysql://.*:.*@                       # MySQL connection string
mongodb(\+srv)?://.*:.*@             # MongoDB connection string
redis://.*:.*@                       # Redis connection string

# Private Keys
-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----
-----BEGIN PGP PRIVATE KEY BLOCK-----

When to Flag

Flag code that contains:

  • String literals matching secret patterns above
  • Hardcoded connection strings with credentials
  • Base64-encoded values assigned to secret, key, token, or password variables
  • Configuration files with inline credentials

Remediation

Step 1: Move Secret to Infisical

# Add the secret to Infisical
infisical secrets set STRIPE_SECRET_KEY=sk_live_abc123 --env=dev
infisical secrets set STRIPE_SECRET_KEY=sk_live_xyz789 --env=production

Step 2: Replace Hardcoded Value

Python (Django):

# Before
STRIPE_KEY = "sk_live_abc123"

# After
import os
STRIPE_KEY = os.environ["STRIPE_SECRET_KEY"]

TypeScript (NestJS/Next.js/Hono):

// Before
const stripeKey = "sk_live_abc123"

// After
const stripeKey = process.env.STRIPE_SECRET_KEY!

Flutter (Dart):

// Before
const apiKey = "sk_live_abc123";

// After
final apiKey = const String.fromEnvironment('STRIPE_SECRET_KEY');

Read the full file on GitHub · 307 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 307 lines · 62 tokens per session scan A 238b1c526712

Subscribe to this mod's changes

secret-hygiene is a skill published in the GitHub repository smicolon/ai-kit (6 stars, last pushed 6d ago), licensed MIT. It adds 62 tokens to every session and 1,813 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.