Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Leaked API Key Response: Rotate, Scrub Git History, Prevent

    1

    Committed an API key or password? Find every leak with gitleaks and TruffleHog, rotate in the right order, check for misuse, scrub history safely, add push protection.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Leaked API Key Response: Rotate, Scrub Git History, Prevent

    Leaked API Key Response: Rotate, Scrub Git History, Prevent

    Example session with this skill installed

    I pushed my .env to a public GitHub repo 2 hours ago. It has a Stripe secret key, an OpenAI key and the Postgres URL for production. I already deleted the file in a new commit. What now?

    • Read your context and instructions
    • Compiled the leaked api key

    Secret leak response — VERDICT: ROTATE NOW

    Exposure: public repo, first pushed today 14:07, no key revoked yet. Deleting the file does not remove it from history. Treat all three as compromised.

    Do these now (in this order)

    Stripe: Dashboard → Developers → API keys → roll the secret key. Put the new key in your host's env vars, redeploy, then let the old key expire immediately.
    2. OpenAI: delete the key in the API keys page, create a new one, update env vars, redeploy.
    3.

    Postgres: create a new DB user with the same grants, switch DATABASE_URL, redeploy, then drop the old user. Restrict DB network access to your app's IPs if it is reachable from the internet.

    Tell me when each is done and I will update the log.

    Incident log

    #CredentialWhere foundVerified live?RotatedOld revokedMisuse check
    1Stripe sk_l…9fQa.env @ a41c9e2yes (TruffleHog)pendingpendingcheck Payments, Payouts, Events since 14:07
    2OpenAI sk-p…Lw2c.env @ a41c9e2yes (TruffleHog)pendingpendingUsage page since 14:07
    3Postgres URL post…/app.env @ a41c9e2unknownpendingpendingconnection logs from unknown IPs
    4Mapbox token pk.e…3kdsrc/map.ts @ 77b02f1 (March)public tokenn/an/alow risk: URL-restrict it

    Scans run

    gitleaks git --redact -v . → 4 findings in 2 commits. trufflehog git file://. --results=verified,unknown → 2 verified, 1 unknown.

    History cleanup (after rotation)

    Recommended because the repo is public. Plan: git-filter-repo --sensitive-data-removal --invert-paths --path .env, force-push with your yes, then ask GitHub Support to purge cached views. Side effects: every commit hash after a41c9e2 changes; collaborators must re-clone.

    Prevention added (ready to commit)

    .gitignore (+ .env*, !.env.example), .env.example, .pre-commit-config.yaml with gitleaks, and turn on Settings → Code security → Push protection.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    A secret pushed to git is usually found by bots within minutes. Deleting the commit does not help: the key still works, and clones, forks, CI logs and cached pull requests keep a copy. What fixes it is revoking the key, and doing the rest in the right order.

    This skill gives your coding agent an incident procedure and a reference file checked against GitHub's "Removing sensitive data" guide and the gitleaks, TruffleHog and git-filter-repo docs. It:

    • Triages fast: what leaked, where, since when, public or private, and what the key can do. The provider's rotation step comes first, before any scanning
    • Scans the full history with gitleaks (git mode, redacted) and TruffleHog (with verification), plus .env files, CI logs and Docker images
    • Groups findings by real credential and builds an incident log: rotated, old key revoked, consumers updated, misuse checked
    • Gives rotation steps and the logs to check for AWS, GCP, Azure, GitHub, Stripe, LLM APIs, Slack, databases and private keys
    • Optionally rewrites history with git filter-repo --sensitive-data-removal, explains every side effect, force-pushes only with your yes, and tells you exactly what to send GitHub Support or GitLab cleanup
    • Adds prevention: .gitignore, .env.example, a gitleaks pre-commit hook, a CI scan, and push protection
    • Returns a verdict: CONTAINED, ROTATE NOW or STILL EXPOSED

    Who it is for: developers who just pushed a key, team leads handling a secret-scanning alert, and anyone cleaning up an old repo before making it public.

    Safety: never prints full secrets (first and last 4 characters only), never revokes keys or touches provider accounts itself, and never force-pushes or rewrites history without an explicit yes.

    Honesty note: a clean scan only means the tools found nothing with their rules. It says what it could not check, such as forks you cannot access or provider logs.

    Cannot access private cloud logs or search engine caches. Scans are limited to tool regex patterns; custom or low-entropy secrets might be missed. Requires manual rotation by the user.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 29 days ago

    Requires

    Git
    gitleaks
    TruffleHog
    git-filter-repo (optional, 2.47+)

    Permissions

    Terminal / Shell
    Read Files
    Network Access
    Listed29 days ago

    What's inside

    Frequently Asked Questions

    Deleting the file in a new commit leaves the secret in history, and the key keeps working. This skill puts revocation first: it gives you the rotation steps for the provider, then scans the full history, checks for misuse, and only then offers an optional history rewrite with git filter-repo. It cannot remove copies in CI logs, forks or caches it has no access to; it lists those so you can request removal.

    An agent that can run shell commands in your repo. gitleaks and TruffleHog are used for scanning and git-filter-repo 2.47+ for the optional history rewrite. If a tool is missing, the agent asks before installing it and notes in the report which scans could not run.

    Partly. TruffleHog verifies many common credential types by calling the provider's API with the found key, and the skill tells you when that happens. Keys TruffleHog cannot verify are reported as unknown, and you should treat them as live until revoked.

    A SKILL.md with the full incident procedure and verdict rules, plus a reference file with gitleaks and TruffleHog commands, rotation steps and logs to check for common providers, the GitHub history-rewrite procedure with its side effects, and pre-commit and CI snippets for prevention.

    While it supports all standard credential formats, custom or low-entropy secrets that don't match known regex patterns may require manual identification, as noted in the limitations.

    No, this skill follows the 'rotate first' industry standard, ensuring credentials are invalidated at the provider level before any history scrubbing begins to prevent exploitation during the cleanup.

    New in Security