Docs menu

Operate

Secret scanning

CLI looks for API keys, wallet keys and passwords in the code it builds, in build and app output, and in plain variables, and tells you what to rotate.

Explain it

A password or API key pasted into code, printed in a log or saved as a plain setting can be read by someone else. CLI checks for them as part of every build and tells you where they are and what to do. It never stores what it found.

How to use it: findings appear at the top of the project page and in your alerts. Each says where the key is and how to replace it. You can run a scan any time from project settings under Leaked secrets.

A key pasted into code, printed in a log or saved as a plain variable is a key someone else can read. CLI checks for them as part of what it already does, and tells you where they are and what to do. It never stores what it found, only where and what kind.

What it checks

WhereWhen
CodeEvery git and GitHub build scans the checked-out files (dependencies and build output are skipped). Uploads with cli up are already refused if they contain secrets.
Build outputAfter each deploy
App outputThe start-up output of each deploy, and the recent logs whenever you scan
VariablesPlain (non-secret) variables whose values look like keys, or whose names end in SECRET, TOKEN, PASSWORD, API_KEY or PRIVATE_KEY

It recognises AWS, Stripe, GitHub, Slack, Google, OpenAI, Anthropic, Resend, Telegram and npm credentials, private key files, database URLs with passwords, and wallet private keys and seed phrases. A 64-character hex value only counts as a wallet key when it's labelled as one, so transaction hashes in your logs aren't flagged.

When something is found

A new finding raises secret_found, and the project page lists open findings under Leaked secrets with what to do:

  1. Rotate the key at its provider. Assume it's been seen. Deleting the line doesn't un-leak it.
  2. Store the new key as a secret variable. CLI hides secret variables' values in logs and the dashboard.
  3. Mark the finding Rotated. If the same secret turns up again, the finding reopens.

Not a secret ignores a false alarm.

API
GET /v1/projects/:id/secret-findings?status=open
POST /v1/projects/:id/secret-scan
PATCH /v1/secret-findings/:id {"status": "resolved"}

Finding a secret never stops a build or deploy. The build log carries a warning line, and the finding stays open until someone deals with it. Agents use cli_secrets.