getaura 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +25 -2
  2. package/dist/index.js +24230 -0
  3. package/dist/index.js.map +1 -0
  4. package/package.json +50 -4
  5. package/templates/README.md +94 -0
  6. package/templates/configs/env-example-header.txt +6 -0
  7. package/templates/configs/eslint.config.mjs +12 -0
  8. package/templates/configs/example.test.ts +21 -0
  9. package/templates/configs/husky-pre-commit +16 -0
  10. package/templates/configs/prettierignore +18 -0
  11. package/templates/configs/prettierrc.json +3 -0
  12. package/templates/configs/security-headers.md +41 -0
  13. package/templates/configs/vitest.config.ts +19 -0
  14. package/templates/docs/index.md +55 -0
  15. package/templates/github/dependabot.yml +25 -0
  16. package/templates/github/workflows/aura-weekly.yml +55 -0
  17. package/templates/github/workflows/aura.yml +90 -0
  18. package/templates/github/workflows/ci.yml +86 -0
  19. package/templates/guides/add-aura-key-to-github.md +34 -0
  20. package/templates/guides/github-security.md +63 -0
  21. package/templates/guides/install-github-cli.md +50 -0
  22. package/templates/guides/rotate-anthropic-key.md +33 -0
  23. package/templates/guides/rotate-aws-key.md +39 -0
  24. package/templates/guides/rotate-database-key.md +39 -0
  25. package/templates/guides/rotate-generic-key.md +37 -0
  26. package/templates/guides/rotate-github-token.md +36 -0
  27. package/templates/guides/rotate-google-key.md +45 -0
  28. package/templates/guides/rotate-openai-key.md +33 -0
  29. package/templates/guides/rotate-resend-key.md +32 -0
  30. package/templates/guides/rotate-sendgrid-key.md +32 -0
  31. package/templates/guides/rotate-slack-key.md +48 -0
  32. package/templates/guides/rotate-stripe-key.md +41 -0
  33. package/templates/guides/rotate-supabase-key.md +46 -0
  34. package/templates/guides/rotate-vercel-key.md +44 -0
  35. package/templates/guides/transfer-ownership.md +55 -0
  36. package/templates/pr/add-agent-rules.md +16 -0
  37. package/templates/pr/add-aura-workflow.md +18 -0
  38. package/templates/pr/add-brief.md +17 -0
  39. package/templates/pr/add-ci.md +16 -0
  40. package/templates/pr/add-env-example.md +18 -0
  41. package/templates/pr/add-linting.md +16 -0
  42. package/templates/pr/add-pre-commit.md +16 -0
  43. package/templates/pr/add-readme.md +16 -0
  44. package/templates/pr/add-security-headers.md +16 -0
  45. package/templates/pr/enable-dependency-updates.md +16 -0
  46. package/templates/pr/fix-vulnerable-deps.md +19 -0
  47. package/templates/pr/foundation.md +19 -0
  48. package/templates/pr/install-skills.md +18 -0
  49. package/templates/pr/move-misplaced-files.md +18 -0
  50. package/templates/pr/remove-dead-files.md +18 -0
  51. package/templates/pr/setup-testing.md +19 -0
  52. package/templates/pr/token-efficiency.md +18 -0
  53. package/templates/readme/README.md +73 -0
  54. package/templates/rules/agent-rules.md +43 -0
  55. package/templates/skills/aura/SKILL.md +76 -0
  56. package/templates/skills/database-migrations/SKILL.md +92 -0
  57. package/templates/skills/docs-and-readme/SKILL.md +40 -0
  58. package/templates/skills/error-handling/SKILL.md +79 -0
  59. package/templates/skills/folder-structure/SKILL.md +51 -0
  60. package/templates/skills/pre-launch-checklist/SKILL.md +60 -0
  61. package/templates/skills/secrets-and-env/SKILL.md +52 -0
  62. package/templates/skills/secure-api-routes/SKILL.md +92 -0
  63. package/templates/skills/writing-tests/SKILL.md +77 -0
