c/security › command
0votes

Find leaked secrets and rotate them

PromptHigh risk
submitted by CommandVault editors to c/security

Locate exposed keys in a repo and plan a safe rotation.

Prompt · 2 variables
I think a secret may have leaked in {{repo_or_location}}.

Help me:
1. Search strategy: commands to scan the working tree and full git history for keys, tokens and passwords (e.g. gitleaks, trufflehog, git log -p with patterns).
2. Triage: how to tell real secrets from test values.
3. Rotation plan for each provider involved ({{providers}}): create new key, deploy it, revoke old key — in an order that avoids downtime.
4. Clean-up: whether rewriting git history is worth it (it doesn't un-leak a pushed secret).
5. Prevention: pre-commit hook and CI scan config.

Never print a full secret value in your answer.
0 commentsreport

Try it here

Fill in {{repo_or_location}}, {{providers}} above first for a better answer, or run it as is and the AI will assume sensible values.

or open in ChatGPT · Claude · Perplexity

How to use this prompt

  1. Fill in the 2 blanks above. The more specific you are, the better the answer.
  2. Copy it and paste it into ChatGPT, Claude, Gemini, Cursor or Codex, or use "Try it here" for a quick test.
  3. Read the answer critically: check anything it claims about your code or data before you rely on it.
  4. Careful: this one is marked high risk. Review what the AI suggests before you run it on real systems or data.
  • {{repo_or_location}} Repo or location
  • {{providers}} Providers

More from c/security

See all of c/security →
0 comments

Log in to join the discussion.