ggshield-scanner

Detect 500+ types of hardcoded secrets (API keys, credentials, tokens) before they leak into git. Wraps GitGuardian's ggshield CLI.

3,891 stars

Best use case

ggshield-scanner is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Detect 500+ types of hardcoded secrets (API keys, credentials, tokens) before they leak into git. Wraps GitGuardian's ggshield CLI.

Teams using ggshield-scanner should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ggshield-scanner/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/amascia-gg/ggshield-scanner/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ggshield-scanner/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ggshield-scanner Compares

Feature / Agentggshield-scannerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Detect 500+ types of hardcoded secrets (API keys, credentials, tokens) before they leak into git. Wraps GitGuardian's ggshield CLI.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# ggshield Secret Scanner

## Overview

**ggshield** is a CLI tool that detects hardcoded secrets in your codebase. This Moltbot skill brings secret scanning capabilities to your AI agent.

### What Are "Secrets"?

Secrets are sensitive credentials that should NEVER be committed to version control:
- AWS Access Keys, GCP Service Accounts, Azure credentials
- API tokens (GitHub, Slack, Stripe, etc.)
- Database passwords and connection strings
- Private encryption keys and certificates
- OAuth tokens and refresh tokens
- PayPal/Stripe API keys
- Email server credentials

### Why This Matters

A single leaked secret can:
- 🔓 Compromise your infrastructure
- 💸 Incur massive cloud bills (attackers abuse your AWS account)
- 📊 Expose customer data (GDPR/CCPA violation)
- 🚨 Trigger security incidents and audits

ggshield catches these **before** they reach your repository.

## Features

### Commands Available

#### 1. `scan-repo`
Scans an entire git repository for secrets (including history).

```
@clawd scan-repo /path/to/my/project
```

**Output**:
```
🔍 Scanning repository...
✅ Repository clean: 1,234 files scanned, 0 secrets found
```

**Output on detection**:
```
❌ Found 2 secrets:

- AWS Access Key ID in config/prod.py:42
- Slack API token in .env.backup:8

Use 'ggshield secret ignore --last-found' to ignore, or remove them.
```

#### 2. `scan-file`
Scans a single file for secrets.

```
@clawd scan-file /path/to/config.py
```

#### 3. `scan-staged`
Scans only staged git changes (useful pre-commit check).

```
@clawd scan-staged
```

This runs on your `git add`-ed changes only (fast!).

#### 4. `install-hooks`
Installs ggshield as a git pre-commit hook.

```
@clawd install-hooks
```

After this, every commit is automatically scanned:
```
$ git commit -m "Add config"
🔍 Running ggshield pre-commit hook...
❌ Secrets detected! Commit blocked.
Remove the secrets and try again.
```

#### 5. `scan-docker`
Scans Docker images for secrets in their layers.

```
@clawd scan-docker my-app:latest
```

## Installation

### Prerequisites

1. **ggshield CLI**: Install via pip
   ```bash
   pip install ggshield>=1.15.0
   ```

2. **GitGuardian API Key**: Required for secret detection
   - Sign up: https://dashboard.gitguardian.com (free)
   - Generate API key in Settings
   - Set environment variable:

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

3. **Python 3.8+**: Required by ggshield

### Install Skill

```bash
clawdhub install ggshield-scanner
```

The skill is now available in your Moltbot workspace.

### In Your Moltbot Workspace

Start a new Moltbot session to pick up the skill:

```bash
moltbot start
# or via messaging: @clawd list-skills
```

## Usage Patterns

### Pattern 1: Before Pushing (Security Check)

```
Dev: @clawd scan-repo .
Moltbot: ✅ Repository clean. All good to push!

Dev: git push
```

### Pattern 2: Audit Existing Repo

```
Dev: @clawd scan-repo ~/my-old-project
Moltbot: ❌ Found 5 secrets in history!
         - AWS keys in config/secrets.json
         - Database password in docker-compose.yml
         - Slack webhook in .env.example
Moltbot: Recommendation: Rotate these credentials immediately.
         Consider using git-filter-repo to remove from history.
```

### Pattern 3: Pre-Commit Enforcement

