Skip to content

AI uses for records

Agent rollback benchmark: how to measure a safe undo of unfinished work

By SourceX Editorial · Updated

10 sections

Short answer

An agent rollback benchmark tests safe reversal by stopping a business workflow partway in a sandbox, asking the agent to undo what it started, and then comparing every system and outbound channel with the state a correct recovery should leave. It scores residual side effects, collateral damage to other work and the honesty of the agent's report. This page is a protocol for that test; it reports no results.

Agent run

Agent rollback benchmark

This page covers agent rollback benchmark: how to measure a safe undo of unfinished work.Illustrative

Key takeaways

  • In business systems an agent rarely rolls back; it compensates, so the expected end state must include refunds, cancellations and correction notices.
  • Final database comparison is necessary but misses outbound messages and other people's concurrent edits; add a side effect ledger and a concurrency script.
  • Label every step as read only, compensable, pivot or irreversible communication before any agent runs.
  • Score residual effects, collateral damage, compensation correctness and disclosure accuracy separately, with over-reversal reported alongside.
  • Hold out companies, workflow families and interruption types separately, and beat a scripted reverse-order compensator before claiming skill.

How could a benchmark test safe reversal of an incomplete agent workflow?

Interrupt the workflow on purpose and grade the cleanup, not the task. A rollback benchmark runs a business workflow in a sandbox, breaks it after a chosen step, tells the agent the work must be abandoned or changed, and then checks three things: whether every effect the agent created was reversed or correctly compensated, whether anything the agent did not create was damaged along the way, and whether the agent's final report says plainly what could not be undone.

Most agent evaluations ask whether the agent finished. Real operations teams also ask what happens when it cannot finish: a vendor record was updated, a purchase order went out, a confirmation email was sent, and then the approval was withdrawn. The value of an agent in that moment is its ability to leave the business in a state a person can trust, and that ability is rarely measured.

This page sets out a protocol for measuring it: the definitions, the sandbox, the interruption design, the scoring, the holdout plan, baselines and a pre-registration checklist. It reports no results. Every count in it is illustrative and labeled as such.

Rollback, compensation and points of no return in business systems

In most business software an agent cannot literally roll back; it can only take a second action that offsets the first. Microsoft's Compensating Transaction pattern says this directly: you can't always roll back the data because other instances might have changed it, and undoing a step can require business-specific rules rather than restoring the original state. The 1987 Sagas paper by Garcia-Molina and Salem framed the same idea for long-lived transactions, which either complete or run compensating transactions to amend a partial execution.

Payments make the distinction concrete. In Stripe's API a completed charge is not deleted; a refund is created against it, and partial refunds can be issued up to the unrefunded amount. The ledger then holds both the charge and the refund. A benchmark that expects the charge to vanish would grade a correct agent as wrong.

Microsoft's Saga pattern names three kinds of step, and the benchmark should label every step in every task with one of them before any agent runs. Compensable steps can be offset. A pivot step is the point of no return. Retryable steps after the pivot must be completed, not reversed, because the business has already committed.

Rollback, compensation and points of no return in business systems
Step classBusiness example (illustrative)Correct recoveryWhat the grader checks
Read onlyLook up open invoices in NetSuiteNothing to undoNo writes appeared during recovery
Compensable, internalChange a vendor's payment terms in the ERPRestore the prior terms if no one else edited them sinceField value, audit trail entry, no overwrite of a later edit
Compensable, externalCreate a purchase order sent to a supplier portalCancel the order through the portal's cancel actionOrder status canceled, cancellation notice logged
Compensable with residueCharge a customer cardIssue a refund; the charge stays on recordRefund exists for the right amount; no duplicate refund
PivotRelease a wire paymentCannot be reversed by the agent; escalateAgent stopped, escalated and reported it
Irreversible communicationEmail a customer that the order shippedSend a correction only if policy allows; never pretend it was unsentCorrection sent or escalated; report names the original message

Why final-state grading alone misses the damage

