Yes having a pet rat can be risky especially if you get bitten by the rat.
Rats including Pet rats can carry many diseases and pass them on to humans including the hantavirus, leptospirosis, lymphocytic choriomeningitis (LCMV), Tularemia and Salmonella.
If you do get bitten by a rat or even your pet rat you should seek medical attention right away so you can prevent other health problems from arising and prevent potential death from occurring should you get affected by the viruses that the Rats carry.