I don't have any easy answer on that, in part because I don't know enough about the real data. In general, trans women in "women's spaces" do not present any increased risk of harm to cis women, but prison may be a slightly different situation. On the other hand, putting trans women in men's prisons almost certainly guarantees that they will be assualted. What is the reasonable balance? I'm not sure that I have the answer for that, but I think that it's something which needs more discussion and creative problem solving other than just declaring "If you have a penis, you are a man."