Comparing the final database with an expected database is necessary but not sufficient. The tau-bench environment grades an episode by hashing the final data and comparing it with the hash produced by replaying the ground-truth actions; if they differ, the reward is zero. That is a strong check for the records inside the sandbox, and a rollback benchmark should keep it.

It misses two things that matter during an undo. First, effects outside the database: an email, a webhook, a message in a supplier portal or a print job does not live in the data the hash covers. Second, concurrent work: if another simulated user changed the same record while the agent was working, restoring an old snapshot would produce a hash match against the wrong expectation and silently erase someone else's change.

The plan therefore adds an outbound side effect ledger, which records every message, notification and external call the sandbox would have sent, and a concurrency script, which makes scripted changes to shared records during the run. ToolEmu shows one way to cover tools that have no sandbox: it uses a language model to emulate tool execution from tool specifications and pairs it with safety and helpfulness evaluators. Emulated tools are useful for breadth, but a rollback grade should rest on deterministic state where it can, because an emulator can be inconsistent about what a cancel call returns.

The sandboxed rollback and side effect evaluation plan

The table further down is the protocol in one place. Each row is a design decision a benchmark lead should fix before collecting any data, and the right-hand column says what to publish with the result so others can judge it.

At a glance

The sandboxed rollback and side effect evaluation plan

  • Keep the task and the interruption separate in the schema so the same task can be broken at different steps.
  • Record the expected end state as field-level assertions plus ledger assertions, not as a prose description.
  • Freeze the task set, the expected states and the scoring code before running any model, and version all three.
The sandboxed rollback and side effect evaluation plan
ComponentDesign choiceDetailPublish with results
Research questionCan the agent return an interrupted workflow to a correct, trustworthy state?Correct means compensated, not merely restoredExact wording and any changes after pre-registration
Unit of analysisOne workflow run interrupted at one stepEach task has several interruption pointsNumber of tasks, runs and interruption points
PopulationRights-cleared workflows from closed business casesAccounts payable, order management, customer service, schedulingSource companies by sector, case dates, exclusions
SandboxReplica systems with seeded records and a side effect ledgerDeterministic tools first, emulated tools only where neededTool list, which are emulated, seed data version
InterruptionInjected after step k with a reasonApproval withdrawn, conflicting record, tool failure, ambiguous timeoutInterruption mix and how k was sampled
ConcurrencyScripted edits by other actors during recoverySome edits touch the same records the agent changedScript, timing and affected fields
Expected end stateWritten by two domain reviewers per task and interruptionIncludes required residue such as refunds and cancellation noticesReviewer agreement and how disputes were settled
ComparisonAgent versus baselines on identical runsNo-op, scripted reverse compensator, snapshot restore, expert humanBaseline definitions and versions
Primary metricClean recovery rateNo residue, no collateral damage, honest reportRate with interval, per workflow family
UncertaintyRepeated trials and clustered intervalsClusters by source company and workflow familyTrial count, interval method, seeds

Where should the workflow break, and what should the agent be told?

Break it where recovery is hardest, not where it is convenient. An interruption right after a read is trivial; an interruption right after an external write, or right before a pivot step, is where agents and people make mistakes. Sample interruption points so that every step class from the earlier table appears, and over-sample the step immediately before the pivot.

The reason for the interruption changes the correct recovery, so each run carries one. If approval is withdrawn, the whole workflow is unwound. If a conflicting record appears, only some steps are reversed and the rest wait for a person. If a tool times out, the agent first has to find out whether the step happened at all.

That last case deserves its own slice. Microsoft's guidance notes that a step might not fail immediately but get blocked, and that compensating steps should be idempotent because they may run more than once. An agent that retries a refund after a timeout without checking whether the first refund succeeded can pay a customer twice. Stripe's API raises an error when a charge has already been fully refunded, which a sandbox can mirror; other systems are less forgiving, which is why the ambiguous timeout slice should include tools that silently accept duplicates.

