Netlify Build Failed: Secrets Scanning Detected Secrets

Share
Workaround available Web, CLI Updated November 13, 2026Based on 2 user reportsHow we research

Quick answer

Netlify can fail a build when a secret value appears in the output or deployed files. Remove the secret from the bundle, or omit specific keys via SECRETS_SCAN_OMIT_KEYS.

Most likely fix: Stop embedding private values

How to fix it

Try these in order — the most common fix is first.

  1. 1. Stop embedding private values

    1. Move secrets to server-side code or Netlify functions
    Did this fix it?
  2. 2. Omit known-safe keys

    1. Set SECRETS_SCAN_OMIT_KEYS=KEY1,KEY2 in environment variables
    2. Use SECRETS_SCAN_OMIT_PATHS for files
    Did this fix it?
  3. 3. Check the log

    1. Read which key and file were flagged and rotate the key if it truly leaked
    Did this fix it?

Symptoms

The build fails with a message that secrets scanning found secret values in the build output.

Why it happens

  • A private env var gets bundled into client code
  • Public keys (such as publishable keys) flagged as secrets
  • Env values printed in logs

This guide also covers

  • netlify secrets scanning failed build
  • netlify exposed secrets detected

Still not working?

If Netlify keeps failing, you're not alone. See every Netlify problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

The same problem in other apps

All export, render & quality loss guides →

Other Netlify errors

All 10 Netlify errors and fixes →