Security rotate leak

From Clear-Capabilities/agentic-security · View interactive version

Security rotate leak is an AI agent skill from the GitHub repository Clear-Capabilities/agentic-security. Rotate a leaked secret end-to-end. Activate on leaked API key, exposed credential, or pushed-secret reports.

How to use this skill

Skill file

Skill — rotate a leaked secret

Activates when the user has discovered (or you've discovered) that a

production credential is in the repo, the chat, or git history. The

clock is running — every hour the value sits exposed is another hour an

attacker has to find it.

When to fire

history" / "is this secret bad?"

What to do — sequenced, do not skip steps

  1. DO NOT print the leaked value back. Mask it to first-4 + last-4

chars in any output. The chat transcript itself becomes part of the

blast radius.

  1. Detect the provider from the prefix:
  1. Print the EXACT revoke URL for that provider's console. Don't

paraphrase — copy from this canonical list:

| Provider | Revoke at |

|---|---|

| OpenAI | https://platform.openai.com/api-keys |

| Anthropic | https://console.anthropic.com/settings/keys |

| GitHub PAT | https://github.com/settings/tokens |

| Slack | https://api.slack.com/apps → your app → OAuth & Permissions → Revoke |

| AWS access key | https://console.aws.amazon.com/iam/home#/security_credentials |

| Google API key | https://console.cloud.google.com/apis/credentials |

| Supabase service-role | https://supabase.com/dashboard/project/_/settings/api |

| GCP service account | https://console.cloud.google.com/iam-admin/serviceaccounts |

| Stripe | https://dashboard.stripe.com/apikeys |

  1. Estimate blast radius BEFORE the rotation, not after:

in the last 24h BEFORE rotating.

audit_log table for anomalous reads since the value first appeared.

  1. Run the active rotation if the user agrees:

/fix --rotate-secret --auto. This is the only command that touches the

provider's API for you. Without --auto, surface the manual steps

and stop.

  1. Add --scrub-history if the value is in git history. Rewrites

history via git filter-repo or BFG. Note: irreversible, requires

force-push to a shared branch — do NOT run without explicit user

confirmation.

  1. Propose the next step: /fix --vault to migrate the rest of

the project's env-var surface to a real secrets manager so this

doesn't happen again.

Don't

irreversible and breaks every clone of the repo.

into .env or push it via the deployment platform's CLI.

Canonical commands

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.