Let the bird out as often as possible. The environment needs to be checked to ensure the bird has periods of rest and escape from it, having an area the bird can hide behind is ideal. The bird may also respond to having a consistent bedtime and at least 12 hours of sleep. Cover the cage at night. Regulate contact with people and animals to prevent stress from prolonged contact but allow the bird to retreat if it has had enough.
Contact is vital to prevent boredom and frequent small amounts are best.
Punishment should be given with caution as this may provide the bird with attention and reinforce the behaviour, but it may also lead to fear of or aggression to the owner. If the bird is sat on your shoulder shaking suddenly will disorientate the bird and alarm it. If it continues to bite then it should be placed in the cage. It is far better to prevent the situation from occurring. Toys should be rationed and only left in the cage for a week or two.