Skills Agentes

Install Hooks

Instala o repara hooks que revisan la presencia de secretos en cada commit, push o acción de un asistente de IA; usa scan-secrets para un escaneo puntual o una investigación de fuga.

Oficial

Reemplaza a: Escribir un script propio para buscar secretos, Ejecutar escaneos manuales en vez de usar un hook

Estrellas
13

en todo el repo

Actividad
63

0–100, la ruta de este skill

Actualizado
hace 10 días

último commit aquí

Commits
5

últimos 90 días

Contexto
1k tok

77 tok en reposo

Paquete
12 archivos

49 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add GitGuardian/agent-skills --skill install-hooks --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Instala o repara hooks de Git (pre-commit, pre-push) o de asistentes de IA que escanean en busca de secretos
  • Comprueba qué protección ya existe antes de instalar nada, para no duplicar hooks
  • Tras instalar, verifica la configuración pero no ejecuta un escaneo de prueba
  • Al encontrar un secreto en un hook, informa del tipo y la ubicación sin mostrar el valor

Úsalo cuando

  • El usuario quiere prevenir fugas de secretos en commits, pushes o acciones de un asistente de IA
  • Hay trabajo con credenciales sin protección de hooks
  • Un escaneo del agente duplica un hook que ya existe
  • El usuario pide explícitamente instalar o reparar hooks

No lo uses cuando

  • Para un escaneo puntual o una investigación de una fuga, usa scan-secrets en su lugar

Qué lo activa

Di cualquiera de estas frases y el agente debería cargar este skill.

  • “Instala un hook de pre-commit para detectar secretos”
  • “Repara la protección de secretos en este repo”
  • “Quiero que se revisen los prompts de mi asistente de IA antes de ejecutarse”
  • “Añade un hook de pre-push que escanee commits salientes”

SKILL.md

En inglés

Install secret-scanning hooks

Overview

Hooks do the recurring checks. The agent does not. Never run a scan yourself, and never write a script or other tool to find secrets. Check the existing protection once per context. Reuse protection that works. Offer a missing installation or a repair one time. If the user declines, do not ask again, and do not run scans instead.

When to Use

Requested protection Hook Content that the hook checks
Before a commit pre-commit Staged changes
Before a push pre-push Outgoing commits, including intermediate versions
During AI assistant actions AI hook for the named or active assistant Supported prompt and tool events

Use the stage, the assistant, and the scope that the user specified. Ask only for a missing choice. For a bare "install hooks" request, ask which hook family the user wants. An explicit installation request authorizes its stated scope. A recommendation request or a scan request does not authorize an installation. A global installation needs explicit authorization.

Onboarding (first use)

Prerequisites

Before an installation, check:

  • ggshield --version
  • the --help output of the relevant command
  • ggshield api-status for authentication
  • the target assistant, when the request names one

Do not repeat a check that already passed in this context.

Setup

If the CLI is missing or not authenticated, read ggshield-cli-setup.md. Otherwise, continue.

Commands

Read the relevant section of hook-selection.md when you check, install, or repair protection. It covers the effective Git hook paths, existing hook managers, and scoped AI hook installation. Do not read it again for a routine operation that it already covered.

After an installation, check the configuration. Do not run a test scan. Do not create a test secret, a test commit, or a test push. Report "configured" and "ran and passed" as two different states. The next authorized operation runs the hook and gives the "ran and passed" result.

Best Practices

  • Keep existing hook managers and existing secret protection. A hook that only runs a linter is not secret protection.
  • Do not add manual scans next to a hook. Do not bypass a hook failure. Do not report a skipped or failed check as clean. For an explicit scan, use scan-secrets when it is available.
  • When a hook finds a secret, report the secret type and location. Do not show the secret value. Show the organization's remediation message first, when one exists. Determine if the secret was exposed. A blocked commit or push does not prove that the secret never leaked elsewhere. If the secret is only local, remove it, including from unpushed commits. If the secret was exposed, coordinate a rotation. The same hook checks the next authorized retry. If scan-secrets is installed, it contains detailed remediation guidance.

