I had a female that was nice in the beginning, but she very quickly learned that when I opened the cage, she got a treat. This turned into her biting me hard whenever I opened the cage and happened to have my thumb close enough for her to get to. She won't bite when I had her in hand. So I would give her a treat first and then pick her up.
I never stuck my hand in the cage without her first having a treat. She was a pig and refused to let go of the treat at all costs, so it worked in my favor.

I also have a rex male that has tagged me a few times on the tips and bit HARD. He used to play with me through the cage bars, but one day he got me twice. That was because I used to give treats through the bars. My bad. I worried so much about it that I was really nervous about doing anything in the cage, because when ever he saw my hands, he would take a nip, and they do hurt. He was going to be snake food very soon after the second hard bite.

I tested him to see if it was agression. I would put any item up to the cage, and he would "attack" that and try his hardest to eat it. Pen caps, paper, cardboard, leather belt, clothes. It didn't matter, he thought he was getting food. So I started to squirt him with water whenever he "attacked" the item. I would train him daily, and soon he was wary about taking anything through the cage. He's very good about it now and it only took 2 weeks for him to refuse anything through the cage bars.

Now he only gets a treat after I pick him up, rub him all over and mess up his hairdo to get him used to being handled without food, and then I give him a treat. He gets a treat after I pick him up and coddle him. He's a sweet little booger now and doesn't bite anymore.

You can do one of a couple things: Stop giving her treats all together and teach her that when you open the cage she doesnt get yummy food.
Or teach her that she gets a treat after she's in your hands and been ruffled and coddled with.
Good luck with her.