Prompt
How do I keep prompt history and who changed what?
Latest observation
Nov 18, 2026
OpenAI APIWeb search: off
To keep prompt history and track who changed what, you generally want a combination of versioning, audit logging, and metadata.
1) Store every prompt version
Save each prompt as an immutable record instead of overwriting it.
Typical fields:
prompt_id— stable ID for the promptversion— incrementing numbercontent— the full prompt textcreated_by— user ID or service accountcreated_at— timestampchange_note— optional reason for changeis_active— which version is currently in use
Example:
{
"prompt_id": "welcome-email",
"version": 3,
"content": "Write a friendly welcome email...",
"created_by": "user_123",
"created_at": "2026-11-18T10:12:00Z",
"change_note": "Added product tone guidelines"
}
2) Keep an audit log of edits
In addition to version history, record each change event.
Typical audit fields:
event_idprompt_idversion_fromversion_tochanged_bychanged_atdifforchanged_fieldsreason
This lets you answer:
- who edited it
- when it changed
- what changed
- why it changed
3) Track diffs between versions
For human-friendly review, store:
- full previous version
- full new version
- computed diff
This is useful for UI views like:
- “Show changes”
- “Compare version 2 vs 3”
4) Use permissions and identity
To know “who changed what,” authenticate users and write their identity into the audit record:
- user account ID
- email/username
- role
- service/app name if automated
5) If using Git, treat prompts as files
A very practical approach is to store prompts in Git:
- each prompt in a file
- every commit shows who changed it
- commit history gives diffs
- tags/releases can mark production versions
This works well if prompts are managed by developers or ops teams.
6) If using a database, common schema
You can use two tables:
prompts
idnameactive_version
prompt_versions
idprompt_idversioncontentcreated_bycreated_at
audit_log
identity_typeentity_idactionactor_idtimestampdetails
7) Best practices
- Never overwrite without saving the old version
- Make edits append-only
- Record timestamps in UTC
- Keep the actor identity from your auth system
- Store change reasons if possible
- Restrict edit permissions
- Back up history regularly
If you want, I can also give you:
- a database schema,
- a Git-based workflow, or
- an example implementation in SQL / Python / Node.