# How do you approve an AI agent’s file edits before they take effect?

> A developer guide to approving AI agent edits to documents, spreadsheets, and slides: freeze a revision, review evidence, then merge or reject.

<https://univer.ai/blog/human-review-ai-file-edits/>

*Published November 26, 2026 · By Univer Team*

**Short answer:** Have the agent edit a draft, freeze it, and show the reviewer what changed in each file before applying it. Univer’s commercial Worktree can hold the draft, while an approval workflow records who approved that revision.

_Product details checked on November 26, 2026._

## Why an approval has to point at something fixed

An approval means "this exact content may go live." If the agent can keep editing after someone clicks Approve, the approval no longer describes the content that ships. That is the main design problem when you let an agent edit business files. Getting a yes or no from a person is the easy part. The hard part is making sure the yes applies to a specific, unchanging set of bytes.

Three properties follow from that:

- **The draft is separate from the live file.** Nobody downstream sees the agent’s work until it is merged.
- **The reviewed revision is immutable.** Once review starts, the agent cannot change what is under review.
- **Applying the change is a separate, recorded step.** Approval and merge are logged together so you can later show which revision was approved and what happened when it was applied.

## Two patterns: routing the decision or reviewing the file

Teams usually start from one of two places. They answer different questions, and most production systems need both.

### Workflow decision routing

