How to review an agent's diff safely

An agent's patch looks tidy, and the risk sits in the lines you skipped. Review it in a fixed order.

Read the file list first, then the line counts per file. A lockfile, CI config, migration folder or secret sample in that list is a question to answer before you read the body.

Read by risk: permissions and auth, writes and deletes, outbound requests, dependency changes, and only then formatting and renames. A large reformat buries the real change in hundreds of lines, so make it a separate commit.

Understanding a diff is not proof it runs. Run the tests and the build locally or in CI, and for deleted code confirm nothing else references it. The agent will say it verified; you want the log.

Do not approve a hunk you cannot explain. Ask why those lines are needed, or have it redo the change smaller. Sending it back is cheaper than reverting after merge.