Versioning
Every prompt save creates an immutable snapshot. View history, compare versions, and roll back instantly.
Versioning
FetchPrompt automatically versions every change you make to a prompt. Each save creates an immutable snapshot — a permanent record of the prompt content at that point in time. You can view the full history, compare any two versions, and roll back to a previous version instantly.
How versioning works
- When you create a prompt, it starts at version 0 with no snapshot (it's an empty draft).
- The first time you save content, the version increments to 1 and the first snapshot is created.
- Every subsequent save increments the version number by 1 and creates a new snapshot.
- Snapshots are immutable — they are never modified or deleted (except when the entire prompt is deleted).
Each snapshot stores:
- The full prompt content at that version
- A SHA-256 content hash for integrity verification
- The author who made the change
- A timestamp of when the snapshot was created
Version history
To view the version history of a prompt:
- Open the prompt in the editor.
- Click the History button.
The version history page shows a paginated list of all snapshots (20 per page), ordered from newest to oldest. Each entry shows:
- Version number
- Author email
- Timestamp
- Content hash (truncated)
Comparing versions
Each version in the history includes a Compare with previous option that opens a side-by-side diff viewer. This makes it easy to see exactly what changed between consecutive versions — additions, deletions, and modifications are highlighted. If the compared version is not loaded on the current page, it is fetched automatically from the server.
Rolling back
To restore a previous version:
- Go to the version history page.
- Find the version you want to restore.
- Click the Rollback button on that version.
- Confirm the rollback.
Rolling back does not rewrite history. Instead, it:
- Takes the content from the selected snapshot.
- Creates a new version (incrementing the version number) with that content.
- Records a
rollbackentry in the audit log with metadata indicating which version was restored.
For example, if you roll back from version 5 to version 2, the result is version 6 containing the same content as version 2. Versions 3, 4, and 5 remain in the history.
v1 → v2 → v3 → v4 → v5 → v6 (rollback to v2)
↑
Same content as v2This approach preserves a complete, auditable trail of every change.
Audit log
Every prompt operation is recorded in an immutable audit log:
| Action | When it's logged |
|---|---|
create | A new prompt is created |
update | Prompt content is saved (new version) |
delete | A prompt is deleted |
rollback | A prompt is rolled back to a previous version |
clone_to_prod | A Stage prompt is cloned to Production |
The audit log includes the user who performed the action, the prompt slug, version number, content hash, environment, and a timestamp. Audit log entries cannot be modified. When an organization is deleted, its audit log entries are removed via cascade.