agent-secret-hygiene

Prevents secret-shaped literals in code, tests, and documentation from triggering GitHub push protection.

Updated Aug 25, 2026
One-click install
npx skills add https://github.com/hyvanmielenpelit/SharedAgentSkills --skill agent-secret-hygiene-hyvanmielenpelit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-secret-hygiene
Source: https://github.com/hyvanmielenpelit/SharedAgentSkills/tree/main/skills/agent-secret-hygiene
Command: npx skills add https://github.com/hyvanmielenpelit/SharedAgentSkills --skill agent-secret-hygiene-hyvanmielenpelit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? A single synthetic token that looks like a real credential causes GitHub push protection to reject an entire push, blocking unrelated commits and forcing costly history rewrites. This Skill teaches how to write test fixtures, examples, and documentation without ever producing a secret-shaped string. ## Core Features & Use Cases - Secret-shape detection rules: Explains what scanners match — a vendor prefix (ghp_, sk_live_, AKIA, etc.) plus a random-looking body — so you know exactly what to avoid. - Safe fixture techniques: Shows the two-concatenated-literals pattern for building runtime tokens that no single source literal matches, plus safe placeholder forms like <your-api-key>. - Documentation guidance: Describes tokens in words or truncated form instead of quoting realistic examples. - Recovery workflow: Step-by-step handling when a push is already rejected, including history cleanup and why the bypass link must never be used. - Use Case: Before writing an authentication test fixture or a README example showing an API key, consult this Skill to produce a value that works at runtime but never trips secret scanning. ## Quick Start Before writing any example API key, token fixture, or connection string, apply this Skill to verify the literal is not secret-shaped and assemble runtime tokens from two concatenated literals instead.

Frequently Asked Questions about agent-secret-hygiene

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a test fixture that looks like a GitHub token without triggering secret scanning?

Assemble the token at runtime from two concatenated literals, such as "gh" + "p_" for the prefix and a repeated character for the body. No single literal in the source file then carries a complete secret shape, so scanners find nothing to match.

What makes a string secret-shaped to GitHub push protection?

A recognizable vendor prefix like ghp_, sk_live_, AKIA, or xoxb- followed by 20-100 random-looking base62, base64, or hex characters. A prefix named alone in prose is safe; completing it with any plausible body, even an invented one, triggers the scanner.

Why did GitHub reject my entire push over one fake token?

Push protection scans the pushed text and rejects the whole push, not just the offending file or commit. The literal also persists in local history, so a follow-up deletion commit does not clear the block — the history must be rewritten.

Can I use the bypass link when the detected secret is obviously fake?

No. Bypassing allow-lists that exact string permanently, so a future real occurrence is waved through, and it records a person as approving a secret. Any bypass decision belongs to the user, never the agent.

What placeholders are safe to use in configuration examples?

Obvious placeholders like <your-api-key>, REPLACE_ME, xxxxx, empty strings, or repeated characters are all safe. What is unsafe is a realistic-looking random body that imitates an actual vendor token format.

What should I do if a real credential was already committed?

Stop and report it plainly: the credential must be rotated, not merely deleted, because the published history already exposed it. Real secrets belong in environment variables, user-secrets stores, key vaults, or CI secrets — never in any repository file.