Scan repositories for secrets using gitleaks/truffleHog with AI assessment.
dobbe scan secrets [PATH] [OPTIONS]
scan secrets runs a secret detection scan against a local repository using gitleaks or truffleHog. Each finding is optionally assessed by Claude AI to determine real severity and identify false positives. The AI evaluates whether a detected string is an actual secret, a test fixture, a placeholder, or a known-safe pattern, and provides an evidence-backed assessment for each finding.
┌─────────────────────────────────────────────┐
│ dobbe scan secrets ./my-repo │
└──────────────────────┬──────────────────────┘
│
v
┌─────────────────────────────────────────────┐
│ Parse CLI args + load config │
│ - path from positional arg (default ".") │
│ - format from --format or config │
└──────────────────────┬──────────────────────┘
│
v
┌─────────────────────────────────────────────┐
│ Discover MCP servers + extra tools │
│ (~/.claude/settings.json) │
└──────────────────────┬──────────────────────┘
│
v
┌─────────────────────────────────────────────┐
│ Run secret scanner │
│ - Detect gitleaks or truffleHog │
│ - Scan repo at PATH │
│ - Collect raw findings │
└──────────────────────┬──────────────────────┘
│
v
┌─────────────────────────────────────────────┐
│ AI severity assessment (unless --no-ai) │
│ For each finding: │
│ - Classify severity (critical/high/med/ │
│ low) │
│ - Detect false positives │
│ - Provide evidence-backed assessment │
└──────────────────────┬──────────────────────┘
│
v
┌─────────────────────────────────────────────┐
│ Render output │
│ --format table (default) / json │
│ --output file (optional) │
└──────────────────────┬──────────────────────┘
│
v
┌─────────────────────────────────────────────┐
│ Shallow clone warning │
│ If .git/shallow exists and no secrets found │
│ -> warn that history may contain secrets │
└─────────────────────────────────────────────┘
| Option | Type | Default | Description |
|---|---|---|---|
PATH |
str (positional) |
. |
Repository path to scan |
--no-ai |
bool |
False |
Skip AI severity assessment; report raw scanner output only |
--format / -f |
str |
table |
Output format: table, json. Env: DOBBE_FORMAT |
--output |
str |
- | Write output to file instead of stdout |
--quiet / -q |
bool |
False |
Suppress progress output, only show final result |
By default, each finding from gitleaks/truffleHog is sent through Claude AI for triage. The AI:
critical, high, medium, or low based on the type of secret and its exposure riskCHANGEME, xxx), example keys from documentation, and known-safe patterns are flaggedUse --no-ai to skip this step and get raw scanner output only. This is faster but produces no false-positive filtering or severity adjustment.
When scanning a repository that was cloned with --depth (a shallow clone), secrets present in older git history may not be detected. If the scan finds no secrets and the repository has a .git/shallow file, the command prints a warning:
Note: This is a shallow clone. Secrets in git history may be missed.
For deeper analysis, use a full clone or `dobbe audit report`.
This warning is suppressed in --quiet mode.
dobbe scan secrets
dobbe scan secrets ~/projects/api
dobbe scan secrets --no-ai
dobbe scan secrets --format json --output secrets-report.json
dobbe scan secrets . --quiet --format json --output secrets.json
The scan_secrets function detects which scanner is available on the system (gitleaks or truffleHog) and runs it against the specified path. The scanner name is included in the output so consumers know which tool produced the findings.
Each finding includes:
generic-api-key, aws-access-key)--no-ai)--output.