Skip to main content

What a credential can do

Read-write credentials can read and write data. Read-only credentials can only read. Deployment credentials can’t create or change tables. For schema changes, see Migrations. Unkey never gives a deployment credential an admin role: No deployment credential inherits the postgres admin role or gets the Vitess admin role.

Lifecycle

Every deployment gets its own credential for each connection of its environment, so deleting one never breaks another deployment.
Disconnecting an environment deletes the credentials of its running deployments right away. Deploy a version of your app that doesn’t need the database before you disconnect. Older deployments you might roll back to lose their credentials too.

Pull requests from forks

Deployments built from a fork, or from a pull request opened from a fork, get no database credentials, because their code isn’t trusted with your database.

What Unkey stores

How secrets are encrypted

Unkey encrypts every secret before it’s written, with the same Vault service that protects environment variables. OAuth tokens use a key per workspace. Connection URLs use a key per environment, the same key the runtime uses to decrypt the environment variables of your instances. Connection URLs are not in your environment variables list, and the dashboard and the API never return them. Your app reads them at run time, and your build can read them like any other variable, through build-time secrets.

Who can see what

  • Unkey writes a new credential’s password straight into that deployment’s encrypted snapshot, and nowhere else.
  • Deployment credentials are named unkey-, then the deployment ID in lowercase with _ replaced by -, then a random suffix. For example, deployment d_4Kx9… gets a credential named like unkey-d-4kx9…-1a2b3c4d5e6f. This way you can find them in the PlanetScale console.
  • Unkey records every PlanetScale change in your workspace audit log, including each deployment credential it creates or deletes.
Last modified on November 27, 2026