Secrets and assets
Keep the logins, keys, and shared data your robots read by name out of the package, in the workspace.
Audience: builders and admins
Task Engine is in private preview. To get access, contact us (opens in a new tab).
Secrets and assets work as Vault and Asset Storage did in Control Room. A robot reads them by name with the same calls, so a robot that worked there reads the same names here. Both belong to the workspace: every robot in it reads them, and a robot in another workspace reads that workspace's values under the same names.
Changing secrets and assets needs builder or admin access. Members never see a saved secret value.
Secrets
Secrets are logins and keys your robots read by name while they run. Values stay hidden once saved.
Add the secret
Open Task Engine, then Secrets, and add a secret.
Name it as the robot reads it
Use letters, numbers, and underscores only. Robots look the secret up by this exact name, and names are case sensitive.
Enter its items
A secret holds one or more rows of a key and a value, such as username and password.
A value with line breaks, such as a private key, keeps them.
Add a description and an expiry date, if you like
A secret with an expiry date shows Expiring soon as the date nears, so someone renews it in time.
A robot reads it as one map of items:
from robocorp import vault
login = vault.get_secret("erp_login")
password = login["password"]With RPA.Robocorp.Vault, use Get Secret, as before.
- Edit a secret to change its description, its expiry date, or its values. A new value is optional: leave it empty to keep the current one.
- A robot can write a secret, for example to store a refreshed token. If a robot changed the value after you opened it for editing, your save is refused, so you never overwrite a newer value without seeing it.
- A value a robot stored as plain text, not as rows, isn't shown as rows. A robot reads and replaces it.
Let your AI tool set the secret up, and enter the value yourself. An AI tool connected to the workspace can create a secret with the item names your robot reads, all empty, and give you a link. You enter the values in Sema4.ai. They never pass through a conversation.
Assets
Assets are shared data your robots read by name, such as lookup tables or settings.
Open Task Engine, then Assets, and add an asset with a name, a description, and, optionally, a text or JSON value. Larger or binary values, such as a spreadsheet, are written by a robot while it runs.
A robot reads an asset by name:
from robocorp import storage
prices = storage.get_json("price_list")- Edit an asset to change its description or its value. If a robot replaced the value while you were editing, select Load latest to see it first.
- Delete an asset only when no robot needs it. Robots can no longer read it, and it can't be undone.
Testing locally
When the Sema4.ai SDK is linked to your workspace, a robot you run on your own machine reads the same secrets and assets, with your own access. Reading a secret locally needs builder access. See Develop a task package.
Move them from Control Room
Secret values can't be read out of Control Room's Vault. Create each secret with the same name and item names, and enter the values again. Copy each asset with the same name and content. Bring over only the ones your robots read: the relink kit (opens in a new tab) finds them in your packages' code.