So you're fine with your code having unintended behaviour, as long as that unintended behaviour passes a test that the agent wrote?
My preferred approach is to read and understand everything the LLM produces AND have it create test suites (which I also read and understand). The LLM can help you with that too - just have it breakdown and explain the code at each iteration.