inceptyon-labs/tenet-skills/tenet-secrets

Claude Code and agent skill by inceptyon-labs/tenet-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Scans committed files and history for hardcoded tokens, keys, passwords, and private secrets.

Install

npx vskill@latest install inceptyon-labs/tenet-skills/tenet-secrets

SKILL.md

The same SKILL.md was published earlier as inceptyon-labs/tenet-skills/tenet-secrets.

Tenet Secrets

Detects hardcoded secrets, committed credential files, and weak secret generation patterns across the codebase and git history.

Purpose

This skill scans for hardcoded secrets that should never appear in version control. It combines deterministic toolchain output (gitleaks, trufflehog, trivy) with targeted regex scanning for common secret formats. The cardinal rule: any hardcoded production-looking PRIVATE secret is ALWAYS critical severity regardless of context — but publishable-by-design keys (Firebase web config, Stripe pk_, etc.) are NOT secrets and must not be flagged as critical.

How to run this audit — read first

The model running this skill is set by the orchestrator ([models].worker in .healthcheck.toml). Whatever the model, follow these shared protocols:

  • `shared/scan-discipline.md` — grep hygiene (all scans below use git grep, which walks

tracked files safely — never iterate $(git ls-files)), triage, and the worklog.

  • `shared/verification.md` — before emitting a critical, confirm the match is a real

private secret (not a placeholder, fixture, example, or publishable key) and mask its value.

  • `shared/security-calibration.md` — the publishable / private key distinction (see the

"Publishable / public-by-design keys" pairs). Do not flag public keys as critical.

  • `shared/suppressions.md` — honor tenet-ignore comments and [suppressions] config.

Language Support Matrix

yaml
support:
native: [all]
note: "Secrets can appear in any text file. This skill scans all committed files regardless of language."

Toolchain Inputs

FileRequiredNotes
.healthcheck/toolchain/gitleaks.jsonYes (fail if missing)Primary signal — most comprehensive secret detection
.healthcheck/toolchain/trufflehog.jsonNo (secondary signal)Complements gitleaks with entropy-based detection
.healthcheck/toolchain/trivy.jsonNo (secondary signal)Catches secrets in container images and IaC
.healthcheck/toolchain/language-census.jsonYesDetermines repo scope

If `gitleaks.json` is missing, the skill MUST fail with an actionable error:

ERROR: gitleaks.json not found at .healthcheck/toolchain/gitleaks.json
gitleaks is a required tool for the secrets dimension.
Run the toolchain first: /tenet-skills:tenet-toolchain
If gitleaks is not installed: brew install gitleaks (macOS) or see https://github.com/gitleaks/gitleaks#installing

Do NOT proceed with heuristic-only scanning when gitleaks is missing. The false-positive rate without gitleaks is too high to produce reliable scores.

Procedure

Step 1: Validate Required Toolchain
bash
GITLEAKS=".healthcheck/toolchain/gitleaks.json"
if [ ! -f "$GITLEAKS" ]; then
echo "ERROR: gitleaks.json is required for the secrets dimension but was not found."
echo "Ensure tenet-toolchain ran successfully with gitleaks installed."
exit 1
fi
GITLEAKS_FINDINGS=$(jq '.findings // []' "$GITLEAKS")
GITLEAKS_COUNT=$(echo "$GITLEAKS_FINDINGS" | jq 'length')
echo "Loaded $GITLEAKS_COUNT findings from gitleaks"
Step 2: Load Secondary Toolchain Signals
bash
# TruffleHog (optional)
TRUFFLEHOG=".healthcheck/toolchain/trufflehog.json"
if [ -f "$TRUFFLEHOG" ]; then
TRUFFLEHOG_FINDINGS=$(jq '.findings // []' "$TRUFFLEHOG")
echo "Loaded $(echo "$TRUFFLEHOG_FINDINGS" | jq 'length') findings from trufflehog"
else
TRUFFLEHOG_FINDINGS="[]"
echo "INFO: trufflehog.json not found — skipping as secondary signal"
fi
# Trivy (optional — secrets subset)
TRIVY=".healthcheck/toolchain/trivy.json"
if [ -f "$TRIVY" ]; then
TRIVY_SECRETS=$(jq '[.findings[] | select(.category == "secrets")] // []' "$TRIVY" 2>/dev/null || echo "[]")
echo "Loaded $(echo "$TRIVY_SECRETS" | jq 'length') secret findings from trivy"
else
TRIVY_SECRETS="[]"
echo "INFO: trivy.json not found — skipping as secondary signal"
fi
# Language census
CENSUS=".healthcheck/toolchain/language-census.json"
if [ ! -f "$CENSUS" ]; then
echo "ERROR: language-census.json is missing — cannot determine repo scope"
exit 1
fi
Step 3: Ingest Gitleaks Findings