Where should the workflow break, and what should the agent be told?
Interruption reasonWhat the agent learnsCorrect recovery scopeTypical failure to watch for
Approval withdrawnManager rejects the request after steps ranUnwind every compensable stepLeaves an external order open
Conflicting recordA newer contract changes the termsReverse only steps that used the old termsReverses everything, including valid work
Tool failure mid-stepError returned on step kReverse steps before k; confirm step k left nothingAssumes the failed step had no effect
Ambiguous timeoutNo response on an external writeCheck the outcome, then compensate onceDuplicate refund or duplicate cancellation
Permission revokedAgent loses write access during recoveryStop, report what remains, escalateKeeps trying or claims success

Scoring the undo: residue, collateral damage and an honest report

Score each run on four outcomes and report them separately before combining them. A single success flag hides the trade-off that matters most: an agent can look clean by restoring a snapshot that erases a colleague's edit, or look careful by reversing nothing and escalating everything.

The disclosure check is the one most often skipped. After recovery the agent writes a short report. Graders compare it with the ledger and the expected state: every irreversible effect should be named, nothing should be described as undone that was not, and the person who needs to act next should be identified. A recovery that is technically complete but reported falsely should fail.

  • Clean recovery, the primary metric, requires zero residual effects, zero collateral damage, correct compensation and an accurate report on the same run.
  • Publish over-reversal and escalation rates next to the primary metric so a cautious agent cannot win by unwinding everything.
  • Weight effects by business consequence only with published weights, and show the ranking with and without them.
Scoring the undo: residue, collateral damage and an honest report
MetricDefinitionHow it is computedFailure it catches
Residual effectsAgent-created effects still present that should be goneField assertions and ledger entries left unmatchedOrphaned orders, unreversed status changes
Collateral damageChanges to records or messages the agent did not createDiff against concurrent actors' expected editsSnapshot restores that overwrite other work
Compensation correctnessOffsets match the original effect exactly onceAmount, target and count of compensating actionsDouble refunds, partial cancellations
Over-reversalValid work undone that should have stayedAssertions on steps marked keepUnwinding after a narrow conflict
Disclosure accuracyReport matches what actually happenedGraded against ledger by two reviewersClaims that an email was recalled
Escalation fitPivot and blocked steps routed to the right ownerOwner field and timingSilent stop with no handoff

Would a clean-recovery score survive companies and workflows the agent never saw?

It survives only if it holds on companies, workflow families and interruption types that neither the agent nor its prompt designers saw during development. Rollback skill can be memorized in narrow ways: an agent tuned on one ERP's cancel endpoint may look strong until the cancel lives under a different menu with a different confirmation rule.

Hold out along three axes separately. Hold out whole source companies, so record conventions and naming are new. Hold out whole workflow families, such as keeping returns processing unseen when the development set covers purchasing. Hold out an interruption type, such as permission revoked, so the result shows whether recovery behavior generalizes beyond the reasons it was tuned on.

Report each split on its own. A result that holds on unseen companies but collapses on an unseen interruption type is still useful, but it supports a narrower claim, and the published wording should match the narrowest split that held.

How many runs, which baselines and what intervals make a rollback score credible?

Enough independent workflows that the interval excludes the strongest simple baseline, measured over repeated trials. Rollback behavior varies run to run, so each task and interruption pair should run several times. The tau-bench README reports pass^k, the chance that all k trials of a task succeed, and the same idea applies here: a recovery that is clean on one try in three is not dependable.

At a glance

How many runs, which baselines and what intervals make a rollback score credible

Baselines set the bar. A no-op agent that stops and reports nothing shows how much the expected end state already rewards inaction. A scripted compensator that reverses logged steps in reverse order shows how far plain bookkeeping goes. A snapshot restore shows the cost of ignoring concurrent work. An expert human on a sample of tasks shows what good looks like and where the expected states may be wrong.

Compute intervals by resampling whole source companies and workflow families, not individual runs, because runs from the same company share conventions and will be correlated. As an illustrative scale only, a first version might hold several dozen tasks from a handful of companies, each with three or four interruption points; the real number should come from a power calculation against the scripted compensator.

  • Pre-register the research question, step classes and primary metric.
  • Freeze task set, interruption points, expected states and scoring code, with versions.
  • Name the agent, model version, prompt and tool descriptions used, including any tool annotations.
  • List which tools are deterministic and which are emulated.
  • Define the four baselines and run them on identical seeds.
  • State the trial count per task and the interval method, clustered by company and family.
  • Set the holdout splits before development begins and do not inspect them until the final run.
  • Record reviewer agreement on expected states and how disagreements were settled.
  • Report every slice, including the ambiguous timeout and permission revoked slices.
  • Publish the limits: sandbox realism, emulated tools, and workflows not covered.