Troubleshooting

If a hook does not run, check the effective hook paths, the hook manager dispatch, the enabled events, the authentication, and the project trust settings. The hook-selection reference describes each check. An AI scan error can let an unscanned action continue. To uninstall, remove only the ggshield entries, through the hook manager that owns them. Keep the other hooks.

Reproducido de GitGuardian/agent-skills bajo licencia MIT. Leer esta página en markdown.

Archivos

12 archivos en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

Antes de instalar

Necesitas el CLI ggshield instalado y autenticado (v1.49.0+ para hooks de asistentes de IA, v1.51.0+ para codex), además de git o la herramienta de IA correspondiente.

Detalles

Categoría
Seguridad
Licencia
MIT
Recursos incluidos
referencias
Código fuente
Ver SKILL.md

Etiquetas

Más de GitGuardian/agent-skills

Este repo incluye 6 skills. Si instalas uno, normalmente ya tienes los demás. Ver el pack agent-skills entero y su comando de instalación

Para triar incidentes de secretos de GitGuardian ya detectados, ver qué se filtra o rotar credenciales marcadas, o tras una alerta de Public Monitoring. Funciona vía el servidor GitGuardian Developer MCP.

Costo de contexto al activarse
1.7k tok
Tamaño del paquete
7 archivos
Última actualización
hace 10 días
Oficialseguridad

Escanea ficheros, cambios staged, commits, historial, imágenes Docker o paquetes en busca de secretos codificados, ante una petición de escaneo, auditoría o filtración sospechosa.

Costo de contexto al activarse
1.5k tok
Tamaño del paquete
14 archivos
Última actualización
hace 10 días
Oficialseguridad

Úsalo al generar o plantar honeytokens, canary tokens, decoys o tripwire credentials de GitGuardian en .env.example, configs de ejemplo, repos antes de publicarse, wikis o scripts de deploy.

Costo de contexto al activarse
3.3k tok
Tamaño del paquete
4 archivos
Última actualización
hace 10 días
Oficialseguridad

Comprueba si una credencial conocida ya se filtró públicamente mediante HasMySecretLeaked (HMSL) de GitGuardian; el agente solo prepara comandos, el usuario los ejecuta.

Costo de contexto al activarse
4.6k tok
Tamaño del paquete
8 archivos
Última actualización
hace 10 días
Oficialseguridad

Escanea todo el equipo de un desarrollador en busca de credenciales (repos, dotfiles, configs de AWS/kube/docker/npm, historial de shell, cachés de agentes IA) con ggshield machine scan.

Costo de contexto al activarse
4.8k tok
Tamaño del paquete
2 archivos
Última actualización
hace 10 días
Oficialseguridad

Skills relacionados

Comprueba si una credencial conocida ya se filtró públicamente mediante HasMySecretLeaked (HMSL) de GitGuardian; el agente solo prepara comandos, el usuario los ejecuta.

Costo de contexto al activarse
4.6k tok
Tamaño del paquete
8 archivos
Última actualización
hace 10 días
Oficialseguridad

Úsalo al generar o plantar honeytokens, canary tokens, decoys o tripwire credentials de GitGuardian en .env.example, configs de ejemplo, repos antes de publicarse, wikis o scripts de deploy.

Costo de contexto al activarse
3.3k tok
Tamaño del paquete
4 archivos
Última actualización
hace 10 días
Oficialseguridad

Escanea todo el equipo de un desarrollador en busca de credenciales (repos, dotfiles, configs de AWS/kube/docker/npm, historial de shell, cachés de agentes IA) con ggshield machine scan.

Costo de contexto al activarse
4.8k tok
Tamaño del paquete
2 archivos
Última actualización
hace 10 días
Oficialseguridad