Cloaked players do not appear on your overview or in the D-Scanning list. This means that a cloaked war target or pirate could be right on top of you and you wouldn’t even know it. While there are ways to force a player to decloak, they’re not foolproof by any means. Therefore, deterring and mitigating the impact of a cloak ambush will often serve you better than preventing one.
Deterring a Cloak Ambush
The advantage of cloaked ships is the element of surprise, but they are by no means the most powerful ships in the game. Cloaked ambush ships can be very pricey and often have poor defenses, so it may not be in their best interest to attempt such a maneuver with adequate defenses. By simply having a well defended fleet, you may discourage hostiles from attacking in the first place.
Mitigating the Impact of a Cloak Ambush
They objective of a cloaked ambush is to do as much damage as possible before quickly retreating, though given the opportunity they will finish the job to completion before leaving. As such, the primary target of such an ambush are usually pricey, slow-to-warp, and poorly defended ships. Logistics ships in particular are the most common targets: mining barges, transport ships, support ships, etc.
There are a few strategies and tactics available to deal with an ambush when it occurs, though it should be noted that most of these strategies require preparation in advance.
Quick and Lethal Retaliation
The most obvious response to an ambush is to kill the enemy before they can kill any of you, or at least to inflict substantially more damage on the enemy than they inflict on you.
Most of the losses will will be incurred by the initial wave of alpha strikes, so it is extremely important that the likely targets have sufficient tanking ability to survive long enough for your fleet to retaliate.
Your fleet will require substantial firepower and numbers in order for this option to be feasible. In particular, the loss of some of your combatants should not prevent you from repelling the enemy. In general, it is better to focus on having a strong alpha strike rather than a high sustained DPS, as the objective is to eliminate the enemy quickly (and probably escaping shortly after) rather than getting into prolonged battle.
Neutralization and Escape
It may be considerably easier to simply neutralize with EWAR the enemy’s ability to destroy your fleet and prevent its escape than to try to fight them head on.
The most effective EWAR to enable the escape of your fleet would be Remote Sensor Dampening (specifically Targeting Range Dampening) and ECM. Target Range Dampening will prevent the enemy’s ability to use turrets and targeted missiles from a great distance, but they can still field drones and FoF missiles. ECM will prevent the enemy’s ability to target your fleet at all, but it’s not guaranteed to succeed and also would not prevent them from using drones or FoF missiles.
CAPWAR can also be used to a lesser extent. While successfully depleting an enemy’s ship will prevent them from using energy and hybrid turrets as well as EWAR and CAPWAR, it will not prevent them from using projectile turrets, missiles, or drones.