For each gitleaks finding:

  1. Map the gitleaks RuleID to a Tenet finding type (see Rubric below)
  2. Determine severity:
  • All confirmed secrets → critical (this is the cardinal rule)
  • Possible false positives (e.g., example values, placeholder strings, xxx/changeme, obviously synthetic test tokens) → read the surrounding code; if it is not a real secret, drop it (no finding). If it is real, it is critical. There is no in-between severity for "maybe a secret"
  1. Deduplicate: if the same file+line appears in both gitleaks and trufflehog, prefer gitleaks and enrich with trufflehog metadata
  2. Set confidence: "deterministic"
  3. Generate a fix_prompt for each finding
Step 4: Ingest TruffleHog Findings

For each trufflehog finding NOT already covered by gitleaks:

  1. Map to a Tenet finding type
  2. Set severity to critical for confirmed secrets
  3. Set confidence: "deterministic"
  4. Generate a fix_prompt
Step 5: Ingest Trivy Secret Findings

For each trivy secret finding NOT already covered by gitleaks or trufflehog:

  1. Map to a Tenet finding type
  2. Set severity to critical for confirmed secrets
  3. Set confidence: "deterministic"
  4. Generate a fix_prompt
Step 6: Regex Scan for Common Secret Formats

Even with gitleaks, some patterns benefit from explicit scanning. Search all committed files (git ls-files) for:

AWS Keys
bash
# AWS Access Key ID (starts with AKIA)
git grep -nP "AKIA[0-9A-Z]{16}"
# AWS Secret Access Key (40-char base64)
git grep -nP "(aws_secret_access_key|AWS_SECRET_ACCESS_KEY)\s*[:=]\s*['\"]?[A-Za-z0-9/+=]{40}"
GitHub Tokens
bash
# GitHub personal access tokens (classic and fine-grained)
git grep -nP "(ghp_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9_]{82}|gho_[A-Za-z0-9]{36}|ghs_[A-Za-z0-9]{36}|ghr_[A-Za-z0-9]{36})"
Generic API Keys and Tokens
bash
# API keys in assignment or config
git grep -nP "(api[_-]?key|api[_-]?secret|api[_-]?token)\s*[:=]\s*['\"][A-Za-z0-9_\-]{20,}"
# Bearer tokens hardcoded
git grep -nP "Bearer\s+[A-Za-z0-9_\-\.]{20,}"
Database Connection Strings with Passwords
bash
# PostgreSQL / MySQL / MongoDB connection strings
git grep -nP "(postgres|mysql|mongodb)://[^:]+:[^@]+@"
# Redis with password
git grep -nP "redis://:[^@]+@"
Private Keys
bash
# PEM-encoded private keys
git grep -lP -e "-----BEGIN (RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----"
JWT Secrets
bash
# JWT secret in config
git grep -nP "(jwt[_-]?secret|JWT_SECRET|jwt[_-]?key)\s*[:=]\s*['\"][^'\"]{8,}"
Slack/Stripe/SendGrid/Twilio Tokens
bash
# Slack
git grep -nP "xox[baprs]-[A-Za-z0-9\-]{10,}"
# Stripe
git grep -nP "(sk_live|rk_live)_[A-Za-z0-9]{20,}"
# SendGrid
git grep -nP "SG\.[A-Za-z0-9_\-]{22}\.[A-Za-z0-9_\-]{43}"
# Twilio
git grep -nP "SK[0-9a-fA-F]{32}"

For each regex match:

  1. Check if it was already found by gitleaks/trufflehog — skip if so
  2. Verify it is NOT in a test fixture, example, documentation, or placeholder (CHANGEME, xxx, your-key-here, <api-key>, TODO)
  3. Check the file extension — some matches in .md or comment blocks may be examples
  4. Check the publishable-key allowlist (below) — publishable/public keys are safe by

