What It Actually Means
The same application then behaves differently depending on where it is running. On a developer’s machine it connects to a local database; in production it connects to the real one; and the code is identical in both. What changes is the configuration around it.
Why This Exists
Two reasons, and the second is the one that matters commercially.
The same code runs everywhere. No separate versions for testing and live, which removes an entire category of “it worked in testing” problems.
Credentials stay out of the codebase. Database passwords, API keys, payment provider secrets. These must not be written into code, because code goes into a repository, repositories get cloned, shared, and occasionally made public by accident.
Credentials committed into a repository persist in its history even after being removed from the current files, and automated scanners search public repositories for exactly this, continuously, so an exposed key can be found very quickly.
Where They Actually Live
In practice, in a file, usually named .env, sitting on the server and excluded from version control. That works and it has a few well-known failure modes worth asking about.
It is excluded but the exclusion was added late. The file is not in the current version and is still in the history. Removal from the repository is not enough; the credential has to be rotated.
It ends up backed up or copied. Server backups, deployment archives and machine images all pick it up, and those are protected less carefully than the server.
Nobody knows what the values are. The file exists on the server, was configured once, and there is no other record. If the server is lost, so are the settings, and reconstructing them means going to each provider in turn.
It gets shared over chat. Someone needs to run the system locally, the file is pasted into a message, and it remains in that chat history permanently.
What To Ask
- Are any credentials in the code repository, now or in the history? If yes, rotate them rather than only deleting them.
- Where is the authoritative record of production configuration? There should be one, in a password manager or a secrets service, not only on the server.
- Do development and production share any credentials? They should not. A leak from a developer’s machine should not reach live data.
- How do we rotate a credential? If nobody knows which systems use it, it will never be changed, including after somebody leaves.
The Step Up
For a small system, a file on the server with a copy of the values in a password manager is reasonable and is more than most businesses have.
Beyond that, hosting providers and cloud platforms offer secrets management: values stored centrally, encrypted, access controlled and logged, rotated without touching the server. Worth moving to when there are several environments, several people, or anything with a regulatory dimension.
The failure to avoid is the middle state, where credentials exist in several places and nobody is certain which copy is current.
More terms are in the glossary.