Portal

secret_in_source

Severity: warn. A secret key or credential may be written into your code. The deploy goes on.

What Kaviris saw

One of these, in a file of your source:

A committed .env file with real values counts too.

The warning starts with a label, our guess to help you:

Kaviris never blocks a deploy for a secret and cannot tell which are real. Your app's secrets are your responsibility; see secret_scan.

Why it matters

Anyone with your source, or with the built app, can use the key, and source travels: to GitHub, to collaborators, to AI tools. Secrets belong in the app's secret slots, where nobody can read them back.

How to fix it

For a probably real one, the warning names the slot: the variable the key was assigned to, or the usual name for that service.

  1. Change the code to read the key from the environment, for example process.env.OPENAI_API_KEY instead of the literal.

  2. Declare the slot and set the value by reference:

    kaviris secrets set OPENAI_API_KEY --from-env OPENAI_API_KEY --declare
    

    For a committed .env file: kaviris secrets import .env --declare, then remove the file from the repository (git rm --cached .env, and add .env to .gitignore).

  3. Rotate the key with the provider: create a new one and delete the old one. It has been in your source.

  4. Deploy again.

Agents: the warning's fix holds the slot, the command to run, and the patch that declares the slot. Apply the patch (update_contract, approve_contract), run the command or call set_secret without a value, and change the code.

See Secrets.

All refusal codes

This page as Markdown