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

  1. When you create a prompt, it starts at version 0 with no snapshot (it's an empty draft).
  2. The first time you save content, the version increments to 1 and the first snapshot is created.
  3. Every subsequent save increments the version number by 1 and creates a new snapshot.
  4. 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:

  1. Open the prompt in the editor.
  2. 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:

  1. Go to the version history page.
  2. Find the version you want to restore.
  3. Click the Rollback button on that version.
  4. Confirm the rollback.

Rolling back does not rewrite history. Instead, it:

  1. Takes the content from the selected snapshot.
  2. Creates a new version (incrementing the version number) with that content.
  3. Records a rollback entry 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 v2

This approach preserves a complete, auditable trail of every change.

Audit log

Every prompt operation is recorded in an immutable audit log:

ActionWhen it's logged
createA new prompt is created
updatePrompt content is saved (new version)
deleteA prompt is deleted
rollbackA prompt is rolled back to a previous version
clone_to_prodA 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.