This page covers the SDK-supplied path. For production, prefer the KMS-backed path — see Per-Index KMS & BYOK for the end-to-end setup.
Generating a key for development
For local development and evaluation, generate a 256-bit key locally and pass it asindex_key (or the SDK’s typed equivalent).
Using the key
The sameindex_key you passed to create_index must be re-supplied on every subsequent request for that index — load_index, upsert, query, get, delete, delete_index. The service stores only a hash to verify the key on each request; it never persists the plaintext.
Persisting the key
The service never persists the plaintext key, so your application owns key storage. For development, the Python SDK’sgenerate_key(save=True) will cache the generated key in ~/.cyborgdb/index_key — useful for evaluation, not for production.
For production:
- Store the key in your platform’s secret store (Vault, AWS Secrets Manager, GCP Secret Manager, Azure Key Vault, k8s Secret) and fetch it at runtime.
- Or switch to the KMS-backed path so the SDK never holds a long-term key: see Per-Index KMS & BYOK.
Migrating from SDK-supplied to KMS-backed
You cannot rotate an index in place fromprovider: none to a real KMS provider — the wrapping model changes. The migration path is:
- Create a new index with
kms_nameset instead ofindex_key. - Replay your data (
upsert) into the new index. - Delete the old index.
provider: none records no wrap key, so there is nothing for the KMS path to unwrap. Bulk re-encryption against a fresh DEK happens on the upsert.
See also
- Per-Index KMS & BYOK — production setup with AWS KMS or Secrets Manager (preferred for production).
- Environment Variables —
CYBORGDB_API_KEYand other service-level configuration. - Create an Encrypted Index — full
create_indexreference, includingkms_name.