The ants aren't dangerous in themselves, but more of a nuisance because they are attracted to the bird's food. Try standing the cage in a large tray (such as a large litter box) containing water, which creates a moat the ants can't cross.