secret-handling

Scan staged files for regex-defined secret patterns before git commits.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/Quintenps/contactswap-agents --skill secret-handling-quintenps
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: secret-handling
Source: https://github.com/Quintenps/contactswap-agents/tree/main/.copilot/skills/secret-handling
Command: npx skills add https://github.com/Quintenps/contactswap-agents --skill secret-handling-quintenps

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents accidental exposure of sensitive credentials like API keys, passwords, and connection strings by enforcing strict file-read prohibitions and pre-commit validation.

Core Features & Use Cases

  • Prohibited Read Enforcement: Blocks agents from reading sensitive environment files like .env or .env.local.
  • Automated Pre-Commit Scanning: Scans staged files for secret patterns before allowing any git commits.
  • Remediation Guidance: Provides clear, actionable steps for users if a credential leak is detected in the repository history.

Quick Start

Ask the agent to validate the current staging area for any potential secret leaks before committing your changes.

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 API key and credential leaks in git history?

Pre-commit scanning prevents credential leaks by checking staged files against regex-defined secret patterns before commits are allowed. It also blocks access to environment files like .env to protect sensitive credentials from version control exposure.

How do I scan staged files for secrets before committing?

You can scan staged files for secrets by integrating pre-commit git hooks that validate the staging area against regex-defined secret patterns. Ask your agent to validate the staging area for potential secret leaks before pushing to remote repositories.

What is the best way to restrict agent access to .env files?

The best way to restrict agent access to .env files is through prohibited read enforcement. This mechanism blocks agents from reading sensitive environment files like .env or .env.local, preventing accidental exposure of connection strings and variables.

How do I remediate a detected credential leak in repository history?

To remediate a detected credential leak in repository history, follow the actionable remediation guidance provided by the scanning tool. This ensures sensitive credentials like API keys and passwords are removed from git history and access is restricted.