```
Dev: @clawd install-hooks
Moltbot: ✅ Installed pre-commit hook

Dev: echo "SECRET_TOKEN=xyz" > config.py
Dev: git add config.py
Dev: git commit -m "Add config"
Moltbot: ❌ Pre-commit hook detected secret!
Dev: rm config.py && git reset
Dev: (add config to .gitignore and to environment variables instead)
Dev: git commit -m "Add config" # Now works!
```

### Pattern 4: Docker Image Security

```
Dev: @clawd scan-docker my-api:v1.2.3
Moltbot: ✅ Docker image clean
```

## Configuration

### Environment Variables

These are required for the skill to work:

| Variable | Value | Where to Set |
| :-- | :-- | :-- |
| `GITGUARDIAN_API_KEY` | Your API key from https://dashboard.gitguardian.com | `~/.bashrc` or `~/.zshrc` |
| `GITGUARDIAN_ENDPOINT` | `https://api.gitguardian.com` (default, optional) | Usually not needed |

### Optional ggshield Config

Create `~/.gitguardian/.gitguardian.yml` for persistent settings:

```yaml
verbose: false
output-format: json
exit-code: true
```

For details: https://docs.gitguardian.com/ggshield-docs/

## Privacy & Security

### What Data is Sent to GitGuardian?

✅ **ONLY metadata is sent**:

- Hash of the secret pattern (not the actual secret)
- File path (relative path only)
- Line number

❌ **NEVER sent**:

- Your actual secrets or credentials
- File contents
- Private keys
- Credentials

**Reference**: GitGuardian Enterprise customers can use on-premise scanning with no data sent anywhere.

### How Secrets Are Detected

ggshield uses:

1. **Entropy-based detection**: Identifies high-entropy strings (random tokens)
2. **Pattern matching**: Looks for known secret formats (AWS key prefixes, etc.)
3. **Public CVEs**: Cross-references disclosed secrets
4. **Machine learning**: Trained on leaked secrets database

## Troubleshooting

### "ggshield: command not found"

ggshield is not installed or not in your PATH.

**Fix**:

```bash
pip install ggshield
which ggshield  # Should return a path
```

### "GITGUARDIAN_API_KEY not found"

The environment variable is not set.

**Fix**:

```bash
export GITGUARDIAN_API_KEY="your-key"
# For persistence, add to ~/.bashrc or ~/.zshrc:
echo 'export GITGUARDIAN_API_KEY="your-key"' >> ~/.bashrc
source ~/.bashrc
```

### "401 Unauthorized"

API key is invalid or expired.

**Fix**:

```bash
# Test the API key
ggshield auth status

# If invalid, regenerate at https://dashboard.gitguardian.com → API Tokens
# Then: export GITGUARDIAN_API_KEY="new-key"
```

### "Slow on large repositories"

Scanning a 50GB monorepo takes time. ggshield is doing a lot of work.

**Workaround**:

```bash
# Scan only staged changes (faster):
@clawd scan-staged

# Or specify a subdirectory:
@clawd scan-file ./app/config.py
```

## Advanced Topics

### Ignoring False Positives

Sometimes ggshield flags a string that's NOT a secret (e.g., a test key):

```bash
# Ignore the last secret found
ggshield secret ignore --last-found

# Ignore all in a file
ggshield secret ignore --path ./config-example.py
```

This creates `.gitguardian/config.json` with ignore rules.

### Integrating with CI/CD

You can add secret scanning to GitHub Actions / GitLab CI:

```yaml
# .github/workflows/secret-scan.yml
name: Secret Scan
on: [push]
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - run: pip install ggshield
      - run: ggshield secret scan repo .
        env:
          GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
```

### Enterprise: On-Premise Scanning

If your company uses GitGuardian Enterprise, you can scan without sending data to the cloud:

```bash
export GITGUARDIAN_ENDPOINT="https://your-instance.gitguardian.com"
export GITGUARDIAN_API_KEY="your-enterprise-key"
```

## Related Resources

- **ggshield Documentation**: https://docs.gitguardian.com/ggshield-docs/
- **GitGuardian Dashboard**: https://dashboard.gitguardian.com (view all secrets found)
- **Moltbot Skills**: https://docs.molt.bot/tools/clawdhub
- **Secret Management Best Practices**: https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html

## Support

- **Bug reports**: https://github.com/GitGuardian/ggshield-skill/issues
- **Questions**: Open an issue or comment on ClawdHub
- **ggshield issues**: https://github.com/GitGuardian/ggshield/issues

