Retrieve ML Workbench secrets¶
This feature is available in PyCelonis 2.18.x and later.
In an interactive ML Workbench, you can create a secret in the current Workbench's settings when the secrets feature is enabled for your team. Name it database_password for the example below, or replace that name in the code with a secret you already created there. Secrets are scoped to a Workbench: you can retrieve only secrets created for the current Workbench, not secrets from another Workbench.
Names contain 1–64 ASCII letters, digits, underscores (_), or hyphens (-).
from pycelonis import get_celonis
celonis = get_celonis()
secret = celonis.workbench_secrets.get_secret("database_password")
password = secret.reveal() # Plain string for a library that needs the password.
WorkbenchSecret masks direct display, but it is not encrypted. .reveal() returns plaintext; string operations, serialization, and third-party libraries can also expose the value. Do not log or persist plaintext secrets.