A workflow engine decides who must approve, waits for the answer, and branches on the result. In Microsoft Power Automate, the [Start and wait for an approval](https://learn.microsoft.com/en-us/power-automate/modern-approvals) action pauses the flow until the approver responds, and then the flow continues on the outcome. The response tells the flow which branch to take. Include a link to the frozen draft so the approver can examine the actual changes.

The engine does not know what changed inside a spreadsheet or slide deck. Whatever you attach to the approval request, such as a link, a summary, or a rendered file, is the only content evidence the approver gets. If that link points to a file the agent can still edit, the approval is not anchored to anything.

### File-level review

The other pattern puts the reviewer in front of the content. Thinkfree [describes an approach](https://thinkfree.com/en/blog/human-in-the-loop-ai-agent-contract-editing) where the agent’s contract edits appear as suggestions in the original contract editor, and a person reviews them there before they become part of the document. The reviewer sees changes in context, in the tool they already use.

File-level review answers "what exactly is changing?" It does not, by itself, decide who must sign off on a commercial term, or coordinate approval across several files that have to change together.

### Comparison

| Question                        | Workflow routing                     | File-level review                       |
| ------------------------------- | ------------------------------------ | --------------------------------------- |
| Who must approve?               | Strong: rules, escalation, reminders | Usually outside its scope               |
| What exactly changed?           | Only what you attach                 | Strong: changes shown in context        |
| Is the approved content frozen? | Only if you freeze it yourself       | Depends on the editor and storage model |
| Multiple files in one decision  | Possible, as attachments             | Often one file at a time                |
| Audit trail                     | Of the decision                      | Of the content changes                  |

A practical design routes the decision with a workflow engine and anchors it to a frozen file revision that carries its own evidence.

## Criteria for an approval you can trust

Use these criteria to evaluate any implementation, whether you build it or buy it:

1. **Revision binding.** The approval record stores an identifier for the frozen revision, not a file path.
2. **Edit lockout.** After freezing, edits to that revision fail. They are not silently queued.
3. **Per-format evidence.** The reviewer gets evidence suited to each file type. A text summary of a spreadsheet change is not enough.
4. **Explicit outcomes.** Approve, request changes, and reject are distinct states with distinct effects.
5. **Fresh approval after any change.** If the agent revises anything, the new revision needs a new approval.
6. **Visible merge results.** If several files are applied, each file’s result is recorded and shown.
7. **No silent semantic resolution.** If the live file changed while the draft was under review, a person decides what that means.

## Illustrative example: agreement, pricing appendix, and summary slide

This is a constructed example, not a customer case. An account team asks an agent to move a client from a 30-day to a 45-day delivery window and add a rush-delivery fee. Three files must change together:

- **Delivery agreement (Word):** the delivery clause and a new rush-delivery clause.
- **Pricing appendix (Excel):** a new rush-fee row, plus the subtotal and total formulas that depend on it.
- **Summary slide (PowerPoint):** the headline delivery terms and the total contract value.

### What the agent changes

The agent works in a draft that contains all three files. It edits the clause text, adds the appendix row, and updates the slide. Before handing off, it recalculates the workbook and reads the totals back, so the number on the slide comes from the computed appendix rather than from the agent’s arithmetic. It renders the document and slide to confirm that the new clause did not break numbering and the new figure fits its text box.

The agent then freezes the revision and posts a review request with an identifier such as `rev-0412`.

### Evidence the reviewer sees

The reviewer needs evidence for each format, because the risks differ:

- **Agreement:** the changed clauses shown before and after, plus a rendered page view so numbering and cross-references can be checked. Produce this comparison in your own pipeline. Do not assume every tool offers the same native diff for every format.
- **Pricing appendix:** a list of changed cells with old and new values and formulas, plus the recalculated subtotal and total as read back after calculation.
- **Summary slide:** a rendered image of the slide before and after.
- **Cross-file check:** one line stating that the slide’s total equals the appendix’s computed total and that the agreement’s delivery window matches the slide. Your workflow generates and verifies this. A merge step does not.

### Approve, request changes, or reject

- **Approve `rev-0412`:** the workflow merges that revision and records the result for each file.
- **Request changes:** the reviewer notes, for example, that the rush fee should be per order rather than per unit. The frozen revision stays as it is. The agent makes the change in a draft, which yields a new revision, say `rev-0413`, that goes through review again. The earlier approval, if any, does not carry over.
- **Reject:** nothing is merged. Keep the frozen revision for the audit trail and close the request.

"Reopen" is better modeled as "produce a new revision" than as "unfreeze the old one." That way every approval in your log still points to content that never changed.

## Test protocol before you ship

Run these tests against a staging copy of real-format files. Each has a pass condition you can automate.

1. **Edit after freeze.** Freeze a revision, then have the agent try to modify it. Pass: the edit is refused, and the frozen content is byte-identical before and after the attempt.
2. **Approval binding.** Approve `rev-A`, then create `rev-B` with one changed cell. Trigger the merge using the approval for `rev-A`. Pass: `rev-B` is not merged, and the log shows the mismatch.
3. **Rejection leaves live files untouched.** Reject a revision. Pass: checksums of the live agreement, appendix, and slide are unchanged.
4. **Recalculation evidence.** Change an appendix input that feeds the total. Pass: the review package shows the recalculated total as read back, and it matches an independent calculation in your test harness.
5. **Render evidence.** Add a long clause and a longer slide headline. Pass: the review package includes rendered output for both, and a reviewer can spot overflow without opening the files.
6. **Partial multi-file merge.** Inject a failure while the third file is being merged. Pass: the UI shows, file by file, which merged and which did not, and the workflow does not report overall success.
7. **Concurrent change to the live file.** While a revision is under review, a person edits the live appendix. Pass: your workflow flags the change and requires a fresh review instead of assuming the merge resolves the meaning.
8. **Audit completeness.** For one approved change, reconstruct from logs who approved, which revision, the evidence shown, and each file’s merge result. Pass: all four are present.

## Where Univer fits

Univer is a document platform for spreadsheets, documents, and slides. This section separates what Univer provides from the workflow recommended above.

### What is built in

- **Agent tooling.** According to the [agents page](https://univer.ai/agents/), Univer provides a CLI and a skill that let an existing agent read and edit Excel, Word, and PowerPoint files, calculate and read results back, and check renders. Changes stay in draft until they are reviewed and merged.
- **Worktree.** The [server collaboration extensions docs](https://docs.univer.ai/server/collaboration/extensions) describe a server-side Worktree. Calling `markReady()` freezes the current revision, and only a worktree in draft state accepts edits. Calling `mergeWorktree()` merges the worktree’s Units one at a time.
- **Licensing.** Per the [pricing page](https://univer.ai/pricing/), the core is open source under Apache-2.0. Real-time collaboration (operational transformation), edit history, the server-side Worktree, and XLSX conversion are commercial features. Commercial capacity is based on collaborative connections and monthly exports.

### Limitations to design around

- **Multi-file merges are not atomic.** Because `mergeWorktree()` merges Units one at a time, a merge spanning the agreement, appendix, and slide is not atomic across them. Display the result for each Unit and decide in your workflow what happens if one fails. This does not mean a single-workbook merge is partial.
- **No routing.** The Worktree freezes and merges content. Deciding who approves, and enforcing that the approval matches the frozen revision, is your workflow’s job. You can pair it with an engine such as Power Automate or with your own service.
- **Evidence is assembled by you.** The agent tooling can calculate, read back, and check renders. Packaging that into a review view, including any before-and-after comparison, is part of what you build. Do not assume cell-level accept or reject of individual changes.
- **No semantic conflict resolution.** Nothing automatically decides whether a concurrent human edit and the agent’s draft are compatible in meaning. Keep a person in that loop.
- **Commercial dependency.** The Worktree and XLSX conversion are not in the Apache-2.0 core, so an approval flow built on them requires a commercial plan.

## FAQ

### Is a Power Automate approval enough on its own?

It is enough to route and record a decision. It is not enough to guarantee that the approved content is what ships. Pair it with a frozen revision and store that revision’s identifier in the approval record.

### Why freeze the revision instead of reviewing the live draft?

Because the agent, or another process, could change the draft between review and merge. Freezing makes the approval refer to fixed content, and any later change produces a new revision that needs its own approval.

### What should a reviewer see for a spreadsheet change?

Changed cells with old and new values and formulas, plus recalculated results read back after calculation. A prose summary from the agent should supplement that evidence, not replace it.

### How should a multi-file change be handled if one file fails to merge?

Show each file’s result separately, do not report overall success, and decide in your workflow whether to retry the failed file or apply a corrective change to the files that did merge. With Univer’s Worktree, a merge across several Units is not atomic, so plan for this case.

### Can the agent fix a rejected revision directly?

Model it as a new revision. The agent edits in a draft, freezes the result, and submits it for a fresh approval. The rejected revision stays unchanged in the audit trail.

To see how the CLI and skill connect an existing agent to Excel, Word, and PowerPoint files, start with the [Univer agents overview](https://univer.ai/agents/).
