Environments

Rekor databases support two environments: production and preview. Agents experiment freely in preview databases, and a human operator promotes validated config to production.

How It Works

  1. Production database — the live environment. Agents can read everything and write documents, but cannot change the schema (collections, triggers, hooks).
  2. Preview database — a sandbox linked to a production database. Agents have full access: modify schemas, create test documents, configure triggers.
  3. Promote — a human-only operation that copies config from preview to production after review. Documents stay in preview.

Access Control

OperationProductionPreview
Read collections, documents, relationshipsYesYes
Write documents and relationshipsYesYes
Upsert/delete collectionsNoYes
Create/delete triggers and hooksNoYes
PromoteHuman only (CLI)N/A

Workflow

1. Create a preview database

rekor databases create-preview my-database --name "add-invoices"

2. Agent works in preview

# Add a new collection
rekor collections upsert invoices \
  --database my-database--add-invoices \
  --schema '{"type":"object","properties":{"amount":{"type":"number"},"status":{"type":"string"}}}'

# Test with sample documents
rekor documents upsert invoices \
  --database my-database--add-invoices \
  --data '{"amount": 5000, "status": "draft"}'

3. Review and promote (human)

# See what would change
rekor databases promote my-database \
  --from my-database--add-invoices --dry-run

# Apply
rekor databases promote my-database \
  --from my-database--add-invoices

4. Rollback if needed

# List promotions
rekor databases promotions my-database

# Rollback a specific promotion
rekor databases rollback my-database --promotion <promotion-id>

What Gets Promoted

Only config is promoted — not data:

  • Collections — JSON Schema, display hints, external sources
  • Triggers — webhook dispatch rules (new secrets generated on production side)
  • Hooks — inbound webhook receivers (new secrets generated)

Documents and relationships in the preview database are test data and stay behind.

Schema Compatibility

When promoting a modified collection schema, Rekor samples existing production documents and validates them against the new schema. Breaking changes (removed required fields, type changes) are flagged before they can be applied.

Multiple Previews

A production database can have multiple preview databases. Each is independent — different agents or team members can experiment on different features in parallel.

Environments — Rekor