forge-secrets

Enforce safe secret loading, logging, error handling, storage, and rotation.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/f4rkh4d/forge-skill --skill forge-secrets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge-secrets
Source: https://github.com/f4rkh4d/forge-skill/tree/main/skills/security/forge-secrets
Command: npx skills add https://github.com/f4rkh4d/forge-skill --skill forge-secrets

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill prevents accidental exposure of API keys, passwords, tokens, and other credentials by enforcing safe loading, logging, error handling, storage, and rotation practices that stop the most common leak paths.

Core Features & Use Cases

  • Secret handling guardrails: no hardcoded credentials, no secret defaults, and no unsafe transport patterns such as bearer tokens in query strings.
  • Fail-fast startup validation: required environment variables are validated at boot (optionally via schema validation) so the service crashes instead of running with missing/unsafe config.
  • Redaction and error hygiene: all potentially secret-bearing logs are redacted, raw error objects and stack traces are never returned to clients, and client responses use safe error shapes.
  • Secure storage & rotation: passwords use argon2id/bcrypt (not SHA-1/MD5/SHA-256), encryption uses AEAD, API tokens are hashed at rest, and rotation includes documented procedures with dual-key grace periods.

Quick Start

Instruct your AI coding agent to add environment-based secret loading with startup validation, configure logger redaction for secret-like fields, and ensure production responses never return stack traces or raw error messages, using forge-secrets as the checklist for any code that touches keys, tokens, passwords, or session secrets.

Frequently Asked Questions about forge-secrets

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

FAQPage Schema
How do I prevent API keys and database passwords from leaking in application logs?

Prevent secret leaks by enforcing log redaction for secret-bearing fields, ensuring raw error objects and stack traces are never returned to clients, and using client-safe error mapping for all responses.

What is fail-fast environment validation for required secrets?

Fail-fast environment validation checks required environment variables at boot via schema validation, crashing the service immediately instead of running with missing or unsafe configuration.

How do I securely store OAuth tokens and session secrets at rest?

Securely store secrets by hashing API tokens at rest, encrypting data using AEAD, and hashing passwords with argon2id or bcrypt rather than SHA-1, MD5, or SHA-256.

What is the best way to rotate signing keys without downtime?

Rotate signing keys without downtime by following documented procedures that include dual-key grace periods, allowing simultaneous validation of both old and new secrets during the transition.

Does this secret scanning approach work for backend web services handling bearer tokens?

Yes, it applies to backend and web services handling API keys, OAuth tokens, and session secrets, enforcing safe transport by rejecting bearer tokens in query strings and scanning code via a verifier.