Using Secrets in Julep
A practical guide to managing and using secrets in your Julep applications
Using Secrets in Julep
This guide will walk you through the process of creating, managing, and using secrets in your Julep applications. Secrets provide a secure way to store and use sensitive information like API keys, credentials, and tokens without exposing them in your code or configuration files.
Creating Secrets
You can create secrets using the Julep CLI, SDKs, or directly through the API.
Using the CLI
Using the Python SDK
Using the Node.js SDK
Using the REST API
You can also create secrets directly using the REST API:
Using Secrets in Tasks
Once you’ve created secrets, you can reference them in your tasks using the secret_name
field or the secrets
object.
Direct Secret Reference
For tools that require a single API key or token:
Multiple Secrets
For tools that require multiple secrets:
Using Secrets in Expressions
You can reference secrets in expressions using the secrets
object:
For template variables in prompts:
Managing Secrets
Updating Secrets
To update an existing secret:
Adding Metadata
You can add metadata to organize and categorize your secrets:
This metadata can be used for filtering when listing secrets:
Deleting Secrets
When a secret is no longer needed:
Common Use Cases
Securing LLM API Keys
Julep can automatically use developer secrets for LLM API keys based on the provider:
External API Integration
For tools that call external APIs:
Database Connections
For database operations:
Best Practices
- Never commit secrets to version control
- Use descriptive names for your secrets
- Add metadata to organize your secrets
- Rotate secrets regularly
- Use the minimum necessary permissions
- Delete unused secrets promptly
- Use secret references instead of hardcoding values
Next Steps
- Secrets Management - Advanced guide for managing secrets
- Integration Patterns - Learn how to use secrets with integrations
- API Reference - Complete API reference for secrets