A ninja (忍者?) or shinobi (忍び?) was a covert agent or mercenary in feudal Japan, whose functions included espionage, sabotage, infiltration, assassination and guerrilla warfare. Their covert methods of waging irregular warfare were deemed "dishonorable" and "beneath" the samurai-caste, who observed strict rules about honor and combat, thereby making the two deadly rivals in many media sources. Often, ninja in modern media are shown to be the greatest of the great in terms of assassins.