Most people would see it as morally acceptable – even praiseworthy – for the government to infiltrate criminal/terrorist racist groups in order to enable their arrest and prosecution, and if undercover agents have to (privately) say racist things in order to do so, that's a necessary evil which is obviously justifiable in order to pursue the greater good – something I think even the kind of person who'd call themselves a "deeply committed antiracist" would consider a no-brainer.
By contrast, ChatGPT is inclined to respond that "don't say racial slurs" is a moral absolute which cannot be violated even in that circumstance, or if it is wiling to entertain violating it, it presents it as some profound ethical dilemma rather than the no-brainer it rather obviously is.