Summary
Google Colab introduces a new feature called Secrets, which simplifies the process of managing and protecting sensitive information in the platform.
Abstract
Google Colab has launched a new feature called Secrets, which allows users to securely store and manage sensitive information such as environment variables, file paths, or keys. This feature ensures privacy, as the values are accessible only to the user and selected notebooks. Sharing a notebook won't expose the stored secrets, as they remain confidential. To use Secrets, users can open Google Colab, go to Secrets, enter the Name and Value of the secret, and toggle Notebook access. The secret value can be accessed in the notebook using the given code with the name of the secret. Secrets can be used across multiple notebooks, and the value can be changed by toggling the Visibility icon in the Action tab.
Bullet points
- Google Colab introduces a new feature called Secrets to simplify the management and protection of sensitive information.
- Secrets allows users to securely store environment variables, file paths, or keys.
- Values are accessible only to the user and selected notebooks, ensuring privacy.
- Sharing a notebook won't expose the stored secrets.
- To use Secrets, users can open Google Colab, go to Secrets, enter the Name and Value of the secret, and toggle Notebook access.
- The secret value can be accessed in the notebook using the given code with the name of the secret.
- The secret value received from
userdata.get('<secretName>') is of string type. If the value is numeric, it needs to be converted into a suitable numeric type.
- The value can be changed by toggling the Visibility icon in the Action tab.
- Once added, the secret can be accessible for all notebooks.
- To use it in a different notebook, users just have to grant access to that particular notebook by toggling the Notebook access.