Diffs and revert
When ML.ai can show you a diff before you approve, when it can't, and how reverting a change actually works.
Proposed diffs
For edit and write operations, ML.ai opens a native VS Code diff before the permission card is even answered. You approve a change you've actually looked at, not a description of one.
42 async function refresh(token) {
- 43 if (!token) return null
+ 43 if (!token?.exp) throw new Error('expired')
+ 44 return await rotate(token)
45 }
2 lines changed
Waiting for your approval
Shell and MCP operations don't get a diff
Shell commands and MCP tool calls show their command or input instead of a diff. This is a deliberate limit, not a missing feature: ML.ai can't know in advance what an arbitrary shell command or a third-party MCP tool will actually change on disk. Promising a diff it can't reliably produce would be worse than not promising one at all.
After changes land
Once changes are made, you get a per-session change summary and a repository state panel reflecting the current state of everything the agent has touched.
Reverting
Revert is a deliberate task with its own review step, not a single undo button you click and forget. ML.ai walks through three stages before anything actually changes on disk:
ML.ai stages the revert
Requesting a revert doesn't immediately touch files. ML.ai first prepares the revert as a pending operation.
The preview binds to the original snapshot
The preview diff is bound to a snapshot the engine took at the time of the original change, so what you're shown is an accurate before/after, not a guess reconstructed after the fact.
You open the diff before anything is written
ML.ai will not write anything back to disk until you've opened that diff. This mirrors the same look-before-you-approve pattern as a normal edit.
Revert only ever touches files: it restores file contents, it never rewrites the conversation transcript itself. If you close the panel or reload mid-revert, the staged revert state survives and picks back up where you left it.