What are Runpod Secrets
Secrets are encrypted strings that store sensitive information separately from your template configuration. This approach offers several advantages:- Security: Sensitive data is encrypted and never displayed in plain text once created, protecting against accidental exposure.
- Reusability: The same secret can be referenced across multiple templates and Pods without duplication.
- Access control: Secrets are tied to your account or team, ensuring only authorized users can access them.
- Audit trail: Changes to secrets are tracked, providing visibility into when sensitive data is modified.
Creating a secret
You can create secrets through the Runpod web interface to securely store sensitive information:- Navigate to the Secrets section in the Runpod console
- Click Create Secret to open the creation form
- Provide the required information:
- Secret Name: A unique identifier for your secret (e.g.,
huggingface_token
,database_password
) - Secret Value: The actual sensitive data you want to store
- Description (optional): A helpful description of what this secret contains or how it’s used
- Secret Name: A unique identifier for your secret (e.g.,
- Click Create Secret to save your encrypted secret
Once a secret is created, its value cannot be viewed through the interface. This is a security feature that prevents accidental exposure of sensitive data. If you need to verify or change the value, you must modify the secret or create a new one.
Managing existing secrets
Modifying a secret value
To update the value of an existing secret:- Go to the Secrets section
- Click on the name of the secret you want to modify
- Click the configuration icon and select Edit Secret Value
- Enter the new secret value
- Click Save Changes to update the encrypted value
Viewing secret details
You can view metadata about your secrets without exposing the sensitive values:- Navigate to the Secrets section
- Click on the secret name you want to inspect
- Click the configuration icon and select View Secret
Deleting a secret
To permanently remove a secret:- Go to the Secrets section
- Click on the secret you want to delete
- Click the configuration icon and select Delete Secret
- Type the secret name to confirm deletion
- Click Confirm Delete to permanently remove the secret
Deleting a secret is permanent and cannot be undone. Make sure no active templates or Pods are using the secret before deletion, as this will cause those deployments to fail.
Using secrets in Pod templates
Once you’ve created secrets, you can reference them in your Pod templates to provide secure access to sensitive data.Direct reference method
Reference your secrets directly in the environment variables section of your Pod template using theRUNPOD_SECRET_
prefix followed by your secret name:
huggingface_token
, you would reference it as:
Web interface selection
When creating or editing a Pod template through the web interface, you can also:- Navigate to the environment variables section of your template
- Use the secret selector to choose from your available secrets
- The interface will automatically format the reference syntax for you
Best practices for using secrets
Naming conventions: Use descriptive names that clearly indicate the secret’s purpose (e.g.,openai_api_key
, database_password
, github_token
).
Environment variable mapping: Map secrets to appropriately named environment variables in your templates: