# Credential masking

> Keep tokens, private keys and passwords found in your code out of search, file reads and Corfedo AI.

Source: https://docs.corfedo.ai/workspace/privacy/credential-masking/

Corfedo masks credentials it finds in your code before it indexes a repository. Search, file reads, MCP clients, the API, the SDKs and Corfedo AI see the masked text. Masking is on for every new workspace.

## What is masked

| Found in code | What you see |
| --- | --- |
| A token in a known vendor format, such as `ghp_…`, `AKIA…` or `xoxb-…` | The prefix, then `*` for the rest, for example `ghp_************************************` |
| A password in a URL, such as `postgres://app:s3cr3t-pass@db.example.com/orders` | `postgres://app:***********@db.example.com/orders` |
| The body of a private key after `-----BEGIN … PRIVATE KEY-----` | Each body line as `*` |

A masked value keeps its length, so line and column numbers stay the same. Values that are evidently made up, such as `AKIAIOSFODNN7EXAMPLE` or `${DB_PASS}` in a URL, stay visible. A masked value cannot be recovered from Corfedo. Read the file in your code host when you need it.

## Turn masking off or on

### Change the setting

Open **Settings** › **Privacy** and use the **Mask credentials in indexed code** switch. Turning it off asks you to confirm.

### Wait for the repositories to update

Corfedo indexes each repository again at the same commit. Repositories keep their earlier index until they are updated. The **Updating repositories** line under the switch counts the repositories done, waiting, failed and paused.

**Check:** the **Updating repositories** line disappears once every repository is updated.

After you turn masking back on, credentials stay visible in a repository until it is updated.

## Require masking for every workspace

Whoever runs Corfedo can require masking for the whole installation, see [Platform settings](https://docs.corfedo.ai/operate/settings/). The switch then shows on and cannot be changed. A workspace that had turned masking off has its repositories indexed again.

## Troubleshooting

| What you see | Why | What to do |
| --- | --- | --- |
| A credential is still visible after you turned masking on | Its repository is not updated yet | Wait until **Updating repositories** no longer counts it |
| **Your installation requires this.** under the switch | The installation requires masking | Ask whoever runs Corfedo |
| **Updating repositories** counts failed repositories | Indexing them again failed | Select the count to open **Repositories** and read the failure |
| **Updating repositories** counts repositories as paused | Indexing is off for them, they have no working source connection, or they are too large for this installation | Turn indexing on or fix the source connection in **Settings** › **Repositories**. For a repository that is too large, ask whoever runs Corfedo. |
| A credential in a tool result from your own editor or agent | Results of tools that run on your side are not masked | Remove the credential from what your tool returns |
