Whenever (potential) enemies are nearby, a stealth ring will form around your assassin. When you are still completely undetected, the ring will feature white bars pointing either down, up, or both up/down. The lines only appear at a certain part of the circle, aiming at the direction a potential threat is located. If the bars, akin to soundwave/music player bars, point up, this means the person is standing at a higher level than you. If the bars point down then they are below you. If the bars point both up/down, they're on the same level as you.
When an enemy notices you, the ring will turn solid and a pointy arrow aims in the direction of the person who noticed you. The ring will quickly fill up with a grey color. In this phase, (potential) enemies are only curious as to who you are, but will have made no judgement yet. If you're quick to move out of their line of sight, for example by moving around a corner or quickly climbing or rope-launching to a rooftop, the ring will go away. When you fail to do so, the ring will quickly turn yellow. This indicates that the enemy looking at you is suspicious about you, and a yellow marker also appears above their head, filling up just as quickly as the ring. Before it's filled you can still assassinate them in a quick window of opportunity. When it's filled they will come investigate to see who you are. The final phase has the ring turn red, after which the enemies fully engage into combat with you.
Protectors (Police Officers, Royal Guards) act somewhat differently. Although they will regularly take notice of you as indicated by the stealth ring, they only come after you when illegal or suspicious actions are performed, such as kidnapping someone. Upgrading 'Police Bribes' will make them turn away when kidnapping people, but outright murder in the street can't and won't be tolerated.
When you're discovered you can either fight or vanish/flee. To vanish, move around a corner, blend in with the crowd, use a smoke bomb or any other method to break the line of sight of your enemies. A silhouette will appear, marking your last known position. Move away further to erase the alert status completely.