Artificial intelligence, which poses unprecedented challenges to scientific integrity, is also behind many of the tools used to defend it