Vesper Primer+Constant Effects+Improved Uncanny Dodge

Uncanny Dodge (Ex)

Starting at 4th level, a ninja can react to danger before her senses would normally allow her to do so. She cannot be caught flat-footed, nor does she lose her Dexterity bonus to AC if the attacker is invisible. She still loses her Dexterity bonus to AC if immobilized. A ninja with this ability can still lose her Dexterity bonus to AC if an opponent successfully uses the feint action against her.

If a ninja already possesses uncanny dodge from a different class, she automatically gains improved uncanny dodge instead.

Improved Uncanny Dodge (Ex)

At 8th level, a ninja can no longer be flanked. This defense denies another ninja (or rogue) the ability to sneak attack the ninja by flanking her, unless the attacker has at least four more ninja (or rogue) levels than the target does.

If a character already has uncanny dodge from another class, the levels from the classes that grant uncanny dodge stack when determining the minimum ninja (or rogue) level required to flank the character.