Which means she rewrote her own code.
Jo: I need you to get into Piper's code and eliminate the fatal exception.
Alan: Even if I could, I wouldn't.
Jo: Why not?
Alan: Do you have a full understanding of how she was able to get Emily out of her head?
Jo: She did it herself.
Alan: Which means she rewrote her own code.