Credentials need more than a variable name
Database passwords, access tokens, and private keys grant access to systems or data. Secret management defines where those values live, who can read or change them, and how an application receives them.
A setting such as MAIL_TIMEOUT_SECONDS=15 is ordinary configuration. The credential for the mail provider needs protection. Putting either value in an environment variable does not tell you whether it is stored safely.
Deleting a key does not revoke it
A key committed as plain text can remain in Git history and existing copies of the repository. Logs, chats, and diagnostic output can expose credentials too. Removing the visible line does not remove access for someone who already has the value.
Replacing an exposed key means creating a new one, updating the affected application, and revoking the old one at the provider. Check the function that depends on it, such as sending a test email. If someone is actively abusing the key, immediate revocation may be necessary even if it temporarily interrupts the service.
Give each environment the access it needs
A local test does not need credentials for the production database. Use separate credentials for each environment and limit their permissions to the functions they require. Keep track of who can replace a credential and which services use it. Those decisions, and checking that a replacement works, remain your team’s responsibility.
How MainPath separates secrets from custom settings
MainPath manages credentials including database passwords, JWT secrets, and registry credentials. They are stored in generated.yaml in the gitops-configuration repository, encrypted with SOPS. Encrypted values in Git are different from passwords committed as plain text. The documented editing command is mp secrets edit <file>.
MainPath maintains the generated files. Your own configuration belongs in env/*.custom.env or, for deployments, in custom.yaml under additional_env_variables. Those files are unencrypted, so they are not a place for passwords or keys that need protection. New generated values require a change to MainPath configuration.
The environment variables documentation explains these boundaries for local development and deployment. Even when troubleshooting, keep complete env files out of logs and chats.