Nicholas Pini
07/23/2026, 9:25 AMMarvin
07/23/2026, 9:26 AMMarvin
07/23/2026, 9:26 AMbash
prefect block inspect <block-type-slug>/<block-name>
For a secret block, that would look like:
bash
prefect block inspect secret/my-secret
A couple important notes:
- This is the CLI command available in Prefect 3.x for viewing configured block details.
- For Secret blocks, Prefect typically redacts/masks the secret value rather than printing the raw secret in plain text.
If your goal is to retrieve the actual secret value, the usual pattern is to load it in Python instead:
python
from prefect.blocks.system import Secret
secret = Secret.load("my-secret").get()
print(secret)
CLI help:
- `prefect block`: available subcommands include inspect, ls, etc.
- prefect block inspect --help confirms the syntax: prefect block inspect [SLUG]
Docs:
- Prefect docs
If you want, I can also show you how to list secret blocks first, or how to read one from a deployment/flow runtime context.