Supported stores
The reference’s scheme picks the store.Available helpers
resolve_secret— Read a secret from a secret storeis_secret_reference— Check that a string is a supported secret reference
Function reference
resolve_secret
The secret reference. For 1Password, a secret reference:
op://<vault>/<item>/<field>, or op://<vault>/<item>/<section>/<field>, optionally followed by a query such as ?attribute=otp.Python type checkers can’t check a string’s format, so the format is checked when the function runs. SecretReference is exported to document intent in your own signatures.str.
Raises
ValueErrorifreferenceisn’t a supported secret reference.SecretResolveErrorif the Run is traced and nowithout_tracingblock is open.SecretResolveErrorif the secret can’t be read. This happens when the store’s integration isn’t enabled, its credentials are missing or can’t read the item, or the machine running the Run doesn’t answer in time. The message names the reference, never the secret.
For 1Password, every call counts toward your service account’s rate limits. Resolve a secret once per Run and reuse it rather than calling it in a loop.
is_secret_reference
True if value is a supported secret reference.
Related
- 1Password integration: Set up the vault, the service account, and the token.
- Pause tracing: Control what gets recorded around a sensitive step.
- Ephemeral parameters: For a secret that belongs to a single Run.