alexcinovoj.devby TechTide AI
Back to AI notes
Pattern · AI agent testing

Reversing agent-made changes

I record changes and their inverse operations, then rehearse the reversal procedure before using it. I keep that procedure executable by a person without the agent. Destructive changes may not be reversible without a saved prior state.

Short answer

How do I reverse changes an agent made?

I record changes and their inverse operations, then rehearse the reversal procedure before using it. I keep that procedure executable by a person without the agent.

Implementation

  • Group a run's writes into a single change set with one identifier.
  • Record an inverse operation for each write at the time the write is issued.
  • Prefer additive changes and feature flags over destructive edits.
  • Rehearse the rollback in a staging environment before the change ships.
  • Keep the rollback path executable by a human without the agent.

What can go wrong

  • A prose-only rollback plan can omit the steps needed to restore the prior state.
  • A destructive migration without a saved prior state may not be reversible.

Checks to try

  • Execute the rollback in staging and diff the resulting state against the pre-change snapshot.

Questions this pattern answers

How do I reverse changes an agent made?

I record changes and their inverse operations, then rehearse the reversal procedure before using it. I keep that procedure executable by a person without the agent.

What steps does this method use?

Group a run's writes into a single change set with one identifier. Record an inverse operation for each write at the time the write is issued. Prefer additive changes and feature flags over destructive edits. Rehearse the rollback in a staging environment before the change ships. Keep the rollback path executable by a human without the agent.

How can I check the result?

Execute the rollback in staging and diff the resulting state against the pre-change snapshot.

What can go wrong with this approach?

A prose-only rollback plan can omit the steps needed to restore the prior state. A destructive migration without a saved prior state may not be reversible.

Related projects

Related patterns

I explain this method here. Current service scope, prices, and terms are on TechTide AI.

Systems Decision Audit at TechTide AI