Skip to main content


The @secrets decorator allows you to access secrets, such as database credentials, securely from a secrets manager. For more details, see Accessing Secrets.



from metaflow import secrets

Specifies secrets to be retrieved and injected as environment variables prior to the execution of a step.


sources: List[Union[str, Dict[str, Any]]], default: []

List of secret specs, defining how the secrets are to be retrieved