Amber Matz
If you’re already using Custom Environment Variables in Tugboat, it’s a good idea to rotate and recreate environment variables containing sensitive information like API keys with “Encrypt this value at rest” turned on, a feature available since May 29, 2026.
Encrypting your custom environment variables at rest keeps sensitive values out of dashboards, logs, and exports. The option to encrypt a value at rest is available only when you create a new custom environment variable in the repository settings. It can’t be turned on for existing custom environment variables containing sensitive data. It’s best practice to use fresh rotated values for sensitive data stored in custom environment variables in Tugboat.
Secrets can leak in ordinary ways: a key in a demo screenshot, a value in a build log, an API response with credentials pasted into a ticket, or a former team member with access to Tugboat. You might not ever know if it was exposed.
Rotation addresses that uncertainty. You generate a new credential, switch your systems to it, and revoke the old one. Even if the old value leaked months ago and you never found out, everything from the rotation forward is safe.
We’re strongly encouraging our customers to rotate their keys now and use the “encrypt this value at rest” feature to create new custom environment variables that contain sensitive data in their Tugboat previews.
When you add a custom environment variable containing sensitive data, check the "Encrypt this value at rest" option before saving. After that:
Run this on your most sensitive credentials:
Two setup details to note:
Scope: Each variable is scoped to Build-time, Run-time, or both. Build-time values are available during Preview builds, when dependencies are installed and build commands run. Run-time values are available to the running site and its services. Match the scope to when your code actually needs the value, and set both if it's used in both phases or you aren't sure. Pick the wrong one, and the value simply won't be there when your code tries to access it.
Editing: Encrypted variables are immutable by design. Sealing the stored value is the whole point, so there's no Edit control on them. You don't edit an encrypted variable; you replace it. Delete the old one and add it again with the new value, name, or scope.
Encryption at rest protects the stored value, not the running one. Anyone with Terminal access to a Preview container can still read it, because your app needs it in plaintext to work. So, it’s also a good idea to review who has access to your Tugboat project.
Pick your highest-risk credential — a production database password, a payment API key, or a token with admin scope — and rotate it now. New value, saved encrypted, old one revoked. Then put a recurring reminder on the calendar for the rest.
Tell us about your project, schedule a demo, or consult with a Tugboat Technical Account Executive.