An agent that edits records will eventually edit the wrong ones: a bad merge, a field overwritten across a few hundred contacts, a cleanup that deleted what it should have kept. A log tells you what happened. It does not give you the records back.
If you are about to give an agent write access to a CRM, here is what the undo has to do, and how to check it before you trust it.
1. Log the before-image, not just the event
"Agent X updated contact 412" is an audit line. "Contact 412 was {title: CTO, phase: lead}, now {title: CTO, phase: customer}" is something you can reverse. Every write needs the record as it was before and as it is after, stored with the actor, a run identifier and a request id. Append only: an edit to the history defeats the point of having one.
2. Group writes into runs
Nobody wants to revert 300 individual changes. The unit that matters is the run: everything one agent did for one job.…