Tool annotations are hints, so the benchmark must not trust them

Agents increasingly see a description of each tool's behavior, and a rollback benchmark should test whether the agent relies on it blindly. The Model Context Protocol lets a server mark a tool as read only, destructive or idempotent, but its schema states that these annotations are only hints that may not faithfully describe the tool, and that clients should never make tool use decisions based on annotations from untrusted servers.

Include tasks where an annotation is missing or wrong, such as a tool marked idempotent that actually creates a second record on each call. An agent that retries it during recovery creates fresh residue. The expected end state for those tasks should reward an agent that checks the system's actual state after acting rather than trusting the label.

Where rights-cleared rollback cases come from

The hardest input to obtain is not the sandbox but the cases: closed business workflows in which something was started, then canceled, reversed or corrected, with the records showing what each step touched. Ticket histories with reopened and reversed actions, purchase orders with cancellations, refunds linked to charges and corrected customer messages are the raw material for realistic interruptions and expected end states. Every case needs a documented right to use it for evaluation, and de-identification alone does not supply that right.

Benchmark builders short of such cases can put the evaluation plan above into a SourceX data request; SourceX keeps no inventory and looks for matching U.S. businesses only after a request names its scope, volume, language, format, timing and the license terms the benchmark needs. With the business that holds the cancellations and refunds, it then works through rights review, contracting, preparation and delivery.

Frequently asked questions

What is an agent rollback benchmark?

It is an evaluation that interrupts an AI agent partway through a business workflow and measures whether the agent can return the systems to a correct state. It checks leftover effects, damage to other people's work, correct compensation such as refunds, and whether the agent reports honestly what it could not undo.

Is rollback the same as restoring a database snapshot?

No. In business systems most undo actions are compensations, such as a refund or a cancellation, that leave a record of both steps. Restoring a snapshot can erase changes other people made in the meantime, so the plan scores it as collateral damage.

Why test ambiguous timeouts separately?

When a tool call times out, the agent does not know whether the step happened. Retrying or compensating without checking can create duplicates, such as a second refund. Isolating this slice shows whether the agent verifies state before acting.

Can emulated tools replace a real sandbox for this test?

They help with breadth, especially for tools that have no test environment. For the primary rollback score, deterministic tools with inspectable state are safer, because an emulator can be inconsistent about what a cancel or refund call returns.

Are there results for this rollback protocol yet?

No. This page publishes only the method: definitions, sandbox, interruption design, metrics, holdouts, baselines and a pre-registration checklist. Any figures shown are illustrative and are not measurements.

Sources

  • Microsoft's Compensating Transaction pattern: data can't always be rolled back, compensation may need business rules, steps can block rather than fail, and compensating steps should be idempotent. Source
  • Microsoft's Saga pattern defines compensable, pivot and retryable transactions; the pivot is the point of no return. Source
  • Garcia-Molina and Salem's 1987 Sagas paper: a long-lived transaction is a sequence of transactions that either all complete or are amended by compensating transactions. Source
  • Stripe refunds are created against an existing charge, can be partial up to the unrefunded amount, and raise an error if the charge was already refunded. Source
  • tau-bench computes reward by comparing a hash of the final data with the hash produced by replaying the ground-truth actions. Source
  • tau-bench reports pass^k results across repeated trials. Source
  • ToolEmu uses a language model to emulate tool execution in a virtual sandbox and includes safety and helpfulness evaluators. Source
  • The MCP schema defines readOnlyHint, destructiveHint and idempotentHint as hints and says clients should not decide tool use from annotations sent by untrusted servers. Source

Tell us what data you need

Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.

See if your company qualifies