No matter how friendly a bird might be, they will sometimes bite if they are too excited. They aren't biting to attack, they are biting to continue playing more aggressively. You should be aware of your bird's body language to prevent biting.