# What to do when Excellent finds a key or email address

> Read a masked finding, replace a live key at its provider, then clear old copies from agent logs. See what Excellent can do when it finds your email in a script.

Open the finding to see whether Excellent found a key in a log, a secrets file an agent opened or your email sent to a website. For a live API key, use **Replace this key** to open its provider. Replace the key and revoke the old one there before you clear local copies. For an email address in a script, you can ask your own agent to edit the file.

## What Excellent looks for

A scan reads your agents' logs and lists what it found. Four findings are about keys and your email:

| Finding | What it means |
| --- | --- |
| API keys are sitting in your agent logs | A key that looks real was typed into a command, so it is stored in a log. |
| Agents opened keys and secrets files | A command read SSH keys, `.env` files or your keychain. |
| Your email was sent to websites | An agent put your address in a header, a web address or a form post. |
| Your email was typed into web forms | A browser agent typed your address into a form on a website. |

Excellent shows your email as ‹your email› and masks keys in everything it shows you. It keeps a fingerprint of each
key, never the key itself. [What it finds](https://www.excellent.so/docs/what-it-finds) lists the rest.

## Find the keys your agents can read

Keys in logs are one part. Your agents can also read most of what you can: your shell's startup files, your `.env`
files and your tools' settings. The key finder runs by itself after your first scan. Open it from the keys row in the
menu.

For each key, it says:

- what kind it is,
- where it is,
- who can read it,
- and whether it has already reached a model.

[See everything the key finder checks](https://www.excellent.so/docs/keys). A folder your never-open rules close stays closed.

## Replace the key

Clearing a key does not cancel it. A key you removed still works until you cancel it with its provider.

**Replace this key** opens the provider's own key page in your browser: Anthropic, OpenAI, GitHub, GitLab, Slack, AWS,
Google Cloud, Stripe, OpenRouter or xAI. Make the new key there, cancel the old one, then put the new one where your
tools can read it. Excellent never talks to the provider itself.

Do the replacement before the removal, if you can. Then the old key is dead by the time you clean up its traces.

## Clear a key

There are two places a key can sit, and each has its own button.

**In a file.** **Remove…** shows you which lines it will change, then replaces the key with `REMOVED-BY-EXCELLENT`.
There is no backup, because a backup would hold the key. It cannot be undone, so Excellent asks first.

**In a log.** **Remove keys from the logs** on the finding replaces each key in your agents' logs with a marker, in
place. It cannot be undone either, and Excellent asks first.

## Clear your email from scripts

If an agent wrote your address into a script, **Remove it from N files** asks your own agent to take it out, up to three
files at a time. Excellent then reads each file again to check.

Know what that does. Your agent reads the file itself, so what is in it goes to its provider under your account, like
any work you give it. There is no backup of the file, and Excellent asks first, every time.

## Stop it next time

A clean log fills up again if the next session does the same thing. With Pro, Excellent's live check runs before each
action and can stop it.

**With Pro:** the live check needs Excellent Pro. Scanning, findings and the key finder are free.
[Free and Pro](https://www.excellent.so/docs/free-and-pro) says what each does.

With Pro, turn it on with **Protect My Agents** on the welcome screen, or **Turn On** in the menu. Excellent lists what
it will change before it changes anything. Two of the rules it starts with matter here:

- **Never send your email to websites** is blocked.
- **Never type API keys into commands** is blocked.

**Ask before reading keys and .env files** asks you first. When the check blocks or asks, you get a notification, and
the agent gets the reason in plain words so it can find another way.

The check reads what a command says. An agent set on getting around it sometimes can. For the files and folders that
matter most, the [sandbox](https://www.excellent.so/docs/sandbox) holds however a command is written. [Turn on protection](https://www.excellent.so/docs/turn-on-protection)
says what the check changes and how to take it back out.

## A short routine

1. Scan, and open the key finder.
2. Replace the keys it lists, one at a time, at their providers.
3. Clear the old ones from your files and logs.
4. With Pro, turn protection on, so new keys do not land in a log.
5. Scan again next week.

You can also [check for API keys by hand](https://www.excellent.so/research/your-agent-logs-keep-your-keys) without printing them, or [run the free scan](https://www.excellent.so/#scan) without installing the app. The [simulated sample report](https://www.excellent.so/r/sample) shows what a finding looks like in that scan.

Source: https://www.excellent.so/guides/keep-keys-and-email-out-of-agent-logs