design and must NOT be flagged as critical

  1. Set confidence: "heuristic" for grep-only findings
  2. Severity is critical for anything that looks like a real PRIVATE secret
Publishable / public-by-design keys — do NOT flag as critical

Some keys are meant to ship in client-side code. Flagging them critical every run is a false positive that trains the reader to ignore the report. These are safe (skip, or info at most):

  • Firebase web config — apiKey, authDomain, projectId, etc. (security is in Firebase

rules, not the key)

  • Stripe publishable key — pk_live_… / pk_test_… (flag the SECRET sk_live_…)
  • Supabase `anon` public key (flag the service_role key)
  • **Mapbox pk.…, Google Maps browser key, Sentry public DSN, PostHog/Segment/Amplitude

public write keys**

Still flag the private counterparts as critical: sk_live_…, Supabase service_role, Firebase Admin SDK service-account JSON / private key, any *_SECRET, any *_PRIVATE_KEY. When unsure whether a public-looking key is truly publishable, emit minor with a note to confirm — never critical. See shared/security-calibration.md.

Step 7: Check .gitignore for .env
bash
# Check if .env is gitignored
if ! grep -qE "^\.env$|^\.env\." .gitignore 2>/dev/null; then
echo "WARN: .env not in .gitignore"
fi
# Check if .env files are actually committed
git ls-files | grep -E "^\.env$|^\.env\.|\.env\.local|\.env\.production|\.env\.staging"

If .env files are committed to git:

  • .env with real secrets → critical
  • .env.example or .env.template with placeholder values → info
  • .env.test or .env.development with non-secret values → minor
  • .env.production or .env.staging with any values → critical
  • .env not in .gitignore (even if no .env file committed yet) → major
Step 8: Scan Git History (Conditional)

Only scan git history if the repo is small enough to complete in reasonable time:

bash
# Count total commits
COMMIT_COUNT=$(git rev-list --count HEAD 2>/dev/null || echo "0")
if [ "$COMMIT_COUNT" -lt 500 ]; then
# Scan for secrets that were committed and then removed
# Use gitleaks in git-log mode if available
if command -v gitleaks &>/dev/null; then
gitleaks detect --source=. --log-opts="--all" --report-format=json --report-path=- 2>/dev/null
fi
fi

For secrets found only in git history (not in current HEAD):

  • Severity: critical (secrets in history are still exploitable until rotated)
  • The fix_prompt must include rotation instructions AND history cleanup guidance
Step 9: Detect Weak Secret Generation
bash
# Math.random used for tokens/secrets/IDs
git grep -nP "Math\.random\(\)" -- '*.ts' '*.js' '*.tsx' '*.jsx'
# Python random for tokens
git grep -nP "random\.(choice|randint|random|sample)\(" -- '*.py'
# Go math/rand for tokens
git grep -nP "math/rand" -- '*.go'

For each match:

  1. Check if the random value is used for security purposes (token generation, session IDs, password reset codes, API keys, nonces)
  2. Skip if used for UI, testing, shuffling, or non-security purposes
  3. Severity: major for security-context usage, skip for non-security usage
  4. Set confidence: "heuristic"
Step 10: Verify & Apply Suppressions

Per shared/verification.md, confirm each candidate secret before it enters the report: open the file, confirm it is a real private secret (not a placeholder/fixture/example/publishable key), and mask the value (first 4 chars + ****). Then per shared/suppressions.md, demote any finding matched by a tenet-ignore comment or [suppressions] config to info with the stated reason, and track metrics.suppressed_count. Never suppress silently.

Step 11: Score Calculation

Apply the standard scoring formula from shared/severity.md:

score = 100 - (5 * critical_count + 2 * major_count + 0.5 * minor_count)
score = max(0, min(100, int(score + 0.5))) # Arithmetic rounding, not banker's rounding

Info findings do NOT affect the score.

Note: Because every confirmed hardcoded secret is critical, even a single real secret drops the score by 5 points. Three confirmed secrets puts the score at 85 or lower. This is intentional — secrets in VCS are among the highest-risk findings.

Step 12: Write Report

Write the dimension report to .healthcheck/reports/secrets.json:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/inceptyon-labs/tenet-skills/tenet-secrets/badge)](https://verified-skill.com/skills/inceptyon-labs/tenet-skills/tenet-secrets)

Something wrong with this skill or its page? Tell us.