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 secret key of a service Kaviris recognises: Supabase service-role
key or
sb_secret_…, Stripesk_…orrk_…, OpenAIsk-proj-…, Anthropicsk-ant-…; - a credential that was verified to work;
- a match by a scanner rule written for one specific provider.
A committed .env file with real values counts too.
The warning starts with a label, our guess to help you:
- Probably real: one of the cases above.
- Unsure: the match only looks like a key (a generic pattern, a token nobody verified). Check that it is not real.
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.
-
Change the code to read the key from the environment, for example
process.env.OPENAI_API_KEYinstead of the literal. -
Declare the slot and set the value by reference:
kaviris secrets set OPENAI_API_KEY --from-env OPENAI_API_KEY --declareFor a committed
.envfile:kaviris secrets import .env --declare, then remove the file from the repository (git rm --cached .env, and add.envto.gitignore). -
Rotate the key with the provider: create a new one and delete the old one. It has been in your source.
-
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.