OpenClaw
Security & SecretsRecommended

ggshield Scanner Skill for OpenClaw

Scan repositories for hardcoded secrets (500+ secret types).

Last updated: 2026-03-11

Quick Install

$ npx clawhub@latest install ggshield-scanner

Key Features

Detect 500+ types of hardcoded secrets including API keys, tokens, and private keys
Scan git repositories, directories, Docker images, and PyPI packages
Install pre-commit hooks to catch secrets before they reach your repo
Run full repository history scans to find previously committed secrets
Integrate with CI/CD pipelines for automated secret detection
Privacy-first scanning — your source code is never stored on external servers

OpenClaw ggshield Scanner Skill Overview

The ggshield Scanner skill brings GitGuardian's powerful secret detection engine into your OpenClaw workflow. Instead of memorizing ggshield CLI flags and output formats, you can ask OpenClaw to scan your code for leaked secrets using plain English.

ggshield detects over 500 types of hardcoded secrets — API keys, database credentials, cloud tokens, private keys, and more. The OpenClaw ggshield scanner skill wraps this capability into a conversational interface, making it easy to run scans on demand, set up pre-commit hooks, and interpret results without leaving your development flow.

Typical workflow:

  1. Ask OpenClaw to scan your project for secrets.
  2. The agent runs ggshield secret scan against your codebase or specific files.
  3. Results are returned in a readable summary highlighting any detected secrets, their types, and locations — no need to parse raw CLI output.

Whether you're auditing an existing repo or adding secret scanning to your development process, this skill handles the heavy lifting. Pair it with the 1Password skill for a complete secrets management workflow.

Prerequisites for ggshield Scanner Skill

Before installing the ggshield Scanner skill, make sure you have:

  • OpenClaw installed and running (v1.0+)
  • ggshield installed — official installation guide
  • Python 3.9+ (if installing via pip/pipx) or use standalone packages
  • Git installed for repository scanning
  • clawhub CLI installed for skill management — install guide

Install ggshield using your preferred method:

bash
# macOS (Homebrew)
brew install gitguardian/tap/ggshield

# All platforms (pipx — recommended)
pipx install ggshield

# All platforms (pip)
pip install --user ggshield

Verify your setup:

bash
ggshield --version

How to Install the ggshield Scanner Skill

Install the ggshield Scanner skill with a single command:

bash
npx clawhub@latest install ggshield-scanner

To verify the installation:

bash
clawhub list

You should see ggshield-scanner in your installed skills list. The skill requires ggshield to be available in your PATH.

ggshield Scanner Skill Configuration

GitGuardian Authentication

The ggshield Scanner skill requires a GitGuardian API key for secret detection. You can authenticate in two ways:

Interactive login (recommended for local development):

bash
ggshield auth login

This opens your browser and generates a personal access token automatically.

Environment variable (recommended for CI/CD):

bash
export GITGUARDIAN_API_KEY="your-api-key-here"

Environment Setup

| Variable | Required | Description | |----------|----------|-------------| | GITGUARDIAN_API_KEY | Yes | Personal access token from GitGuardian | | GITGUARDIAN_INSTANCE | No | Custom instance URL for on-premise GitGuardian |

Important: Never hardcode your API key in configuration files. Use environment variables or a secret manager like 1Password or Bitwarden.

Pre-commit Hook Setup

To catch secrets before they are committed:

bash
# Install hook for current repo
ggshield install --mode local

# Install hook globally for all repos
ggshield install --mode global

ggshield Scanner Skill Usage Examples

1. Scan a Project Directory for Secrets

You: "Scan my project directory for any hardcoded secrets"

The agent runs ggshield secret scan path -r . against your working directory and returns a summary of any detected secrets, including the file path, line number, and secret type. If no secrets are found, you get a clean report confirming your code is safe.

2. Audit Git Repository History

You: "Check my entire git history for leaked secrets"

The agent runs ggshield secret scan repo . to scan all commits in your repository. This is useful for auditing legacy codebases or ensuring that previously committed secrets have been properly rotated and removed.

3. Scan a Docker Image Before Deployment

You: "Scan the nginx:latest Docker image for secrets"

The agent executes ggshield secret scan docker nginx:latest to inspect all layers of the Docker image. This catches secrets that may have been baked into container images during the build process — a common source of credential leaks in production.

4. Set Up Pre-commit Protection

You: "Install a pre-commit hook to block secrets from being committed"

The agent runs ggshield install --mode local to add a git pre-commit hook to your repository. Every future commit will be automatically scanned, and commits containing detected secrets will be blocked before they reach your repository.

Security & Best Practices

Follow these guidelines to stay safe when using the ggshield Scanner skill:

  • Use read-only scans by default. The skill should only scan and report — avoid auto-remediation without careful review of each finding.
  • Review before confirming. When the agent suggests removing or rotating a detected secret, verify the finding is a true positive before taking action.
  • Rotate exposed secrets immediately. If ggshield detects a real secret in your repository history, rotate the credential right away — removing the commit is not enough.
  • Enable pre-commit hooks. Prevention is better than detection. Set up hooks with ggshield install to catch secrets before they enter version control.
  • Keep ggshield updated. New secret patterns are added regularly. Run pipx upgrade ggshield or brew upgrade ggshield to stay current.

Troubleshooting Common Errors

"Error: Invalid API key"

Your GitGuardian API key is missing or expired. Re-authenticate with ggshield auth login or verify your GITGUARDIAN_API_KEY environment variable is set correctly. Check that the token has not been revoked in the GitGuardian dashboard.

"Error: ggshield command not found"

ggshield is not installed or not in your PATH. Install it with pipx install ggshield or brew install gitguardian/tap/ggshield. If installed via pip, ensure your Python scripts directory is in your PATH.

"Error: Docker is not available"

Docker image scanning requires a running Docker daemon. Start Docker Desktop or the Docker service, then retry. If you only need to scan source code, use ggshield secret scan path or ggshield secret scan repo instead.

FAQ

Yes. ggshield uses the GitGuardian API for detection, but your actual source code and files are never stored on GitGuardian servers. Only metadata such as scan time and request size is retained. The scanning process is designed to be privacy-first, making it suitable for proprietary and sensitive codebases.

ggshield detects over 500 secret types using GitGuardian's detection engine, which is significantly more comprehensive than git-secrets (regex-based, limited patterns) or truffleHog (entropy-based with higher false positive rates). ggshield also supports Docker image scanning and PyPI package scanning, which most alternatives do not offer. The [Guardrails](/skills/guardrails) skill provides complementary policy enforcement.

Yes. Set the `GITGUARDIAN_API_KEY` environment variable in your CI/CD environment and run ggshield as a pipeline step. The OpenClaw skill is ideal for interactive development scanning, while direct ggshield CLI integration works best for automated pipeline checks. Both use the same detection engine and API key, so results are consistent across environments.

Related Skills

1Password CLI
Recommended

Fetch secrets safely via 1Password CLI (op).

View Guide
Bitwarden / Vaultwarden
Recommended

Access secrets via Bitwarden/Vaultwarden CLI and API.

View Guide
Guardrails
Recommended

Apply safety guardrails around tool use and risky actions.

Install on ClawHubBack to Skills Directory