Ephemeral secrets deployment

When deploying secrets from a third-party secret store to fly.io using fly secrets import, old or renamed secrets remain. Is there any recommended and simple way to clear all secrets before deploying new ones?

A simple fly secrets import --clear-all would be useful.

Related topic: Feature request: update secrets for next deployment

Related: State of fly.io and IaC in 2026

Hi,
for sn in $(fly secrets list --json | jq -r ".[]|.name"); do echo fly secrets unset --stage $sn; done

Let me know if that’s simple enough. Remove the echo to actually do it, this would just print a list of commands to run to unset the secrets.

There’s no built-in platform functionality to do that in one go, though.

Thanks! That’s the naive solution (and it makes it explicit that the API does not support it).

I’d say you can even do it in just two calls:
fly secrets list --json | jq -r ".[]|.name" | xargs echo fly secrets unset --stage (remove the echo).