A lot of people underestimate rats, rats are just like dogs in so many ways (I'm always telling this to my friends and they just roll their eyes at the crazy rat lady). Rat's, just like dogs, can be nippy as baby's, this is because they are tasting and learning about the world around them, so all you need to do is make a squeaky noise and then they now it hurts. For adult rats, as long as you get them from a good breeder: Rat Breeder Red Flags List
- or rescue (the rescue will give you good starter rats), and you treat your rat right your rat will have no reason to bite you. Pet rats are not biters, from my experience, the only rat I had that bit was from a feeder litter (to feed snakes, these are not bred for temperament). If your rat does happen to bite, then yes you can wear gloves until you successfully train it to trust you. To know if a rat is going to bite, you need to be attuned to your rats body language (just like dogs), the most prominent anger/fear signs you should know are if your rats fur is puffed up, or if your rat freezes (just like dogs they get the flight or fight instinct), when you see your rat frozen, staring into space then just leave them until they snap out. Here's an article on rat language: Major Rat Body Language - RattyRat - JoinRats
To sum it up, just like any pet, rats require patience and effort. As long as you make the right decisions, your ratties should love you. If you decide to get the little critters, make sure to do lots of research before doing so.
Rats usually only bite if afraid or stressed. My rat Tesla was very sick shortly after I got her, and I spent two weeks giving her antibiotics and liquid food from a syringe. This was very stressful and she began to fear me taking her out of the cage. She started biting any human fingers that were invading her safe space - the cage. (My other rats were totally fine and never bit anyone. ) Tesla bit me a few times, but they were shallow bites, and I learned to be very careful and not stick my hands in the cage with her in there. I figured out a way to lure her out with a Yogie and grab her gently to get her out for playtime/ cage cleaning. Anyway, after a couple weeks of not sticking my hands in the cage, she has learned to trust me and I am happy to say that she no longer bites. I agree with Rex that rats are similar to dogs. They bite rarely, and when they do it's for a reason.