envguard

Pre-commit secret detection — block leaked credentials, API keys, and .env files before they hit git

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "envguard" with this command: npx skills add suhteevah/envguard

EnvGuard — Pre-Commit Secret Detection

EnvGuard scans your code for leaked secrets, credentials, API keys, and .env file contents before they reach git. It uses regex-based pattern matching against 50+ secret formats from 20+ services, lefthook for git hook integration, and produces SARIF-compatible reports for compliance workflows.

Commands

Free Tier (No license required)

envguard scan [file|directory]

One-shot secret scan of files or directories.

How to execute:

bash "<SKILL_DIR>/scripts/envguard.sh" scan [target]

What it does:

  1. Accepts a file path or directory (defaults to current directory)
  2. Finds all text files (excluding .git/, node_modules/, dist/, build/, vendor/, pycache)
  3. Runs 50+ secret detection patterns against each file
  4. Respects .envguardignore exclusions (gitignore syntax)
  5. Outputs findings with: file, line number, pattern matched, severity, redacted match
  6. Exit code 0 if clean, exit code 1 if critical/high findings detected

Example usage scenarios:

  • "Scan this repo for leaked secrets" -> runs envguard scan .
  • "Check this file for API keys" -> runs envguard scan src/config.ts
  • "Are there any secrets in my source code?" -> runs envguard scan src/

Pro Tier ($19/user/month -- requires ENVGUARD_LICENSE_KEY)

envguard hooks install

Install git pre-commit hooks that scan staged files for secrets before every commit.

How to execute:

bash "<SKILL_DIR>/scripts/envguard.sh" hooks install

What it does:

  1. Validates Pro+ license
  2. Copies lefthook config to project root
  3. Installs lefthook pre-commit hook
  4. On every commit: scans all staged files for secrets, blocks commit if secrets found, shows remediation advice

envguard hooks uninstall

Remove EnvGuard git hooks.

bash "<SKILL_DIR>/scripts/envguard.sh" hooks uninstall

envguard allowlist [add|remove|list] [pattern]

Manage false positive patterns. Allowlisted patterns are skipped during scanning.

bash "<SKILL_DIR>/scripts/envguard.sh" allowlist add "EXAMPLE_API_KEY_FOR_TESTS"
bash "<SKILL_DIR>/scripts/envguard.sh" allowlist remove "EXAMPLE_API_KEY_FOR_TESTS"
bash "<SKILL_DIR>/scripts/envguard.sh" allowlist list

What it does:

  1. Validates Pro+ license
  2. Reads/writes allowlist in ~/.openclaw/openclaw.json (envguard.config.allowlist)
  3. Allowlisted patterns are treated as known-safe and skipped during scans

envguard diff

Scan only staged changes (git diff --cached) for secrets.

bash "<SKILL_DIR>/scripts/envguard.sh" diff

What it does:

  1. Validates Pro+ license
  2. Gets staged changes via git diff --cached
  3. Scans only added/modified lines for secrets
  4. Ideal for pre-commit checks on large repos

Team Tier ($39/user/month -- requires ENVGUARD_LICENSE_KEY with team tier)

envguard history [directory]

Full git history scan -- finds secrets in all previous commits.

bash "<SKILL_DIR>/scripts/envguard.sh" history [directory]

What it does:

  1. Validates Team+ license
  2. Walks entire git log using git log -p
  3. Scans every diff for secrets across all commits
  4. Reports: commit hash, author, date, file, line, pattern matched
  5. Critical for onboarding repos that may have had secrets committed in the past

envguard report [directory]

Generate a SARIF-compatible or markdown compliance report.

bash "<SKILL_DIR>/scripts/envguard.sh" report [directory]

What it does:

  1. Validates Team+ license
  2. Runs full scan of the directory
  3. Generates a formatted markdown report with severity breakdown
  4. Includes remediation steps for each finding category
  5. Output suitable for compliance audits and security reviews

envguard policy [directory]

Custom secret patterns and enforcement rules.

bash "<SKILL_DIR>/scripts/envguard.sh" policy [directory]

What it does:

  1. Validates Team+ license
  2. Loads custom patterns from ~/.openclaw/openclaw.json (envguard.config.customPatterns)
  3. Enforces organization-specific secret rules (e.g., internal token formats)
  4. Combines custom patterns with built-in patterns for comprehensive scanning

Detected Secret Types

EnvGuard detects 50+ secret patterns across 20+ services:

CategoryExamplesSeverity
AWS CredentialsAKIA* keys, aws_secret_access_keyCritical
Stripe Keyssk_live_, sk_test_, rk_live_, whsec_Critical
GitHub Tokensghp_, gho_, ghu_, ghs_, ghr_*Critical
GitLab Tokensglpat-*Critical
Private KeysRSA, OPENSSH, DSA, EC, PGP private keysCritical
Slack Tokensxoxb-, xoxp-, xoxo-, xapp-High
Google API KeysAIza*High
JWT TokenseyJ* (long base64 tokens)High
Database URIspostgres://, mysql://, mongodb://, redis://High
Twilio KeysSK* account SIDsHigh
SendGrid KeysSG.*High
Firebase/SupabaseAPI keys and service tokensHigh
npm Tokensnpm_*High
Heroku API KeysHeroku token patternsMedium
DigitalOceandop_v1_, doo_v1_Medium
Azure KeysAzure subscription/account keysMedium
CloudflareAPI tokens and keysMedium
Docker HubDocker auth tokensMedium
Mailgun/PostmarkAPI keysMedium
Generic Secretsapi_key=, password=, secret=, token=Low
.env LeaksKEY=value patterns in source filesLow

Configuration

Users can configure EnvGuard in ~/.openclaw/openclaw.json:

{
  "skills": {
    "entries": {
      "envguard": {
        "enabled": true,
        "apiKey": "YOUR_LICENSE_KEY_HERE",
        "config": {
          "severityThreshold": "high",
          "allowlist": [],
          "customPatterns": [],
          "excludePatterns": ["**/node_modules/**", "**/dist/**", "**/.git/**"],
          "reportFormat": "markdown"
        }
      }
    }
  }
}

Important Notes

  • Free tier works immediately with no configuration
  • All scanning happens locally -- no code or secrets are sent to external servers
  • License validation is offline -- no phone-home or network calls
  • Supports .envguardignore files (gitignore syntax) to exclude paths
  • Matches are always redacted in output (first/last 4 chars only)
  • Git hooks use lefthook which must be installed (see install metadata above)
  • Exit codes: 0 = clean, 1 = findings detected (for CI/CD integration)

Error Handling

  • If lefthook is not installed and user tries hooks install, prompt to install it
  • If license key is invalid or expired, show clear message with link to https://envguard.pages.dev/renew
  • If a file is binary, skip it automatically with no warning
  • If .envguardignore is malformed, warn and continue with default excludes
  • If no files found in target, report clean scan with info message

When to Use EnvGuard

The user might say things like:

  • "Scan for leaked secrets"
  • "Check if any API keys are in my code"
  • "Set up secret scanning on my commits"
  • "Are there any credentials in this repo?"
  • "Generate a security report for compliance"
  • "Scan git history for leaked passwords"
  • "Block secrets from being committed"
  • "Check my staged files for secrets"
  • "Add a false positive to the allowlist"

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated