I tend to let the AI make my ships, and the AI escort can do little to a pirate in early game, unless it is a pirate escort, which hardly can do much to a mining station anyways.
One primary annoyance in early game is that it is hard to kill pirates, since the kill rate is so slow that they get away with retreat set at 20-40% shields.
Some very few tech upgrades make anti pirate life easier, and once the empire grows a tiny bit, hopefully explorers and mining spies can start spotting nearby pirate bases.
I have AWACs ships to find the pirate Bases, and Taskforce of several destroyers dedicated to pirate base elimination.
The problem is that these bases randomly appear. I build my escorts such that the give time either for a ship to escape or for a frigate or two to arrive and restore the situation.
The biggest problem there is that you cannot get them all, and I have seen pirate fragments reassemble with other pirates, and you later on end up with a pirate fleet 10 or 12 strong (at least that is what I think is happening). They are usually smaller ships, but it is usually a little bit of a surprise.
Remember that the evil which is now in the world will become yet more powerful, and that it is not evil which conquers evil, but only love -- Olga Romanov.