@@ -0,0 +1,63 @@
1
+ ---
2
+ title: Secure your GitHub repository
3
+ summary: Turn on branch protection, secret scanning, Dependabot and private vulnerability reporting for your repository.
4
+ services: [github]
5
+ ---
6
+
7
+ # Secure your GitHub repository
8
+
9
+ These settings stop broken or unsafe code from reaching `main`, catch secrets before they're pushed, and warn you about vulnerable packages. They take about ten minutes. You need admin access to the repository.
10
+
11
+ Some features on private repositories need a paid GitHub plan. Where that applies, it's noted below.
12
+
13
+ ## 1. Protect the main branch
14
+
15
+ Every change to `main` should go through a pull request with passing checks.
16
+
17
+ 1. Open the repository → **Settings → Rules → Rulesets**.
18
+ 2. Click **New ruleset → New branch ruleset**. Name it `Protect main`.
19
+ 3. Set **Enforcement status** to **Active**.
20
+ 4. Under **Target branches**, click **Add target → Include default branch**.
21
+ 5. Turn on:
22
+ - **Restrict deletions**
23
+ - **Require a pull request before merging** (set required approvals to 0 if you work alone, so you can still merge your own PRs)
24
+ - **Require status checks to pass**, then **Add checks** and pick your CI checks (for example `Lint, test, build` and `Aura score`). They appear after they've run once.
25
+ - **Block force pushes**
26
+ 6. Click **Create**.
27
+
28
+ Rulesets on private repositories need GitHub Pro, Team or Enterprise. On the free plan they only work on public repositories.
29
+
30
+ ## 2. Secret scanning and push protection
31
+
32
+ Push protection blocks a push that contains a known secret, before it reaches GitHub.
33
+
34
+ 1. Open **Settings → Advanced Security** (called **Code security** on some accounts).
35
+ 2. Under **Secret Protection**, click **Enable** for **Secret scanning** and **Push protection**.
36
+
37
+ These are free on public repositories. Private repositories need GitHub Secret Protection (paid). The Aura pre-commit hook (`aura apply add-pre-commit`) gives similar protection on your own machine for free.
38
+
39
+ ## 3. Dependabot
40
+
41
+ 1. On the same **Advanced Security** page, under **Dependabot**, enable **Dependabot alerts** and **Dependabot security updates**.
42
+ 2. For regular version updates, merge the pull request from `aura apply enable-dependency-updates`.
43
+
44
+ These are free on all repositories.
45
+
46
+ ## 4. Private vulnerability reporting
47
+
48
+ Lets security researchers report problems privately instead of in a public issue.
49
+
50
+ 1. On the **Advanced Security** page, enable **Private vulnerability reporting**.
51
+
52
+ Available on public repositories.
53
+
54
+ ## 5. Your account
55
+
56
+ - Turn on two-factor authentication: profile picture → **Settings → Password and authentication**. Use an authenticator app or a passkey, and save your recovery codes in a password manager.
57
+ - Review who has access: repository **Settings → Collaborators and teams**. Remove anyone who no longer needs it.
58
+
59
+ ## Check it worked
60
+
61
+ - Try pushing directly to `main` (`git push origin main` with a small change). GitHub rejects it.
62
+ - **Settings → Advanced Security** shows secret scanning, push protection, Dependabot alerts and security updates as enabled (where your plan allows).
63
+ - Run `aura scan`; the GitHub settings findings are gone.
@@ -0,0 +1,50 @@
1
+ ---
2
+ title: Install the GitHub CLI
3
+ summary: Install the gh command and sign in, so Aura and your coding agent can open pull requests for you.
4
+ services: [github]
5
+ ---
6
+
7
+ # Install the GitHub CLI
8
+
9
+ Aura opens pull requests with the GitHub CLI (`gh`). You install it once per computer.
10
+
11
+ ## Install
12
+
13
+ **Mac**: install Homebrew from https://brew.sh if you don't have it, then in Terminal run:
14
+
15
+ ```bash
16
+ brew install gh
17
+ ```
18
+
19
+ **Windows**: in PowerShell or Windows Terminal, run:
20
+
21
+ ```bash
22
+ winget install --id GitHub.cli
23
+ ```
24
+
25
+ Then close and reopen the terminal.
26
+
27
+ **Linux**: follow the instructions for your distribution at https://github.com/cli/cli/blob/trunk/docs/install_linux.md.
28
+
29
+ ## Sign in
30
+
31
+ 1. Run:
32
+ ```bash
33
+ gh auth login
34
+ ```
35
+ 2. Answer the questions:
36
+ - Where do you use GitHub? **GitHub.com**
37
+ - Preferred protocol for Git operations? **HTTPS**
38
+ - Authenticate Git with your GitHub credentials? **Yes**
39
+ - How would you like to authenticate? **Login with a web browser**
40
+ 3. Copy the one-time code shown, press Enter, paste the code in the browser that opens, and approve.
41
+
42
+ ## Check it worked
43
+
44
+ Run:
45
+
46
+ ```bash
47
+ gh auth status
48
+ ```
49
+
50
+ It shows "Logged in to github.com" with your username. Then run `aura scan` again.
@@ -0,0 +1,33 @@
1
+ ---
2
+ title: Rotate an Anthropic key
3
+ summary: Replace a leaked Anthropic (Claude API) key so nobody else can run up usage on your account.
4
+ services: [anthropic, vercel]
5
+ ---
6
+
7
+ # Rotate an Anthropic key
8
+
9
+ A leaked Anthropic key (`sk-ant-...`) lets anyone use the Claude API on your bill.
10
+
11
+ ## Steps
12
+
13
+ 1. Sign in to the Claude Console at https://console.anthropic.com (it may redirect to platform.claude.com) and open **Settings → API keys**.
14
+ 2. Click **Create key**, pick the right workspace, name it (for example `production-2026`), and copy it. It's only shown once.
15
+ 3. Update your app with the new key, usually `ANTHROPIC_API_KEY` (see "Update your app").
16
+ 4. Back in **API keys**, click the **⋯** menu next to the leaked key and **Delete** it (or **Disable** it first if you want to be able to undo).
17
+
18
+ ## Update your app
19
+
20
+ 1. In Vercel, open your project → **Settings → Environment Variables**, edit the variable, paste the new key, and save for every environment.
21
+ 2. Redeploy: **Deployments**, **⋯** on the latest production deployment, **Redeploy**.
22
+ 3. Update your local `.env.local`.
23
+ 4. Update any other place that used the key.
24
+
25
+ ## Check it worked
26
+
27
+ - The old key is deleted or shows as disabled.
28
+ - Use the AI feature in your live app. It works.
29
+ - Check **Usage** and **Cost** for unusual activity while the key was exposed. Set spend limits under **Settings → Limits**.
30
+
31
+ ## About git history
32
+
33
+ Once the key is deleted, it's useless, so it doesn't matter that it's still in your git history. Rewriting history is optional, risky, and not needed.
@@ -0,0 +1,39 @@
1
+ ---
2
+ title: Rotate an AWS access key
3
+ summary: Replace a leaked AWS access key, delete the old one and check your account for misuse.
4
+ services: [aws, vercel]
5
+ ---
6
+
7
+ # Rotate an AWS access key
8
+
9
+ A leaked AWS access key (`AKIA...`) can let someone start expensive servers in your account, often within minutes, or read your files. Act now.
10
+
11
+ ## Steps
12
+
13
+ 1. Sign in to the AWS console and open **IAM → Users**. Click the user the key belongs to, then the **Security credentials** tab.
14
+ 2. Under **Access keys**, click **Create access key**, pick the use case, and copy the new key and secret. The secret is only shown once.
15
+ 3. Update your app with the new key (see "Update your app"), usually `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
16
+ 4. Back under **Access keys**, find the leaked key. Choose **Actions → Deactivate**, check the app still works, then **Actions → Delete**.
17
+ 5. Give the user only the permissions the app needs (for example access to one S3 bucket), not administrator access.
18
+
19
+ ## Check for misuse
20
+
21
+ 1. Open **Billing and Cost Management** and look for unexpected charges.
22
+ 2. Check **EC2** in every region (use the region menu at the top) for servers you didn't start, and delete them.
23
+ 3. Open **CloudTrail → Event history** and filter by the leaked access key ID to see what it did.
24
+ 4. If AWS emailed you about an exposed key or attached a quarantine policy to the user, follow the steps in that email and open a support case if you find misuse.
25
+
26
+ ## Update your app
27
+
28
+ 1. In Vercel, open your project → **Settings → Environment Variables**, update both values, and save for every environment. Then **Deployments → ⋯ → Redeploy** on the latest production deployment.
29
+ 2. Update your local `.env.local` and any GitHub Actions secrets.
30
+
31
+ ## Check it worked
32
+
33
+ - The leaked key is deleted from the user's access keys.
34
+ - The feature that uses AWS (uploads, email, etc.) works in your live app.
35
+ - No unexpected resources or charges remain.
36
+
37
+ ## About git history
38
+
39
+ Once the key is deleted, it's useless, so it doesn't matter that it's still in your git history. Rewriting history is optional, risky, and not needed.
@@ -0,0 +1,39 @@
1
+ ---
2
+ title: Rotate a database password
3
+ summary: Reset a leaked database password or connection string so the old one stops working.
4
+ services: [supabase, vercel]
5
+ ---
6
+
7
+ # Rotate a database password
8
+
9
+ A database connection string (`postgresql://user:password@host/...`) or database password gives direct access to your data, bypassing every security rule in your app. Reset it now.
10
+
11
+ ## Supabase database
12
+
13
+ 1. Open https://supabase.com/dashboard, pick the project, then **Project Settings → Database**.
14
+ 2. Click **Reset database password**. Generate a strong password and copy it.
15
+ 3. Click **Connect** at the top of the project page to copy the new connection strings (they include the new password).
16
+ 4. Update your app (see below), usually `DATABASE_URL`, `POSTGRES_URL` or `SUPABASE_DB_URL`.
17
+
18
+ Resetting the password doesn't affect your Supabase API keys or signed-in users. Only tools that connect directly to the database need the new password.
19
+
20
+ ## Other Postgres providers
21
+
22
+ - **Neon**: open the project → **Branches**, pick the branch → **Roles**, then **Reset password** for the role. Copy the new connection string from **Connect**.
23
+ - **Any other provider**: find the database user or role in its dashboard and reset the password, or create a new user, switch the app to it, then delete the old one.
24
+
25
+ ## Update your app
26
+
27
+ 1. In Vercel, open your project → **Settings → Environment Variables**, update every variable that holds the connection string or password, and save for every environment. If a Vercel integration manages these variables, check they updated.
28
+ 2. Redeploy: **Deployments**, **⋯** on the latest production deployment, **Redeploy**.
29
+ 3. Update your local `.env.local`, GitHub Actions secrets, and any other tool that connects to the database (admin tools, scripts, backups).
30
+
31
+ ## Check it worked
32
+
33
+ - The old connection string no longer connects.
34
+ - Your live app reads and writes data normally.
35
+ - If your provider has database logs, check for connections you don't recognize while the password was exposed.
36
+
37
+ ## About git history
38
+
39
+ Once the password is reset, the old one is useless, so it doesn't matter that it's still in your git history. Rewriting history is optional, risky, and not needed.
@@ -0,0 +1,37 @@
1
+ ---
2
+ title: Rotate a secret
3
+ summary: The general steps to replace any leaked key, token or password and switch off the old one.
4
+ services: [vercel]
5
+ ---
6
+
7
+ # Rotate a secret
8
+
9
+ Use this for any key, token or password that doesn't have its own guide. Rotating means creating a new secret, switching your app to it, and switching off the old one so whoever has it can't use it.
10
+
11
+ ## Steps
12
+
13
+ 1. **Find where it came from.** The variable name or the start of the value usually names the service (for example `TWILIO_...`). Sign in to that service's dashboard.
14
+ 2. **Find its keys page.** Look under **Settings**, **Developers**, **API keys**, **Tokens** or **Credentials**.
15
+ 3. **Create a new key.** Give it a clear name and only the permissions your app needs. Copy it; most services only show it once.
16
+ 4. **Update your app** (see below) and confirm it works with the new key.
17
+ 5. **Delete or revoke the old key** in the same dashboard. If the service only lets you "regenerate" a key, doing that replaces the old one in one step; update your app right after.
18
+ 6. **Check for misuse.** Look at the service's usage, billing and logs for activity you don't recognize while the key was exposed.
19
+
20
+ For a private key (`-----BEGIN PRIVATE KEY-----`), generate a new key pair where it's used (a server, a signing service, an SSH host), install the new public key, and remove the old one.
21
+
22
+ ## Update your app
23
+
24
+ 1. In Vercel, open your project → **Settings → Environment Variables**, update the variable, and save for every environment.
25
+ 2. Redeploy: **Deployments**, **⋯** on the latest production deployment, **Redeploy**. New values only apply to new deployments.
26
+ 3. Update your local `.env.local`.
27
+ 4. Update any other place that stores the secret: GitHub Actions secrets, other services, teammates' machines.
28
+
29
+ ## Check it worked
30
+
31
+ - The old key no longer appears in the service's dashboard, or shows as revoked.
32
+ - The feature that uses it works in your live app.
33
+ - Run `aura scan` to confirm Aura no longer finds the secret in your code.
34
+
35
+ ## About git history
36
+
37
+ Once the secret is rotated, the old one is useless, so it doesn't matter that it's still in your git history. Rewriting history to remove it is optional, risky (it can break other people's copies of the repo), and not needed.
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: Rotate a GitHub token
3
+ summary: Revoke a leaked GitHub personal access token and replace it with a new, narrowly scoped one.
4
+ services: [github, vercel]
5
+ ---
6
+
7
+ # Rotate a GitHub token
8
+
9
+ A leaked GitHub token (`ghp_...`, `github_pat_...`, `gho_...`) can let someone read or change your code, depending on its permissions. Revoke it now.
10
+
11
+ ## Steps
12
+
13
+ 1. On GitHub, click your profile picture → **Settings → Developer settings → Personal access tokens** (direct link: https://github.com/settings/tokens).
14
+ 2. Find the leaked token under **Fine-grained tokens** or **Tokens (classic)**. Click it and choose **Delete** (fine-grained) or **Delete** next to it (classic). It stops working immediately.
15
+ 3. If your app or a workflow needs a token, click **Generate new token → Fine-grained token**. Choose only the repositories it needs, only the permissions it needs, and an expiration date. Copy it; it's only shown once.
16
+ 4. Update the places that used the old token (see "Update your app").
17
+
18
+ If the token belonged to a GitHub App or OAuth app instead, open **Developer settings → GitHub Apps** (or **OAuth Apps**), pick the app, and generate a new private key or client secret, then delete the old one.
19
+
20
+ Inside GitHub Actions, prefer the built-in `GITHUB_TOKEN` over a personal token. It's created for each run and expires automatically.
21
+
22
+ ## Update your app
23
+
24
+ 1. In Vercel, open your project → **Settings → Environment Variables**, update the variable (often `GITHUB_TOKEN`), and save for every environment. Then **Deployments → ⋯ → Redeploy** on the latest production deployment.
25
+ 2. Update repository secrets in GitHub: **Settings → Secrets and variables → Actions**.
26
+ 3. Update your local `.env.local`.
27
+
28
+ ## Check it worked
29
+
30
+ - The old token is gone from the list.
31
+ - Check the security log (**Settings → Security log**) and your repositories for actions you don't recognize while the token was exposed.
32
+ - Whatever used the token (deploys, scripts) still works with the new one.
33
+
34
+ ## About git history
35
+
36
+ Once the token is deleted, it's useless, so it doesn't matter that it's still in your git history. Rewriting history is optional, risky, and not needed.
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: Rotate a Google API key
3
+ summary: Replace a leaked Google Cloud or Gemini API key, or service account key, and restrict the new one.
4
+ services: [google, vercel]
5
+ ---
6
+
7
+ # Rotate a Google API key
8
+
9
+ Google API keys start with `AIza`. Some are meant to be public (Firebase web config, Maps in the browser) and only need restricting. Keys for paid APIs such as Gemini, or service account JSON keys, must stay secret and need rotating if leaked.
10
+
11
+ ## Gemini API key (Google AI Studio)
12
+
13
+ 1. Open https://aistudio.google.com/apikey.
14
+ 2. Click **Create API key**, pick the same Google Cloud project, and copy it.
15
+ 3. Update your app (see "Update your app"), usually `GEMINI_API_KEY` or `GOOGLE_GENERATIVE_AI_API_KEY`.
16
+ 4. Delete the leaked key from the same page. If there's no delete option, open the project in the Google Cloud console, go to **APIs & Services → Credentials**, and delete it there.
17
+
18
+ ## Google Cloud API key
19
+
20
+ 1. Open https://console.cloud.google.com, pick the project, then **APIs & Services → Credentials**.
21
+ 2. Click **Create credentials → API key** and copy the new key.
22
+ 3. Click the new key and add restrictions: under **API restrictions**, allow only the APIs your app uses. For keys used in the browser, add **Website restrictions** with your domain.
23
+ 4. Update your app (see below).
24
+ 5. Back in **Credentials**, delete the leaked key.
25
+
26
+ ## Service account key (JSON file)
27
+
28
+ 1. In the Cloud console, open **IAM & Admin → Service Accounts**, click the account, then the **Keys** tab.
29
+ 2. Click **Add key → Create new key → JSON**. The file downloads. Store its contents as an environment variable, never in the repo.
30
+ 3. Update your app (see below), then delete the leaked key from the same **Keys** tab.
31
+
32
+ ## Update your app
33
+
34
+ 1. In Vercel, open your project → **Settings → Environment Variables**, update the variable, and save for every environment. Then **Deployments → ⋯ → Redeploy** on the latest production deployment.
35
+ 2. Update your local `.env.local` and any GitHub Actions secrets.
36
+
37
+ ## Check it worked
38
+
39
+ - The leaked key is gone from **Credentials** or **Keys**.
40
+ - The feature that uses Google works in your live app.
41
+ - Check **Billing** for unexpected usage while the key was exposed, and set a budget alert under **Billing → Budgets & alerts**.
42
+
43
+ ## About git history
44
+
45
+ Once the key is deleted, it's useless, so it doesn't matter that it's still in your git history. Rewriting history is optional, risky, and not needed.
@@ -0,0 +1,33 @@
1
+ ---
2
+ title: Rotate an OpenAI key
3
+ summary: Replace a leaked OpenAI API key so nobody else can run up usage on your account.
4
+ services: [openai, vercel]
5
+ ---
6
+
7
+ # Rotate an OpenAI key
8
+
9
+ A leaked OpenAI key lets anyone use the API on your bill. Leaked keys are often abused within minutes.
10
+
11
+ ## Steps
12
+
13
+ 1. Sign in at https://platform.openai.com and open **API keys** (direct link: https://platform.openai.com/api-keys). If you use projects, pick the right project at the top first.
14
+ 2. Click **Create new secret key**. Name it (for example `production-2026`), choose the same project, and set permissions as narrow as your app allows. Copy the key; it's only shown once.
15
+ 3. Update your app with the new key, usually `OPENAI_API_KEY` (see "Update your app").
16
+ 4. Back in **API keys**, find the leaked key and click the trash icon to **Revoke** it.
17
+
18
+ ## Update your app
19
+
20
+ 1. In Vercel, open your project → **Settings → Environment Variables**, edit the variable, paste the new key, and save for every environment.
21
+ 2. Redeploy: **Deployments**, **⋯** on the latest production deployment, **Redeploy**.
22
+ 3. Update your local `.env.local`.
23
+ 4. Update any other place that used the key (GitHub Actions secrets, other services).
24
+
25
+ ## Check it worked
26
+
27
+ - The old key no longer appears in the list.
28
+ - Use the AI feature in your live app. It works.
29
+ - Open **Usage** and look for unusual spikes while the key was exposed. Set a monthly budget under **Settings → Limits** if you haven't.
30
+
31
+ ## About git history
32
+
33
+ Once the key is revoked, it's useless, so it doesn't matter that it's still in your git history. Rewriting history is optional, risky, and not needed.
@@ -0,0 +1,32 @@
1
+ ---
2
+ title: Rotate a Resend key
3
+ summary: Replace a leaked Resend API key so nobody can send email from your domain.
4
+ services: [resend, vercel]
5
+ ---
6
+
7
+ # Rotate a Resend key
8
+
9
+ A leaked Resend key (`re_...`) lets someone send email that looks like it comes from your domain, which can hurt your reputation and get your emails marked as spam.
10
+
11
+ ## Steps
12
+
13
+ 1. Sign in at https://resend.com and open **API Keys** (direct link: https://resend.com/api-keys).
14
+ 2. Click **Create API Key**. Give it a name, choose **Sending access** (not full access) and, if you can, limit it to your sending domain. Copy the key; it's only shown once.
15
+ 3. Update your app (see "Update your app"), usually `RESEND_API_KEY`.
16
+ 4. Back in **API Keys**, click the **⋯** menu next to the leaked key and remove it.
17
+
18
+ ## Update your app
19
+
20
+ 1. In Vercel, open your project → **Settings → Environment Variables**, update the variable, and save for every environment.
21
+ 2. Redeploy: **Deployments**, **⋯** on the latest production deployment, **Redeploy**.
22
+ 3. Update your local `.env.local`. If Supabase sends auth emails through Resend SMTP, update the password in Supabase too (**Authentication → Emails → SMTP Settings**).
23
+
24
+ ## Check it worked
25
+
26
+ - The leaked key is gone from the list.
27
+ - Trigger an email from your live app (for example a password reset). It arrives.
28
+ - Check **Emails** and **Logs** in Resend for messages you didn't send while the key was exposed.
29
+
30
+ ## About git history
31
+
32
+ Once the key is removed, it's useless, so it doesn't matter that it's still in your git history. Rewriting history is optional, risky, and not needed.
@@ -0,0 +1,32 @@
1
+ ---
2
+ title: Rotate a SendGrid key
3
+ summary: Replace a leaked SendGrid API key so nobody can send email from your account.
4
+ services: [sendgrid, vercel]
5
+ ---
6
+
7
+ # Rotate a SendGrid key
8
+
9
+ A leaked SendGrid key (`SG.` followed by a long value) lets someone send email from your account, which can get it suspended and your domain marked as spam.
10
+
11
+ ## Steps
12
+
13
+ 1. Sign in at https://app.sendgrid.com and open **Settings → API Keys**.
14
+ 2. Click **Create API Key**. Choose **Restricted Access** and turn on only **Mail Send** (plus anything else your app really uses). Copy the key; it's only shown once.
15
+ 3. Update your app (see "Update your app"), usually `SENDGRID_API_KEY`.
16
+ 4. Back in **API Keys**, click the gear or **⋯** menu next to the leaked key and **Delete** it.
17
+
18
+ ## Update your app
19
+
20
+ 1. In Vercel, open your project → **Settings → Environment Variables**, update the variable, and save for every environment.
21
+ 2. Redeploy: **Deployments**, **⋯** on the latest production deployment, **Redeploy**.
22
+ 3. Update your local `.env.local`, and the SMTP password anywhere else that uses this key.
23
+
24
+ ## Check it worked
25
+
26
+ - The leaked key is gone from the list.
27
+ - Trigger an email from your live app. It arrives.
28
+ - Check **Activity** for emails you didn't send while the key was exposed.
29
+
30
+ ## About git history
31
+
32
+ Once the key is deleted, it's useless, so it doesn't matter that it's still in your git history. Rewriting history is optional, risky, and not needed.
@@ -0,0 +1,48 @@
1
+ ---
2
+ title: Rotate a Slack token or webhook
3
+ summary: Revoke a leaked Slack bot token, signing secret or incoming webhook URL and replace it.
4
+ services: [slack, vercel]
5
+ ---
6
+
7
+ # Rotate a Slack token or webhook
8
+
9
+ Slack secrets come in a few kinds. Find which one leaked:
10
+ - **Bot or user token** (`xoxb-...`, `xoxp-...`): can read and post messages as your app.
11
+ - **Incoming webhook URL** (`https://hooks.slack.com/services/...`): can post messages to a channel.
12
+ - **Signing secret**: lets someone fake requests from Slack to your app.
13
+
14
+ All of them are managed at https://api.slack.com/apps. Pick your app first.
15
+
16
+ ## Bot or user token
17
+
18
+ 1. Open **OAuth & Permissions**. If you see a **Revoke** option for tokens, use it. Otherwise ask your coding agent to call Slack's `auth.revoke` method with the leaked token; that switches it off immediately.
19
+ 2. Click **Reinstall to Workspace** (on **OAuth & Permissions** or **Install App**) and approve. Slack issues a new token.
20
+ 3. Copy the new token and update your app (see below), usually `SLACK_BOT_TOKEN`.
21
+
22
+ ## Incoming webhook URL
23
+
24
+ 1. Open **Incoming Webhooks**.
25
+ 2. Click **Add New Webhook to Workspace**, pick the same channel, and copy the new URL.
26
+ 3. Update your app (see below), usually `SLACK_WEBHOOK_URL`.
27
+ 4. Back on **Incoming Webhooks**, remove the leaked webhook from the list.
28
+
29
+ ## Signing secret
30
+
31
+ 1. Open **Basic Information → App Credentials**.
32
+ 2. Next to **Signing Secret**, click **Regenerate** and copy the new value.
33
+ 3. Update your app (see below), usually `SLACK_SIGNING_SECRET`.
34
+
35
+ ## Update your app
36
+
37
+ 1. In Vercel, open your project → **Settings → Environment Variables**, update the variable, and save for every environment.
38
+ 2. Redeploy: **Deployments**, **⋯** on the latest production deployment, **Redeploy**.
39
+ 3. Update your local `.env.local`.
40
+
41
+ ## Check it worked
42
+
43
+ - The Slack feature in your live app works with the new value.
44
+ - Check the channel for messages you didn't send while the secret was exposed.
45
+
46
+ ## About git history
47
+
48
+ Once the secret is revoked, it's useless, so it doesn't matter that it's still in your git history. Rewriting history is optional, risky, and not needed.
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: Rotate a Stripe key
3
+ summary: Replace a leaked Stripe secret, restricted or webhook key with a new one and switch off the old one.
4
+ services: [stripe, vercel]
5
+ ---
6
+
7
+ # Rotate a Stripe key
8
+
9
+ A leaked Stripe secret key (`sk_live_...`) lets someone create charges, issue refunds and read your customers' data. Rotate it now, even if you've already deleted it from the code.
10
+
11
+ ## Secret or restricted key (`sk_...` or `rk_...`)
12
+
13
+ 1. Sign in at https://dashboard.stripe.com and open **Developers → API keys** (direct link: https://dashboard.stripe.com/apikeys).
14
+ 2. Check the mode: use the **Test mode** switch to match the leaked key. `sk_live_` is live mode, `sk_test_` is test mode.
15
+ 3. Find the leaked key. Click the **⋯** menu next to it and choose **Rotate key** (called **Roll key** on some accounts).
16
+ 4. Set the expiration to **Now** so the old key stops working immediately. If you can't update your app within minutes, pick 1 hour instead.
17
+ 5. Click **Rotate API key**, then copy the new key. Stripe only shows it once.
18
+ 6. Update the key everywhere it's used (see "Update your app" below), usually `STRIPE_SECRET_KEY`.
19
+
20
+ ## Webhook signing secret (`whsec_...`)
21
+
22
+ 1. Open **Developers → Webhooks** (https://dashboard.stripe.com/webhooks) and click the endpoint.
23
+ 2. Click **⋯ → Roll secret**, choose to expire the old one **Now**, and copy the new secret.
24
+ 3. Update `STRIPE_WEBHOOK_SECRET` (see below).
25
+
26
+ ## Update your app
27
+
28
+ 1. In Vercel, open your project → **Settings → Environment Variables**. Edit the variable, paste the new value, and save for every environment that used the old key.
29
+ 2. Redeploy: **Deployments**, click **⋯** on the latest production deployment, then **Redeploy**. New values only apply to new deployments.
30
+ 3. Update your local `.env.local` with the new value.
31
+ 4. If the key is also stored in GitHub Actions secrets or another service, update it there too.
32
+
33
+ ## Check it worked
34
+
35
+ - In Stripe, the old key shows as expired or is gone from the list.
36
+ - In your live app, try a payment flow (or a test payment in test mode). It works with the new key.
37
+ - In **Developers → Logs** (or **Workbench → Logs**), look for requests from IP addresses you don't recognize during the time the key was exposed. If you see any, contact Stripe support.
38
+
39
+ ## About git history
40
+
41
+ Once the key is rotated, the old key is useless, so it doesn't matter that it's still in your git history. Rewriting history to remove it is optional, risky (it can break other people's copies of the repo), and not needed.
@@ -0,0 +1,46 @@
1
+ ---
2
+ title: Rotate a Supabase key
3
+ summary: Replace a leaked Supabase secret or service_role key so the old one can no longer bypass your database security.
4
+ services: [supabase, vercel]
5
+ ---
6
+
7
+ # Rotate a Supabase key
8
+
9
+ Supabase secret keys (`sb_secret_...`) and the legacy `service_role` key bypass row level security. Anyone who has one can read, change and delete everything in your database. Rotate a leaked one now.
10
+
11
+ The publishable key (`sb_publishable_...`) and legacy `anon` key are meant to be public. They don't need rotating, as long as every table has row level security.
12
+
13
+ ## If the leaked key starts with `sb_secret_`
14
+
15
+ 1. Open https://supabase.com/dashboard, pick the project, then **Project Settings → API Keys**.
16
+ 2. In **Secret keys**, click **New secret key**, give it a name (for example `production-2026`), and copy it.
17
+ 3. Update your app with the new key (see "Update your app" below). Wait for the redeploy to finish.
18
+ 4. Back in **Secret keys**, click **⋯** next to the leaked key and **Delete** it. It stops working immediately.
19
+
20
+ ## If the leaked key is the legacy `service_role` key (a long `eyJ...` value)
21
+
22
+ The legacy key can't be rotated on its own. The safest path is to switch to the new keys and turn the legacy ones off:
23
+
24
+ 1. In **Project Settings → API Keys**, create a publishable key and a secret key if they don't exist yet.
25
+ 2. Ask your coding agent to replace the legacy keys in the app: the publishable key replaces the `anon` key, the secret key replaces the `service_role` key. The Supabase client libraries accept them as drop-in replacements.
26
+ 3. Update your app's environment variables (see below) and redeploy. Check the app still works.
27
+ 4. Back in **Project Settings → API Keys**, open **Legacy API Keys** and click **Disable JWT-based API keys**. The leaked `service_role` key and the old `anon` key stop working.
28
+
29
+ Alternative: rotating the project's legacy JWT secret (**Project Settings → JWT Keys**) also invalidates both legacy keys, but it signs out every user and changes the `anon` key too. Prefer the steps above.
30
+
31
+ ## Update your app
32
+
33
+ 1. In Vercel, open your project → **Settings → Environment Variables**. Update the variable that held the key (often `SUPABASE_SECRET_KEY` or `SUPABASE_SERVICE_ROLE_KEY`, and `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY` or `NEXT_PUBLIC_SUPABASE_ANON_KEY` if you switched keys). Save for every environment.
34
+ 2. Redeploy: **Deployments**, **⋯** on the latest production deployment, **Redeploy**.
35
+ 3. Update your local `.env.local`.
36
+ 4. If GitHub Actions or another service uses the key, update it there too.
37
+
38
+ ## Check it worked
39
+
40
+ - The leaked key is deleted, or legacy keys show as disabled.
41
+ - Sign in to your live app and use a feature that reads and writes data. It works.
42
+ - In **Logs** (API logs), look for unexpected requests during the time the key was exposed. If data may have been accessed, tell your coding agent so it can help you check what was touched.
43
+
44
+ ## About git history
45
+
46
+ Once the key is rotated, the old key is useless, so it doesn't matter that it's still in your git history. Rewriting history is optional, risky, and not needed.
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: Rotate a Vercel key or token
3
+ summary: Replace a leaked Vercel AI Gateway key or Vercel access token and delete the old one.
4
+ services: [vercel]
5
+ ---
6
+
7
+ # Rotate a Vercel key or token
8
+
9
+ There are two kinds of Vercel secret:
10
+ - **AI Gateway API keys** (`vck_...`) let someone use AI models on your Vercel bill.
11
+ - **Access tokens** let someone deploy, change settings and read environment variables in your Vercel account. These are the more dangerous ones.
12
+
13
+ ## AI Gateway API key
14
+
15
+ 1. In the Vercel dashboard, open **AI Gateway** in the sidebar, then **API Keys**.
16
+ 2. Click **Create key**, name it, and copy it.
17
+ 3. Update your app (see "Update your app"), usually `AI_GATEWAY_API_KEY`.
18
+ 4. Back in **API Keys**, delete the leaked key.
19
+
20
+ Apps deployed on Vercel can use AI Gateway without a stored key: Vercel provides a short-lived OIDC token automatically. Ask your coding agent whether your app can drop the key entirely. You'll still need a key for local development (or run `vercel env pull` to get a temporary token).
21
+
22
+ ## Access token
23
+
24
+ 1. Open **Account Settings → Tokens** (direct link: https://vercel.com/account/settings/tokens).
25
+ 2. Find the leaked token and click **Delete**. It stops working immediately.
26
+ 3. If something needs a token (for example a deploy script), click **Create Token**, limit its scope to one team, set an expiration, and copy it.
27
+ 4. Update the places that used the old token, such as GitHub Actions secrets (`VERCEL_TOKEN`).
28
+ 5. Check **Team Settings → Activity** (or your account's activity log) for deployments or changes you don't recognize, and review environment variables: a leaked token could have been used to read them. If so, rotate those secrets too.
29
+
30
+ ## Update your app
31
+
32
+ 1. In your Vercel project → **Settings → Environment Variables**, update the variable and save for every environment.
33
+ 2. Redeploy: **Deployments**, **⋯** on the latest production deployment, **Redeploy**.
34
+ 3. Update your local `.env.local`.
35
+
36
+ ## Check it worked
37
+
38
+ - The leaked key or token no longer appears in the list.
39
+ - The AI feature (or deploy script) works with the new one.
40
+ - Check AI Gateway usage for unusual spend while the key was exposed.
41
+
42
+ ## About git history
43
+
44
+ Once the key or token is deleted, it's useless, so it doesn't matter that it's still in your git history. Rewriting history is optional, risky, and not needed.