Why not Slack, email or the repo?
- Git remembers forever. A secret committed once stays in the history, even after you delete the file. Public repos are scanned by bots within minutes.
- Chat is searchable. Everyone in the channel, and everyone who joins later, can search for
DATABASE_URL. - Attachments get forwarded and backed up. A
.envattachment lives on in sent items, inboxes and backups.
Good habits
- Give each developer their own keys where the service allows it, so you can revoke one person without breaking everyone else.
- Use test or development credentials for local work, never production ones.
- Rotate after someone leaves the project.
- Keep a
.env.examplein the repo with the variable names but no values, so people know what to ask for.
Larger teams
For a team that changes often, a secrets manager is the long-term answer. temp.cool is the quick, safe way to get the first set of values to someone today. See also sharing API keys with a contractor.