I totally keep my agents away from git writes.
I had to add some pretty severe harness restrictions for the disastrous Claude 5 line to get it to follow directions on that (ended up cancelling my sub over that sort of behavior, and the bad use of human language)