zeph-vault
VaultProvider trait and backends (env, age) for Zeph secret management.
Overview
Provides a unified interface for resolving secrets needed by the agent (API keys, tokens) without embedding them in the config file. Two backends ship out of the box: an environment-variable backend for simple deployments and an age-encrypted file backend for production use. All secret values are held as Zeroizing<String> — they are zeroed in memory on drop and never implement Clone.
Key types
| Type | Description |
|---|---|
VaultProvider |
Trait: get(key) -> Option<Zeroizing<String>>, set(key, value), delete(key), list_keys(), save() |
EnvVaultProvider |
Reads secrets from environment variables; writes are no-ops |
AgeVaultProvider |
Reads/writes an age-encrypted JSON file (~/.config/zeph/vault.age) |
AnyVaultProvider |
Enum dispatch over all provider variants |
VaultError |
Typed error enum (Io, Decrypt, Encrypt, Parse, KeyNotFound) |
MockVaultProvider |
In-memory provider for tests (feature-gated: mock) |
Usage
use ;
// Open (or create) the age-encrypted vault
let mut vault = open?;
// Store a secret
vault.set;
vault.save.await?;
// Retrieve a secret — returned as Zeroizing<String>
if let Some = vault.get
CLI usage:
Configuration
[]
= "age" # "env" or "age"
= "~/.config/zeph/vault.age" # only used by "age" backend
The env backend resolves secrets directly from environment variables — no file needed. Use age for production deployments where secrets must be stored on disk.
[!IMPORTANT] Age-encrypted vault files are created with
0o600permissions. Ensure the key file (~/.config/zeph/age_key) is kept secure. Losing the key makes the vault unrecoverable.
Features
| Feature | Description |
|---|---|
mock |
Enables MockVaultProvider for downstream crate tests |
Installation
Documentation
Full documentation: https://bug-ops.github.io/zeph/
License
MIT