You can solve this easily by having a separate agent write the tests, and not giving the implementing agent write permission on test files.