whenever a cog sees another one die it will look around for threats and if it spots a player it will start shooting and the scanning (looking around) is more in depth then just the cog normally looking so it can see farther and stuff.
This type of behavior is already in the game. It gets triggered just by shot impacts in the proximity of a COG unit. Or when you shoot the drillship and it alerts all COG units around. The COG unit that got alerted by incoming shot can alert other COGs too. They do not detect dead COGs, so if you manage to instakill one before it sounds the alarm you are fine.