# Secret scanning: finding keys and passwords committed to your code

[Learn](/learn) › What Bugstack does

# Secret scanning: finding keys and passwords committed to your code

A secret is a key or password that lets your app talk to another service. When one is committed to your repository, anyone who can read the repository can use it. Bugstack scans your repository every night, tells you which secret it found and where, and gives you a checklist for making it safe. It never rotates a secret itself.

## How secrets end up in code

It is rarely carelessness. A key gets pasted into a file to make something work during a late session, and the file gets committed. An AI assistant writes a working example with the real key in it. A config file that was meant to stay local is added by a broad commit.

Once it is in the history, deleting the line does not remove it.

## What Bugstack does

Bugstack does [autonomous software maintenance](/autonomous-software-maintenance). For secrets:

-   **It scans nightly.** Every connected repository, every night.
-   **It reports each finding** on your Security page, with the file and the kind of secret.
-   **It gives you a checklist.** When you approve the rotation step, Bugstack opens a GitHub issue with what to do, in order.
-   **It skips obvious examples.** A key in documentation or a test fixture is not treated as an emergency.

## Why it does not rotate the secret for you

Rotating a secret means creating a new key in the service it belongs to, putting the new key everywhere the old one was used, and then deleting the old one. Done in the wrong order, it takes your app down. Done by a tool with access to your provider accounts, it is a tool with access to your provider accounts.

Bugstack does not hold those credentials and does not ask for them. This is the one job where it deliberately stops at telling you.

## What to do when a secret is found

1.  **Treat it as stolen.** You cannot know who has seen the repository.
2.  **Create a new key** in the service it belongs to.
3.  **Put the new key in your host’s settings,** never back in the code.
4.  **Deploy,** and check the app still works.
5.  **Delete the old key** in the service.
6.  **Remove it from the code.** This is last on purpose. It tidies up; it does not protect you.

## What this scan does not cover

-   Secrets outside the repository, such as in a chat message or a screenshot.
-   Whether your host’s settings are themselves exposed.
-   Secrets in your running app’s logs.

## How to start

1.  Sign in with GitHub and start the 14-day trial. It includes $50 of credit.
2.  Install the Bugstack GitHub App on your repository.

The first scan runs when the repository is connected. No SDK is needed.

## Questions

### I deleted the key from my code. Am I safe?

No. The key is still in the repository’s history, and anyone who copied it still has it. The fix is to make the old key useless by creating a new one and deleting the old one in the service.

### Why will Bugstack not rotate it for me?

Because rotating needs access to your accounts at other companies, and a mistake in the order takes your app down. Bugstack tells you what it found and what to do, and leaves that step to you.

### How often does it scan?

Every night, for every connected repository.

## Related

-   [A security checklist for vibe-coded apps](/learn/vibe-coding-security-checklist)
-   [Automated vulnerability remediation: from an advisory to a patch](/learn/automated-vulnerability-remediation)
-   [An AI security audit that proves what it finds](/learn/ai-security-audit)
-   [What is autonomous software maintenance?](/autonomous-software-maintenance)

## See it work on your own code.

$100 a month

Includes $100 of usage credit every month. Start with a 14-day trial: $50 of credit and a first security audit on us. A card is required.

[Get started](https://dashboard.bugstack.ai/login) [Book 15 minutes with the founder](https://cal.com/mason-bachmann-1atgdq/15min)