The target is set as enemy to the player, so should be red and hostile... Furthermore there is also a cue to set it to hostile if you attack it (belt and braces!!), but it doesn't always happen.
There is no logic behind it either - I've had targets where my rep rank is -5 (shoot on sight) with the target race, but they've shown up blue, but a race where rep rank is +10 and they're red - go figure...

It gets even more frustrating when you create a fleet for a mission and set it as 'enemy' and then for no reason half the fleet turns blue - or some will be blue on the sector map, but red when you target them... and, you can run the same mission dozens of times and get different results every time.