I don't know how eating random bugs will affect cats specifically, but generally poisonous bugs taste really foul -- the whole point of being poisonous is to train predators to not eat members of your species. Your cat has probably already learned to not eat any of those you might have in your home.
Ants in particular are not typically poisonous (i.e. containing a substance that's dangerous to consume), but many are venomous (i.e. able to inject a dangerous substance by biting or stinging). Many venoms are not really dangerous to consume -- they get digested before reaching the bloodstream. There are plenty of ants that defend themselves with formic acid, for example, which is painful to be sprayed with and probably tastes awful, but is a fairly common food preservative.
The main concern with ants is actually the poison people use to control them. Ant poisons need to be slow-acting in order to have time to affect the entire colonypopulation. (Worker ants typically forage for food, and when two sister ants meet they share the contents of their stomach, so food gradually "averages out" across the entire colony.) So if the ants from one populationcolony are taking poisonous bait and your cat is eating the ants, it may be accumulating that poison too. To be clear, this is something I can imagine happening, but I don't know how much of a risk it really is.