Guides

Integrations

Rotate keys through OpenAI, Cloudflare and AWS, and push them to Vercel and Workers.

A secret can have a provider, the service that issues its keys, and any number of targets, the places its value is deployed. With both set, one rotation asks the provider for a new key, makes it live in every linked environment and pushes it to your deploys.

dotsafe calls these services from your Mac, with admin tokens you give it. The tokens are stored in the vault, encrypted like everything else. Set it all up in Settings → Integrations, or with the CLI below.

Supported services

ServiceNameWhat dotsafe does
OpenAIopenaiCreates and revokes keys for a project
Cloudflare API tokenscloudflare_tokenRolls a token's value
AWS IAMaws_iamCreates and deletes a user's access keys
AnthropicanthropicChecks a key you made in the console, then switches the old one off
StripestripeChecks a key you made in the dashboard; you revoke the old one there
VercelvercelTarget: sets the variable on a project
Cloudflare Workerscloudflare_workersTarget: sets a Worker secret

Connect

dotsafe connect openai --set project_id=proj_…   # asks for the admin tokendotsafe connect vercel --name webdotsafe connections                              # what's connecteddotsafe reconnect web                            # give a connection a new tokendotsafe disconnect web

Set a provider and targets

dotsafe secret provider OPENAI_API_KEY --connection OpenAIdotsafe secret target add OPENAI_API_KEY --connection web --set project=my-appdotsafe secret push OPENAI_API_KEY        # push the current value to every target now

Rotate

dotsafe secret rotate OPENAI_API_KEY      # new key from OpenAI, live everywhere, pushed to Verceldotsafe secret retire OPENAI_API_KEY      # revoke the old key at OpenAI

Each rotation happens in an order that never leaves you without a working key:

  1. The new key is saved to the vault first.
  2. dotsafe checks that it works.
  3. It goes live in every linked environment and is pushed to each target.
  4. Where the provider allows it, the old key keeps working until you retire it, or is revoked at once with --leaked.

Anthropic and Stripe

Their keys can only be made in their own console. dotsafe secret rotate shows the steps, asks for the new key (or reads it with --stdin), checks it, makes it live and pushes it.