## License

MIT License - See LICENSE file

## Contributors

- GitGuardian Team
- [Your contributions welcome!]

---

**Version**: 1.0.0
**Last updated**: January 2026
**Maintainer**: GitGuardian

Related Skills

Contract Reviewer - AI Legal Document Risk Scanner

3891
from openclaw/skills

Upload any contract or legal document and get a structured risk analysis with flagged clauses, plain-language explanations, and negotiation suggestions.

AURA Security Scanner

3891
from openclaw/skills

Scan AI agent skills for malware, credential theft, prompt injection, and dangerous permissions before installing them

lora-cad-scanner

3891
from openclaw/skills

LoRa Channel Activity Detection (CAD) scanner for LilyGo T3 v1.6 (ESP32-PICO-D4 + SX1276) with HackRF One support. Scans a configurable frequency range using multiple BW/SF combinations, displays live progress on the SSD1306 OLED, stores detected channels in device RAM, emits structured 15-minute reports over Serial, and sends Telegram notifications for new detections via an OpenClaw cron pipeline. Use when scanning for LoRa devices in a frequency band, setting up a LilyGo T3 as a LoRa scanner/sniffer, building RF monitoring pipelines with Telegram alerting, or doing RF reconnaissance with HackRF + LilyGo together.

securevibes-scanner

3891
from openclaw/skills

Run AI-powered application security scans on codebases. Use when asked to scan code for security vulnerabilities, generate threat models, review code for security issues, run incremental security scans, or set up continuous security monitoring via cron. Supports full scans (one-shot) and incremental scans (cron-driven, only new commits).

aws-secrets-scanner

3891
from openclaw/skills

Detect hardcoded secrets, exposed API keys, and credential misconfigurations in IaC and config files

security-scanner

3891
from openclaw/skills

Scans OpenClaw skills for security vulnerabilities and suspicious patterns before installation

olo-sec-scanner

3891
from openclaw/skills

SEC EDGAR filing analysis for M&A due diligence — extract financials, detect risks, and track corporate events from 10-K, 10-Q, and 8-K filings

permission-creep-scanner

3891
from openclaw/skills

Helps detect permission creep in AI agent skills — flags when a skill's actual code accesses resources far beyond what its declared purpose requires, like a "fix typo" skill reading your .env file.

clawhub-skill-scanner

3891
from openclaw/skills

Security gatekeeper for skill installations. MANDATORY before installing any skill from ClawHub, GitHub, or external sources. Performs deep code analysis to detect malicious patterns, credential access, data exfiltration, command injection, and other security risks. Triggers: "install skill", "clawhub install", "new skill", "add skill", "skill from". Always run this BEFORE installation.

contract-scanner

3891
from openclaw/skills

Scan smart contracts for security risks. Detect honeypots, high taxes, and malicious code. Protect yourself from scams!

edgeone skill scanner

3891
from openclaw/skills

Scan any agent skill for security risks before you install or use it. Powered by Tencent Zhuque Lab A.I.G (AI-Infra-Guard). 100% local static analysis — no file contents or credentials leave your device. Compatible with CodeBuddy, Cursor, Windsurf, Claude Code, OpenClaw and more. Triggers on: `这个 skill 安全吗`, `skill 安全扫描`, `检查 skill 安全`, `audit skill`, `scan skill`, `check skill safety`, `analyze skill`, `inspect skill`, `verify skill`, `skill security`, `skill supply chain`. Do NOT trigger for general agent usage, full system health checks, project debugging, or normal development.

skill-scanner

3891
from openclaw/skills

Scan any agent skill for security risks before you install or use it. Powered by Tencent Zhuque Lab A.I.G (AI-Infra-Guard). 100% local static analysis — no file contents or credentials leave your device. Compatible with CodeBuddy, Cursor, Windsurf, Claude Code, OpenClaw and more. Triggers on: `这个 skill 安全吗`, `skill 安全扫描`, `检查 skill 安全`, `audit skill`, `scan skill`, `check skill safety`, `analyze skill`, `inspect skill`, `verify skill`, `skill security`, `skill supply chain`. Do NOT trigger for general agent usage, full system health checks, project debugging, or normal development.