what is your rule of thumb for letting ai agents run git commands directly?

by•

giving an agent terminal access to stage and commit changes speeds up prototyping, but it comes with weird surprises. Yesterday an agent staged temporary log files and untracked config edits into a feature branch commit without mentioning it in the summary.

​do you give your agent full shell execution rights, or do you strictly lock down git operations to manual user approval?

15 views

Add a comment

Replies

Best

i let it commit but never with a plain add.. a plain commit once picked up files another session had already staged in the same repo, so now it stages by exact path and i read the staged list before the commit runs. a worktree per agent stopped most of the rest. was the config edit something it made or something already sitting there?

My agents can commit, but only when I ask, and a few commands are off limits: `git push --force` and `git clean -fd` never run, and `git reset --hard` only runs when I say so. Those sit in the global rules every session reads, and the riskiest ones also have a hook.