In space, enemies 'see' you at 10KM. On ground, generally, enemies see you at around 20-25M.
And unless you attack first (instantly aggroing), it takes them a few seconds to actually attack you, usually.
At least from my experience
Was named Trek17, but still an author.
Been playing STO since Open Beta, and have never regarded anything as worse than 'meh'. I have nothing against the game/devs, nor any particular wish to talk bad about either, or praise most decisions. Still, it's better to be positive than cynical.