How secure are Replit environment variables and Secrets?

Replit's Secrets tool encrypts values so you need not put them in code. But team members without the Owner role can still read secrets by printing environment variables.1
How does Replit store and supply Secrets?
Replit Secrets use AES-256 encryption for stored data and TLS while data moves. When you add a secret, the tool makes it an environment variable for your project.1
Use Secrets to supply values to your code, rather than write them into it. This helps reduce the risk of leaking secrets kept in your code.1
Can team members read secrets hidden from view?
Replit Secrets let you share secret values with teammates and other collaborators. Members of an organization without the Owner role cannot view secret values directly.1
Replit documents a way for those organization members to access the secret values. They can read those values by printing the project's environment variables instead.1
Do editor Secrets update your live app?
Replit keeps secrets for development and production in two distinct stores. The editor's Secrets pane serves development; your live app reads deployment secrets instead. Changing one store does not change the values in the other.2
To change a live app's value, first set it in deployment secrets. Then open Publishing and select Publish to push the change live again.2
Do not expect a change made only in the editor to reach your live app. Check the live app's own secret store, not just the editor's Secrets pane.2
Can frontend builds or Static Deployments keep tokens private?
Replit says to treat anything shipped to a user's device as public. Its external access token rules say not to put tokens in browser, mobile, or desktop apps.3
Keep those tokens out of client-side code, which is code sent to users' devices.3 Replit also says never to copy production credentials into frontend code or a public code repository.4
Replit Secrets work with all deployment types except the type called Static Deployments. If your app needs Secrets, choose a type that supports them instead.1
What steps should you take after database secrets leak?
1. Remove leaked values from shared material, as Replit's database guidance directs. For a supported production database, that guidance also calls for regenerating its credentials.4
2. Read the rules for who can use credential renewal and the warning about service breaks first. For a supported production database, use the Database tool to create new credentials. Contact Support if that action is not available in the tool.4
3. Give external clients the new connection string so they have the new credentials. Do not delete the database to replace its old credentials with new ones.4
4. Set the changed value in deployment secrets for your live app. Then open Publishing and select Publish to push the new value live.2
5. Keep the development store separate in your review.
The development Secrets pane is available only in the editor, according to Replit. Changing deployment secrets does not update the values held in that development store.2
Sources
Is your app secure? Run a free security scan in 30 seconds · free account required.
Scan your app free →