AI-native
How do you review everything an AI coding agent changed?
Look beyond the git diff. A coding agent with a shell can also change installed packages, your dotfiles, git hooks and ignored files, and none of those show up in review. Before the agent runs, record a hash of every file on its machine and save a snapshot; afterwards, compare a new list with the first. Then run the tests on a clean copy of the starting machine with only the diff applied, so nothing the agent left behind can affect the result.
Updated November 22, 2026
What does a git diff miss?
Everything outside tracked files. In Sandboxer's guide on seeing everything a coding agent changed outside git, a scripted agent made one commit and four other changes: it edited an installed Python package, added a line to ~/.bashrc, added a git pre-commit hook and wrote an editor task file in an ignored folder. git diff and git status showed only the commit. Each of the other four runs later on its own: the next time the tests import the package, the next shell, the next commit, or the next time the folder is opened in the editor.
Which check catches which change?
| Check | What it caught in Sandboxer's test |
|---|---|
git diff against the base commit | The committed edit only |
git status --ignored and listing .git/hooks | The hook and the ignored file |
| Checking installed files against each package's install record | The edited package |
| A hash of every file, before and after | All five changes |
The whole-disk comparison found 12 changed lines out of about 99,200 files, including the commit's own git bookkeeping and a couple of files from the test's own tooling. Hashing every file took about 6 to 8 seconds on a small sandbox.
Why test in a clean copy?
Because the agent's machine can't vouch for itself. The agent had sudo, so code it left behind could hide files from the second hash. The fix is not to trust its disk at all: start a new sandbox from the snapshot saved before the run, apply only the reviewed diff, and run the tests there. In the guide, that clean-room run was the only check that guaranteed none of the four outside changes reached the result. Use both: the file list tells you what the agent touched, and the clean room keeps it from mattering.
What doesn't a file list tell you?
- Permission-only changes, such as making a file executable, unless you record each file's mode too.
- Which command made each change. For that, read the agent's command history; see monitoring agent sandboxes.
- Files in skipped folders, such as temporary directories, unless you include them.
How does this fit with the rest of an agent's guardrails?
It's one layer. Give each agent its own machine and a narrow key (see what permissions an AI agent should have), checkpoint at good points so you can roll back (see how to undo an AI coding agent's mistakes), review its pull request with the full picture of what it changed, and ship the change behind a flag so it can be turned off; see how AI agents should write pull requests.
Frequently asked questions
Does git diff show everything an AI agent changed?
No. It shows tracked files. Installed packages, dotfiles, git hooks and ignored files need a check of the whole disk.
How do you see every file an AI agent changed?
Hash every file on its machine before the run and again after, then compare the two lists by path.
Can an AI agent hide its changes from that check?
On its own machine with sudo, it could. That's why the tests should run in a clean copy of the starting machine with only the reviewed diff applied.
How long does hashing a whole sandbox take?
About 6 to 8 seconds for roughly 99,200 files on a small Sandboxer sandbox, in Sandboxer's November 21, 2026 test.