secret-handling

Block commits containing detected secrets and forbid reading live .env files.

Updated Mar 18, 2022
One-click install
npx skills add https://github.com/mpaulosky/dotfiles --skill secret-handling-mpaulosky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: secret-handling
Source: https://github.com/mpaulosky/dotfiles/tree/main/.copilot/skills/secret-handling
Command: npx skills add https://github.com/mpaulosky/dotfiles --skill secret-handling-mpaulosky

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents accidental exposure of sensitive credentials by forbidding agents from reading live .env files and by blocking the inclusion of secrets in committed repository files, especially within the .squad/ decision and history artifacts.

Core Features & Use Cases

  • Prohibited Reads: Explicitly forbids reading .env, .env.production, .env.local and other live-secret files while allowing safe examples like .env.example.
  • Pre-Commit Secret Scanning: Defines regex-based detection of API keys, passwords, connection strings, JWTs, private keys, and other secret patterns and mandates blocking commits that contain them.
  • Remediation & Escalation: Provides clear steps to remove staged secrets, notify the user, revoke exposed credentials, and remove secrets from git history using specialized tools.
  • Safe Alternatives: Recommends asking users for values, reading placeholder files, and writing placeholders or redacted references instead of real secrets.

Quick Start

Ask the agent to run the pre-commit secret scan on staged files and block any commit that contains detected secret patterns.

Frequently Asked Questions about secret-handling

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

FAQPage Schema
How do I prevent accidental commits of secrets like API keys in git?

Preventing accidental commits of secrets requires blocking reads of live .env files and scanning staged files with regex patterns to detect API keys, passwords, and private keys before they enter git history. This Skill automates that detection and blocks commits containing sensitive values.

What is pre-commit secret scanning and how does it work?

Pre-commit secret scanning is the process of detecting sensitive values in staged files before they are committed. This Skill uses regex patterns to identify API keys, JWTs, and connection strings, then removes the files from staging and instructs users to rotate exposed credentials.

How do I stop spawned agents from reading live .env files?

To stop agents from reading live .env files, apply explicit prohibitions against reading .env, .env.production, and .env.local while permitting access to safe placeholder files like .env.example. This Skill enforces those read restrictions and suggests asking users for values directly.

What should I do if a secret is detected in my git history?

If a secret is detected in git history, you must remove the files from staging, purge the sensitive values from git history using specialized tools, and immediately rotate the exposed credentials. This Skill provides remediation steps to escalate and clean the repository.

Can I use this secret scanning approach in CI workflows?

Yes, you can apply this secret scanning approach to CI workflows by scanning staged .squad/ files and git history during development. It integrates with Scribe pre-commit hooks and CI pipelines to block commits containing detected secret patterns.