secret() to reference sensitive values like API keys and tokens in your monitors. Secrets are resolved at runtime by the executor — the actual values never appear in your monitor files or monitor definitions stored in the hub.
Using secrets
secret() function accepts a name (alphanumeric and underscores, must start with a letter or underscore):
Managing secrets with the CLI
Secrets are stored per-environment on the hub:Secret providers
The hub resolves secrets using configurable providers. The provider determines where secret values are stored.Environment variables (default)
The simplest provider. Secrets are resolved from environment variables on the hub or executor process.AWS Secrets Manager
Store secrets in AWS Secrets Manager for production workloads. Hub configuration:HashiCorp Vault
Store secrets in Vault for enterprise environments. Hub configuration:Best practices
- Never hardcode secrets in monitor files — always use
secret() - Use different secrets per environment — staging and production should have separate credentials
- Rotate secrets regularly — update via the CLI or your secret provider’s rotation mechanism
- Use descriptive names —
STRIPE_API_KEYis better thanKEY1