What other controls would you use to prevent them contributing malicious commits, besides closely reading your co-contributor's commits, and disallowing noisy commits that you don't fully comprehend and vouch for?
We assume that it'd be unethical to surveil the contributor well enough to detect the change in alliance. That would violate their privacy.
Is it reasonable to say, "game over, I lose" in that context? To that end, we might argue that an embedded mole will always think of ways to fool our review, so this kind of compromise is fatal.
But let's assume it's not game over. You have an advanced persistent threat, and you've got a chance to defeat them. What, besides reviewing the code, do you do?
In an awful lot of open source, code review is a vanishingly rare commodity because there aren't enough committers left.
Code reviews are more about education and de-siloing.