Features
- Secure secret storage and retrieval
- Create secrets from direct values or from files
- Metadata-only listing vs. value retrieval
- Validation and error handling for secret operations
Quick Start
Common operations
Create a secret (value or file):client.secrets.update(...) and client.secrets.delete(...).
File-based secrets
You can create a secret from a file when the secret is large or managed outside code:Integration with Workflows and MCP
- Secrets are exposed to workflows via environment mappings or parameters marked as secret.
- The MCP
compile_workflowtool analyzes workflows for secret placeholders and will either add parameter placeholders for missing secrets or accept provided secret values (see MCP Server docs).
Error Handling
SecretValidationErrorindicates invalid input (empty name, missing value, conflicting args).SecretErrorindicates operational issues (file not found, permissions, not found on retrieval).
Best Practices
- Never print secret values or include them in logs.
- Use descriptive but non-revealing secret names and include environment prefixes.
- Rotate secrets regularly and use
client.secrets.update()to rotate. - When creating secrets from files, ensure secure file permissions and remove temporary files after use.
Code Examples and Patterns
Safe retrieval helper:Where to use
- Use the Secrets service when workflows need credentials for cloud providers, APIs, or databases.
- Prefer passing secret references (parameters/env mappings) to workflows rather than embedding values in DSL source.